Add a FrameShift module and support for keys commands to be sent to modules

This commit is contained in:
jfmcarreira committed 2015-09-24 01:10:03 +01:00
1 parent 64fd5cb1a9
commit 57b775f7d1
11 files changed
+154 -65

No files matched your search

+26
View File
@@ -229,6 +229,22 @@ Void PlaYUVerFrame::init( UInt width, UInt height, Int pel_format, Int bitsPixel
m_cPelFmtName = PlaYUVerFrame::supportedPixelFormatListNames()[m_iPixelFormat].c_str();
}
Void PlaYUVerFrame::clear()
{
Pel uiValue = 128;
for( UInt ch = 0; ch < m_pcPelFormat->numberChannels; ch++ )
{
//uiValue = ch > 0 ? 0 : 128;
memset( m_pppcInputPel[ch][0], uiValue,
CHROMASHIFT( m_uiHeight, m_pcPelFormat->log2ChromaHeight ) * CHROMASHIFT( m_uiWidth, m_pcPelFormat->log2ChromaWidth ) * sizeof(Pel) );
}
}
std::string PlaYUVerFrame::getPelFmtName()
{
return m_pcPelFormat->name;
}
Int PlaYUVerFrame::getColorSpace() const
{
return m_pcPelFormat->colorSpace;
@@ -262,6 +278,16 @@ UInt PlaYUVerFrame::getPixels() const
return ( m_uiWidth * m_uiHeight );
}
UInt8 PlaYUVerFrame::getChromaWidthRatio() const
{
return m_pcPelFormat->log2ChromaWidth;
}
UInt8 PlaYUVerFrame::getChromaHeightRatio() const
{
return m_pcPelFormat->log2ChromaHeight;
}
UInt PlaYUVerFrame::getChromaWidth() const
{
if( m_pcPelFormat->colorSpace == GRAY )
+9 -6
View File
@@ -45,13 +45,15 @@ struct PlaYUVerPixFmtDescriptor;
#define MAX_NUMBER_COMPONENTS 4
#define CHROMASHIFT( SIZE, SHIFT ) UInt( -( ( - ( Int( SIZE ) ) ) >> SHIFT ) )
/**
* \class PlaYUVerFrame
* \ingroup PlaYUVerLib PlaYUVerLib_Frame
* \brief Frame handling class
*/
class PlaYUVerFrame
//: public PlaYUVerFrameStats
//: public PlaYUVerFrameStats
{
public:
@@ -206,6 +208,8 @@ public:
~PlaYUVerFrame();
Void clear();
/**
* Get number of bytes per frame of an existing frame
* @return number of bytes per frame
@@ -216,6 +220,8 @@ public:
UInt getNumberChannels() const;
UInt getPixels() const;
UInt8 getChromaWidthRatio() const;
UInt8 getChromaHeightRatio() const;
UInt getChromaWidth() const;
UInt getChromaHeight() const;
UInt getChromaLength() const;
@@ -259,16 +265,13 @@ public:
return m_bHasHistogram;
}
Void copyFrom( PlaYUVerFrame* );
Void copyFrom( PlaYUVerFrame*, UInt, UInt );
PlaYUVerFrame::Pixel getPixelValue( Int xPos, Int yPos, ColorSpace eColorSpace = COLOR_INVALID );
std::string getPelFmtName()
{
return m_cPelFmtName;
}
std::string getPelFmtName();
UInt getWidth() const
{
return m_uiWidth;
-2
View File
@@ -36,8 +36,6 @@ namespace plaYUVer
#define CHROMARATIO( SIZE, RATIO ) ( RATIO > 1 ? ( ( SIZE + 1 ) / RATIO ) : SIZE )
#define CHROMASHIFT( SIZE, SHIFT ) UInt( -( ( - ( Int( SIZE ) ) ) >> SHIFT ) )
#define CLAMP(X) X = X < 0 ? 0 : X > 255 ? 255 : X;
#define YUV2RGB( iY, iU, iV, iR, iG, iB ) \
+14 -1
View File
@@ -74,14 +74,22 @@ enum Module_NumberOfFrames
MODULE_REQUIRES_SIX_FRAMES,
};
enum Module_Requirements
enum Module_Features
{
MODULE_REQUIRES_NOTHING = 0,
MODULE_REQUIRES_SKIP_WHILE_PLAY = 1,
MODULE_REQUIRES_OPTIONS = 2,
MODULE_REQUIRES_NEW_WINDOW = 4,
MODULE_USES_KEYS = 8,
};
enum Module_Key_Supported
{
MODULE_KEY_LEFT,
MODULE_KEY_RIGHT,
};
class PlaYUVerModuleIf
{
public:
@@ -139,6 +147,11 @@ public:
return 0;
}
virtual Bool keyPressed( enum Module_Key_Supported )
{
return false;
}
};
} // NAMESPACE