libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moTextureMemory Class Reference

clase base para el manejo de una textura con su copia comprimida en memoria More...

#include <moTexture.h>

Inheritance diagram for moTextureMemory:
moTexture moAbstract

Public Member Functions

 moTextureMemory ()
 
virtual ~moTextureMemory ()
 
virtual MOboolean Init (moText p_name, MOuint p_moid, moResourceManager *p_res, moTexParam p_param=MODefTex2DParams)
 
virtual MOboolean Init (moText p_name, MOuint p_moid, moResourceManager *p_res, moText bufferformat, moBitmap *pImageResult, moTexParam p_param=MODefTex2DParams)
 
virtual MOboolean BuildFromMemory ()
 Construye la textura opengl desde el bitmap en memoria. More...
 
virtual MOboolean BuildFromBitmap (moBitmap *p_bitmap, moText p_bufferformat="JPG")
 Guarda el bitmap con el formato elegido en memoria, luego construye la textura opengl. More...
 
virtual MOboolean LoadFromBitmap (moBitmap *p_bitmap)
 Guarda el bitmap con el formato elegido en memoria. More...
 
virtual MOboolean Finish ()
 
int GetReference ()
 
void ReleaseReference ()
 
int GetContrast ()
 
int GetLuminance ()
 
moVector3f GetColorMatrixCorner (int corner)
 0 left up, 1 right up, 2, left down, 3, righ down More...
 
moVector3f GetColorAverage ()
 
- Public Member Functions inherited from moTexture
 moTexture ()
 
virtual ~moTexture ()
 
MOboolean BuildEmpty (MOuint p_width, MOuint p_height)
 
MOboolean BuildFromBuffer (MOuint p_width, MOuint p_height, const GLvoid *p_buffer, GLenum p_format=GL_RGBA, GLenum p_type=GL_UNSIGNED_BYTE)
 
MOboolean BuildFromFile (moText p_filename)
 
MOboolean SupportedFile (moText p_filename)
 
MOboolean Load (moParam *p_param)
 
MOboolean Load (moValue *p_value)
 
MOboolean SetBuffer (const GLvoid *p_buffer, GLenum p_format=GL_RGBA, GLenum p_type=GL_UNSIGNED_BYTE)
 
MOboolean SetBuffer (MOuint p_width, MOuint p_height, const GLvoid *p_buffer, GLenum p_format=GL_RGBA, GLenum p_type=GL_UNSIGNED_BYTE)
 
MOboolean GetBuffer (GLvoid *p_buffer, GLenum p_format=GL_RGBA, GLenum p_type=GL_UNSIGNED_BYTE)
 
void SetGLMan (moGLManager *p_gl)
 
void SetDataMan (moDataManager *p_dataman)
 
void SetFileMan (moFileManager *p_fileman)
 
void SetFBO (moFBO *p_fbo)
 
MOuint SetFBOandAttachPoint (moFBO *p_fbo)
 
void SetFBOAttachPoint (MOuint p_fbo_attach_point)
 
moFBOGetFBO () const
 
MOuint GetFBOAttachPoint () const
 
moTextureType GetType () const
 
MOuint GetGLId () const
 
MOuint GetGLId (moMoldeoObject *p_src_mob)
 TODO: check this! obsolete? More...
 
MOuint GetMOId () const
 
void SetMOId (MOuint p_moid)
 
moText GetName () const
 
void SetName (moText p_name)
 
MOuint GetWidth () const
 
MOuint GetHeight () const
 
MOuint GetDataWidth () const
 
MOuint GetDataHeight () const
 
MOuint GetComponents () const
 
MOlong GetTexelCount () const
 
MOlong GetDataTexelCount () const
 
MOfloat GetMaxCoordS () const
 
MOfloat GetMaxCoordT () const
 
moTexParam GetTexParam () const
 
GLenum GetTexTarget () const
 
GLenum GetTexInternalFormat () const
 
GLint GetMinFilter () const
 
GLint GetMagFilter () const
 
GLint GetWrapS () const
 
GLint GetWrapT () const
 
void FlipBufferVert (MOubyte *pBuffer, MOint p_depth)
 
void CopyFromTex (moTexture *p_src_tex, MOboolean p_copy_glid, MOboolean p_copy_moid, MOboolean p_copy_type, MOboolean p_copy_name)
 
moTextureoperator= (const moTexture &p_src_tex)
 
MOboolean IsBuildedFromFile () const
 
moText CreateThumbnail (moText p_bufferformat, int w, int h, moText newfilename=moText(""))
 
bool CalculateLuminanceAndConstrast (int x0=0, int y0=0, int x1=0, int y1=0)
 
int GetLuminance () const
 
int GetContrast () const
 
MOboolean Refresh ()
 
- Public Member Functions inherited from moAbstract
 moAbstract ()
 
virtual ~moAbstract ()
 
virtual MOboolean Init ()
 Inicializa el objeto. More...
 
MOboolean Initialized ()
 Pregunta si está inicializado. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from moTexture
static MOuint NextPowerOf2 (MOuint p_seed)
 
- Public Attributes inherited from moAbstract
MOboolean m_bInitialized
 Valor de inicialización More...
 
- Static Public Attributes inherited from moAbstract
static moDebugMODebug2 = new moDebug()
 Clase de impresión de errores para depuración More...
 
static moTextHeapMODebug = new moTextHeap()
 Lista de textos. More...
 
- Protected Member Functions inherited from moTexture
void SetParam ()
 
void CalculateSize (MOuint p_width, MOuint p_height)
 
MOboolean Build ()
 
bool ResetBufferData (bool force_creation=false, int bytes_per_pixel=0)
 
- Protected Attributes inherited from moTexture
MOboolean m_bBuildedFromFile
 
moFilem_pFile
 
moDataManagerm_pDataMan
 
moFileManagerm_pFileMan
 
moGLManagerm_gl
 
moResourceManagerm_pResourceManager
 
moFBOm_fbo
 
MOuint m_fbo_attach_point
 
moTextureType m_type
 
MOint m_moid
 
MOuint m_glid
 
moText m_name
 
moTexParam m_param
 
MOuint m_width
 
MOuint m_height
 
MOuint m_bytespp
 
MOint m_components
 
MOfloat m_max_coord_s
 
MOfloat m_max_coord_t
 
int Luminance
 
int Contrast
 
moDWord Histogram [256]
 
MOubytem_pBufferData
 
MOuint m_buffer_width
 
MOuint m_buffer_height
 
MOuint m_buffer_bytespp
 

Detailed Description

clase base para el manejo de una textura con su copia comprimida en memoria

Esta clase mantiene en memoria una copia comprimida de la imagen a medida que esta imagen es requerida se aumenta el numero de referencia cuando la cantidad de referencias llegan a cero se da de baja de la memoria de opengl

See also
moTexture
moTextureBuffer
moTextureManager
moVideoManager

Definition at line 442 of file moTexture.h.

Constructor & Destructor Documentation

moTextureMemory::moTextureMemory ( )

Constructor por defecto.

Definition at line 1081 of file moTexture.cpp.

moTextureMemory::~moTextureMemory ( )
virtual

Destructor por defecto.

Definition at line 1096 of file moTexture.cpp.

Member Function Documentation

MOboolean moTextureMemory::BuildFromBitmap ( moBitmap p_bitmap,
moText  p_bufferformat = "JPG" 
)
virtual

Guarda el bitmap con el formato elegido en memoria, luego construye la textura opengl.

Save into memory

BuildFromMemory();

Definition at line 1297 of file moTexture.cpp.

MOboolean moTextureMemory::BuildFromMemory ( )
virtual

Construye la textura opengl desde el bitmap en memoria.

just execute this time for building the texture really in card memory

then apply the buffer

Definition at line 1231 of file moTexture.cpp.

MOboolean moTextureMemory::Finish ( )
virtual

Destruye la textura openGL.

Returns
true si la operación fue exitosa, false en caso contrario.

Reimplemented from moTexture.

Definition at line 1354 of file moTexture.cpp.

moVector3f moTextureMemory::GetColorAverage ( )
inline

Definition at line 505 of file moTexture.h.

moVector3f moTextureMemory::GetColorMatrixCorner ( int  corner)
inline

0 left up, 1 right up, 2, left down, 3, righ down

Definition at line 504 of file moTexture.h.

int moTextureMemory::GetContrast ( )
inline

Definition at line 498 of file moTexture.h.

int moTextureMemory::GetLuminance ( )
inline

Definition at line 500 of file moTexture.h.

int moTextureMemory::GetReference ( )

Devuelve una referencia (internamente marca la referencia y asigna la imagen a la textura) Para liberar la memoria de opengl hay q desreferenciar...

Returns
la cantidad de referencias (si es 0 es que no pudo cargar nada, asi q la referencia no sirve)

Definition at line 1319 of file moTexture.cpp.

MOboolean moTextureMemory::Init ( moText  p_name,
MOuint  p_moid,
moResourceManager p_res,
moTexParam  p_param = MODefTex2DParams 
)
virtual

Inicializa propiedades básicas de la textura tales como el nombre, id, administradores y parámetros.

Parameters
p_namenombre de la textura.
p_moidMoldeo ID de la textura.
p_respuntero al administrador de recursos, del cual son extraidos todos los administradores que la textura necesita (GL, Data, File, etc).
p_paramparámetros de textura.
Returns
true si la operación fue exitosa, false en caso contrario.

Reimplemented from moTexture.

Definition at line 1100 of file moTexture.cpp.

MOboolean moTextureMemory::Init ( moText  p_name,
MOuint  p_moid,
moResourceManager p_res,
moText  bufferformat,
moBitmap pImageResult,
moTexParam  p_param = MODefTex2DParams 
)
virtual

Definition at line 1106 of file moTexture.cpp.

MOboolean moTextureMemory::LoadFromBitmap ( moBitmap p_bitmap)
virtual

Guarda el bitmap con el formato elegido en memoria.

if there were already something , delete it! size may be different now!!!

close memory

Calculate luminance and contrast from histogram

calculate luminance

Calculating contrast difference or luminance variance

Definition at line 1115 of file moTexture.cpp.

void moTextureMemory::ReleaseReference ( )

Libera una referencia a esta textura pudiendo de esta manera, liberar la memoria de opengl...

deleting texture from opengl memory

Definition at line 1341 of file moTexture.cpp.


The documentation for this class was generated from the following files: