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
moTextureAnimated Class Reference

una textura asociada a una animación de cuadros More...

#include <moTexture.h>

Inheritance diagram for moTextureAnimated:
moTexture moAbstract moCircularVideoBuffer moMovie moTextureMultiple moVideoBuffer moLuaCircularVideoBuffer moLuaVideoBuffer

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)
 
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...
 

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)
 

Protected Attributes

moPlayMode m_PlayMode
 
MOboolean m_bIsPlaying
 
MOboolean m_bIsPaused
 
MOuint m_nFrames
 
MOfloat m_fFramesPerSecond
 
MOuint m_FrameNext
 
MOuint m_FramePrevious
 
MOuint m_Time
 
MOuint m_ActualFrame
 
MOboolean m_bInterpolation
 
MOboolean m_bInterpolating
 
moTextureFilterm_pCopyStart
 
moTextureFilterm_pCopyEnd
 
moTextureFilterm_pInterpolator
 
moTextureArray m_srcstart
 
moTextureArray m_dststart
 
moTextureArray m_srcend
 
moTextureArray m_dstend
 
moTextureArray m_srcinterpol
 
moTextureArray m_dstinterpol
 
moShaderm_pShaderCopy
 
moShaderm_pShaderInterpolate
 
MOuint m_FrameJump
 
MOuint m_InterpolationTime
 
MOuint m_StartTime
 
MOuint m_FrameStart
 
MOuint m_FrameEnd
 
MOfloat m_InterpolationPosition
 
- 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
 

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...
 

Detailed Description

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.

See also
moMovie
moTextureMultiple

Definition at line 549 of file moTexture.h.

Member Enumeration Documentation

Enumerator
MO_PLAYMODE_TIMEBASE 
MO_PLAYMODE_FRAMEBASE 

time base relative

frame base relative

Definition at line 635 of file moTexture.h.

Constructor & Destructor Documentation

moTextureAnimated::moTextureAnimated ( )

Constructor por defecto.

Definition at line 1375 of file moTexture.cpp.

moTextureAnimated::~moTextureAnimated ( )
virtual

Destructor por defecto.

Definition at line 1395 of file moTexture.cpp.

Member Function Documentation

MOboolean moTextureAnimated::ActivateInterpolation ( MOboolean  activate = true)
virtual

Fija el estado del modo de interpolación.

Parameters
activateel nuevo estado.
Returns
el estado del modo de interpolación. Aunque se intente activar la interplación, puede ocurrir que los shaders requeridos para la operación de interpolación no estén disponibles, en cuyo caso se devuelve false.

Definition at line 1562 of file moTexture.cpp.

MOboolean moTextureAnimated::Finish ( )
virtual

Destruye la textura openGL.

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

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.

MOuint moTextureAnimated::GetActualFrame ( )
virtual

Definition at line 1743 of file moTexture.cpp.

void moTextureAnimated::GetFrame ( MOuint  p_i)
virtual

Calcula el cuadro i-ésimo de la animación.

Parameters
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.

virtual MOuint moTextureAnimated::GetFrameCount ( )
inlinevirtual

Devuelve el número de cuadros de la animación.

Returns
número de cuadros.

Definition at line 615 of file moTexture.h.

virtual MOfloat moTextureAnimated::GetFramesPerSecond ( )
inlinevirtual

Devuelve los cuadros por segundo de la animación.

Returns
cuadros por segundo.

Definition at line 626 of file moTexture.h.

MOint moTextureAnimated::GetGLId ( moTempo tempo)
virtual

Devuelve el OpenGL ID de textura que corresponde al tempo pasado como parámetro.

Parameters
tempopuntero al objeto de tempo.
Returns
OpenGL ID.

Definition at line 1648 of file moTexture.cpp.

MOint moTextureAnimated::GetGLId ( MOuint  p_i)
virtual

Devuelve el OpenGL ID de la sub-textura i-ésima.

Parameters
p_iíndice del cuadro.
Returns
OpenGL ID.

Definition at line 1690 of file moTexture.cpp.

MOint moTextureAnimated::GetGLId ( MOfloat  p_cycle)
virtual

Devuelve el OpenGL ID de la textura, pasando como parámetro una fracción de ciclo 0 = cuadro 0, 1.0 = último cuadro.

Parameters
p_cyclefracción de ciclo entre 0.0 y 1.0.
Returns
OpenGL ID.

Definition at line 1717 of file moTexture.cpp.

moTextureAnimated::moPlayMode moTextureAnimated::GetPlayMode ( )
virtual

Devuelve el modo de reproducción :

See also
moPlayMode MO_PLAYMODE_TIMEBASE : reproducción segun timer interno de GStreamer MO_PLAYMODE_FRAMEBASE : reproducción arbitraria por manejo de frame
Returns
moPlayMode modo de reproducción de este video

Definition at line 1753 of file moTexture.cpp.

MOboolean moTextureAnimated::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.

Reimplemented from moTexture.

Reimplemented in moMovie, and moTextureMultiple.

Definition at line 1400 of file moTexture.cpp.

MOint moTextureAnimated::Interpolate ( )
protectedvirtual

Definition at line 1622 of file moTexture.cpp.

MOboolean moTextureAnimated::IsInterpolating ( )
virtual

Devuelve si el cuadro de la animación está en el rango de interpolación.

Returns
true o falsed dependiendo del cuadro actual.

Definition at line 1552 of file moTexture.cpp.

MOboolean moTextureAnimated::IsInterpolationActive ( )
virtual

Devuelve si el modo de interpolación está activo.

Returns
true o false dependiendo del estado del modo de interpolación.

Definition at line 1557 of file moTexture.cpp.

bool moTextureAnimated::IsPlaying ( )
virtual

Pregunta si esta corriendo

Reimplemented in moMovie.

Definition at line 1451 of file moTexture.cpp.

MOboolean moTextureAnimated::NeedsInterpolation ( )
protectedvirtual

Definition at line 1583 of file moTexture.cpp.

void moTextureAnimated::Play ( )
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.

virtual void moTextureAnimated::SetFrameCount ( MOuint  p_nframes)
inlinevirtual

Fija el número de cuadros de la animación

Parameters
p_nframesNuevo número de cuadros.

Definition at line 620 of file moTexture.h.

virtual void moTextureAnimated::SetFramesPerSecond ( MOfloat  p_fps)
inlinevirtual

Fija el número de cuadros por segundo de la animación.

Parameters
p_fpsNuevo número de cuadros por segundo de la animación.

Definition at line 632 of file moTexture.h.

void moTextureAnimated::SetInterpolation ( MOuint  p_FrameJump,
MOuint  p_InterpolationTime 
)
virtual

Configura el modo de interpolación de la textura. Este modo genera texturas intermedias que entre dos cuadros de la animación.

Parameters
p_FrameJumpcuadro que define el "salto" de la interpolación: las texturas interpoladas son generadas entre el cuadro p_FrameJump y p_FrameJump + 1.
p_InterpolationTimeel 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.

void moTextureAnimated::SetPlayMode ( moTextureAnimated::moPlayMode  playmode)
virtual

Fija el modo de reproducción :

See also
moPlayMode MO_PLAYMODE_TIMEBASE : reproducción segun timer interno de GStreamer MO_PLAYMODE_FRAMEBASE : reproducción arbitraria por manejo de frame
Parameters
p_iíndice de textura a validar.

Definition at line 1749 of file moTexture.cpp.

void moTextureAnimated::Stop ( )
virtual

Para la animación, mostrando el cuadro del principio

Reimplemented in moMovie.

Definition at line 1446 of file moTexture.cpp.

Member Data Documentation

MOuint moTextureAnimated::m_ActualFrame
protected

Definition at line 707 of file moTexture.h.

MOboolean moTextureAnimated::m_bInterpolating
protected

Definition at line 711 of file moTexture.h.

MOboolean moTextureAnimated::m_bInterpolation
protected

Definition at line 710 of file moTexture.h.

MOboolean moTextureAnimated::m_bIsPaused
protected

Definition at line 699 of file moTexture.h.

MOboolean moTextureAnimated::m_bIsPlaying
protected

Definition at line 698 of file moTexture.h.

moTextureArray moTextureAnimated::m_dstend
protected

Definition at line 720 of file moTexture.h.

moTextureArray moTextureAnimated::m_dstinterpol
protected

Definition at line 721 of file moTexture.h.

moTextureArray moTextureAnimated::m_dststart
protected

Definition at line 719 of file moTexture.h.

MOfloat moTextureAnimated::m_fFramesPerSecond
protected

Definition at line 702 of file moTexture.h.

MOuint moTextureAnimated::m_FrameEnd
protected

Definition at line 734 of file moTexture.h.

MOuint moTextureAnimated::m_FrameJump
protected

Definition at line 728 of file moTexture.h.

MOuint moTextureAnimated::m_FrameNext
protected

Definition at line 704 of file moTexture.h.

MOuint moTextureAnimated::m_FramePrevious
protected

Definition at line 705 of file moTexture.h.

MOuint moTextureAnimated::m_FrameStart
protected

Definition at line 733 of file moTexture.h.

MOfloat moTextureAnimated::m_InterpolationPosition
protected

Definition at line 735 of file moTexture.h.

MOuint moTextureAnimated::m_InterpolationTime
protected

Definition at line 729 of file moTexture.h.

MOuint moTextureAnimated::m_nFrames
protected

Definition at line 701 of file moTexture.h.

moTextureFilter* moTextureAnimated::m_pCopyEnd
protected

Definition at line 715 of file moTexture.h.

moTextureFilter* moTextureAnimated::m_pCopyStart
protected

Definition at line 714 of file moTexture.h.

moTextureFilter* moTextureAnimated::m_pInterpolator
protected

Definition at line 716 of file moTexture.h.

moPlayMode moTextureAnimated::m_PlayMode
protected

Definition at line 697 of file moTexture.h.

moShader* moTextureAnimated::m_pShaderCopy
protected

Definition at line 724 of file moTexture.h.

moShader* moTextureAnimated::m_pShaderInterpolate
protected

Definition at line 725 of file moTexture.h.

moTextureArray moTextureAnimated::m_srcend
protected

Definition at line 720 of file moTexture.h.

moTextureArray moTextureAnimated::m_srcinterpol
protected

Definition at line 721 of file moTexture.h.

moTextureArray moTextureAnimated::m_srcstart
protected

Definition at line 719 of file moTexture.h.

MOuint moTextureAnimated::m_StartTime
protected

Definition at line 732 of file moTexture.h.

MOuint moTextureAnimated::m_Time
protected

Definition at line 706 of file moTexture.h.


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