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.
|
una textura asociada a una animación de cuadros More...
#include <moTexture.h>
Public Types | |
enum | moPlayMode { MO_PLAYMODE_TIMEBASE, MO_PLAYMODE_FRAMEBASE } |
Public Member Functions | |
moTextureAnimated () | |
virtual | ~moTextureAnimated () |
virtual MOboolean | Init (moText p_name, MOuint p_moid, moResourceManager *p_res, moTexParam p_param=MODefTex2DParams) |
virtual MOboolean | Finish () |
virtual void | Play () |
virtual void | Stop () |
virtual bool | IsPlaying () |
virtual MOint | GetGLId (moTempo *tempo) |
virtual MOint | GetGLId (MOuint p_i) |
virtual MOint | GetGLId (MOfloat p_cycle) |
virtual MOuint | GetFrameCount () |
virtual void | SetFrameCount (MOuint p_nframes) |
virtual MOfloat | GetFramesPerSecond () |
virtual void | SetFramesPerSecond (MOfloat p_fps) |
virtual void | SetPlayMode (moPlayMode playmode) |
virtual moPlayMode | GetPlayMode () |
virtual void | GetFrame (MOuint p_i) |
virtual MOuint | GetActualFrame () |
virtual void | SetInterpolation (MOuint p_FrameJump, MOuint p_InterpolationTime) |
virtual MOboolean | IsInterpolating () |
virtual MOboolean | IsInterpolationActive () |
virtual MOboolean | ActivateInterpolation (MOboolean activate=true) |
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) |
moFBO * | GetFBO () 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) |
moTexture & | operator= (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... | |
Protected Member Functions | |
virtual MOboolean | NeedsInterpolation () |
virtual MOint | Interpolate () |
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) |
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 moDebug * | MODebug2 = new moDebug() |
Clase de impresión de errores para depuración More... | |
static moTextHeap * | MODebug = new moTextHeap() |
Lista de textos. More... | |
una textura asociada a una animación de cuadros
Clase de la que derivan las texturas animadas, y todas las que supongan tratar con una sucesión de imágenes.
Definition at line 549 of file moTexture.h.
Enumerator | |
---|---|
MO_PLAYMODE_TIMEBASE | |
MO_PLAYMODE_FRAMEBASE |
time base relative frame base relative |
Definition at line 635 of file moTexture.h.
moTextureAnimated::moTextureAnimated | ( | ) |
Constructor por defecto.
Definition at line 1375 of file moTexture.cpp.
|
virtual |
Destructor por defecto.
Definition at line 1395 of file moTexture.cpp.
Fija el estado del modo de interpolación.
activate | el nuevo estado. |
Definition at line 1562 of file moTexture.cpp.
|
virtual |
Destruye la textura openGL.
if (m_pInterpolator) { delete m_pInterpolator; m_pInterpolator = NULL; } if (m_pCopyStart) { delete m_pCopyStart; m_pCopyStart = NULL; } if (m_pCopyEnd) { delete m_pCopyEnd; m_pCopyEnd = NULL; }
Reimplemented from moTexture.
Reimplemented in moMovie, moTextureMultiple, moCircularVideoBuffer, and moVideoBuffer.
Definition at line 1421 of file moTexture.cpp.
|
virtual |
Definition at line 1743 of file moTexture.cpp.
|
virtual |
Calcula el cuadro i-ésimo de la animación.
p_i | índice del cuadro a cualcular. |
always needs implementation??? must be pure virtual.
Reimplemented in moMovie, moTextureMultiple, moCircularVideoBuffer, and moVideoBuffer.
Definition at line 1735 of file moTexture.cpp.
|
inlinevirtual |
Devuelve el número de cuadros de la animación.
Definition at line 615 of file moTexture.h.
|
inlinevirtual |
Devuelve los cuadros por segundo de la animación.
Definition at line 626 of file moTexture.h.
Devuelve el OpenGL ID de textura que corresponde al tempo pasado como parámetro.
tempo | puntero al objeto de tempo. |
Definition at line 1648 of file moTexture.cpp.
Devuelve el OpenGL ID de la sub-textura i-ésima.
p_i | índice del cuadro. |
Definition at line 1690 of file moTexture.cpp.
Devuelve el OpenGL ID de la textura, pasando como parámetro una fracción de ciclo 0 = cuadro 0, 1.0 = último cuadro.
p_cycle | fracción de ciclo entre 0.0 y 1.0. |
Definition at line 1717 of file moTexture.cpp.
|
virtual |
Devuelve el modo de reproducción :
Definition at line 1753 of file moTexture.cpp.
|
virtual |
Inicializa propiedades básicas de la textura tales como el nombre, id, administradores y parámetros.
p_name | nombre de la textura. |
p_moid | Moldeo ID de la textura. |
p_res | puntero al administrador de recursos, del cual son extraidos todos los administradores que la textura necesita (GL, Data, File, etc). |
p_param | parámetros de textura. |
Reimplemented from moTexture.
Reimplemented in moMovie, and moTextureMultiple.
Definition at line 1400 of file moTexture.cpp.
|
protectedvirtual |
Definition at line 1622 of file moTexture.cpp.
|
virtual |
Devuelve si el cuadro de la animación está en el rango de interpolación.
Definition at line 1552 of file moTexture.cpp.
|
virtual |
Devuelve si el modo de interpolación está activo.
Definition at line 1557 of file moTexture.cpp.
|
virtual |
|
protectedvirtual |
Definition at line 1583 of file moTexture.cpp.
|
virtual |
Play de la animación, corre la animación según su velocidad propia
Reimplemented in moMovie.
Definition at line 1441 of file moTexture.cpp.
|
inlinevirtual |
Fija el número de cuadros de la animación
p_nframes | Nuevo número de cuadros. |
Definition at line 620 of file moTexture.h.
|
inlinevirtual |
Fija el número de cuadros por segundo de la animación.
p_fps | Nuevo número de cuadros por segundo de la animación. |
Definition at line 632 of file moTexture.h.
Configura el modo de interpolación de la textura. Este modo genera texturas intermedias que entre dos cuadros de la animación.
p_FrameJump | cuadro que define el "salto" de la interpolación: las texturas interpoladas son generadas entre el cuadro p_FrameJump y p_FrameJump + 1. |
p_InterpolationTime | el tiempo que dura la interpolación. |
int m_idx; moFBO* m_pFBO; moTexture* m_pTex;
moTextureManager* TM = m_pResourceManager->GetTextureMan(); moFBManager* FM = m_pResourceManager->GetFBMan();
m_idx = FM->CreateFBO(); m_pFBO = FM->GetFBO(m_idx);
m_pShaderCopy = SM->GetShader(SM->GetShaderIndex(moText("shaders/Copy.cfg"),true) ); m_pShaderInterpolate = SM->GetShader(SM->GetShaderIndex(moText("shaders/TexInterpolator.cfg"),true) );
MOint idxstart = TM->AddTexture( moText(this->m_name)+moText("copyStart"), m_width, m_height); MOint idxend = TM->AddTexture(moText(this->m_name)+moText("copyEnd"), m_width, m_height);
copia del frame A m_srcstart.Empty(); m_srcstart.Add((moTexture*)this);
m_pTex = TM->GetTexture(idxstart); m_dststart.Empty(); m_dststart.Add(m_pTex); m_pTex->SetFBOandAttachPoint(m_pFBO);
copia del frame B m_srcend.Empty(); m_srcend.Add((moTexture*)this);
m_pTex = TM->GetTexture(idxend); m_dstend.Empty(); m_dstend.Add(m_pTex); m_pTex->SetFBOandAttachPoint(m_pFBO);
interpolacion con fuente A y B m_srcinterpol.Empty(); m_srcinterpol.Add( TM->GetTexture(idxstart)); m_srcinterpol.Add( TM->GetTexture(idxend));
m_pTex = (moTexture*)this; m_dstinterpol.Empty(); m_dstinterpol.Add(m_pTex); m_pTex->SetFBOandAttachPoint(m_pFBO); if (!(m_pCopyStart && m_pCopyEnd && m_pInterpolator)) { if (!m_pInterpolator) m_pInterpolator = new moTextureFilter(); if (!m_pCopyStart) m_pCopyStart = new moTextureFilter(); if (!m_pCopyEnd) m_pCopyEnd = new moTextureFilter(); } if (m_pCopyStart && m_pCopyEnd && m_pInterpolator) { m_pCopyStart->Init( m_pResourceManager->GetGLMan(), m_pResourceManager->GetRenderMan(), m_srcstart, m_dststart, m_pShaderCopy ); m_pCopyEnd->Init( m_pResourceManager->GetGLMan(), m_pResourceManager->GetRenderMan(), m_srcend, m_dstend, m_pShaderCopy ); m_pInterpolator->Init( m_pResourceManager->GetGLMan(), m_pResourceManager->GetRenderMan(), m_srcinterpol, m_dstinterpol, m_pShaderInterpolate ); }
Definition at line 1457 of file moTexture.cpp.
|
virtual |
Fija el modo de reproducción :
p_i | índice de textura a validar. |
Definition at line 1749 of file moTexture.cpp.
|
virtual |
Para la animación, mostrando el cuadro del principio
Reimplemented in moMovie.
Definition at line 1446 of file moTexture.cpp.
|
protected |
Definition at line 707 of file moTexture.h.
|
protected |
Definition at line 711 of file moTexture.h.
|
protected |
Definition at line 710 of file moTexture.h.
|
protected |
Definition at line 699 of file moTexture.h.
|
protected |
Definition at line 698 of file moTexture.h.
|
protected |
Definition at line 720 of file moTexture.h.
|
protected |
Definition at line 721 of file moTexture.h.
|
protected |
Definition at line 719 of file moTexture.h.
|
protected |
Definition at line 702 of file moTexture.h.
|
protected |
Definition at line 734 of file moTexture.h.
|
protected |
Definition at line 728 of file moTexture.h.
|
protected |
Definition at line 704 of file moTexture.h.
|
protected |
Definition at line 705 of file moTexture.h.
|
protected |
Definition at line 733 of file moTexture.h.
|
protected |
Definition at line 735 of file moTexture.h.
|
protected |
Definition at line 729 of file moTexture.h.
|
protected |
Definition at line 701 of file moTexture.h.
|
protected |
Definition at line 715 of file moTexture.h.
|
protected |
Definition at line 714 of file moTexture.h.
|
protected |
Definition at line 716 of file moTexture.h.
|
protected |
Definition at line 697 of file moTexture.h.
|
protected |
Definition at line 724 of file moTexture.h.
|
protected |
Definition at line 725 of file moTexture.h.
|
protected |
Definition at line 720 of file moTexture.h.
|
protected |
Definition at line 721 of file moTexture.h.
|
protected |
Definition at line 719 of file moTexture.h.
|
protected |
Definition at line 732 of file moTexture.h.
|
protected |
Definition at line 706 of file moTexture.h.