Improvements in PlaYUVerFrame
Add default parameters in constructor Add a number of channels Add function to verify is frame is valid
This commit is contained in:
1 parent
2efc127d7a
commit
6109ee6c2b
2 files changed
+23
-3
No files matched your search
@@ -33,9 +33,16 @@ namespace plaYUVer
|
||||
PlaYUVerFrame::PlaYUVerFrame( UInt width, UInt height, Int pel_format )
|
||||
{
|
||||
m_pppcInputPel = NULL;
|
||||
m_pcRGBPelInterlaced = NULL;
|
||||
m_uiWidth = width;
|
||||
m_uiHeight = height;
|
||||
m_iPixelFormat = pel_format;
|
||||
m_iNumberChannels = 3;
|
||||
|
||||
if( m_uiWidth == 0 || m_uiWidth == 0 || m_iPixelFormat == -1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_bHasRGBPel = false;
|
||||
|
||||
@@ -57,6 +64,9 @@ PlaYUVerFrame::PlaYUVerFrame( UInt width, UInt height, Int pel_format )
|
||||
case RGB8:
|
||||
getMem3ImageComponents<Pel>( &m_pppcInputPel, m_uiHeight, m_uiWidth, 1, 1 );
|
||||
break;
|
||||
default:
|
||||
m_pppcInputPel = NULL;
|
||||
break;
|
||||
}
|
||||
getMem1D<Pel>( &m_pcRGBPelInterlaced, m_uiHeight * m_uiWidth * 3 );
|
||||
openPixfc();
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#endif
|
||||
#include "TypeDef.h"
|
||||
|
||||
|
||||
class QImage;
|
||||
|
||||
namespace plaYUVer
|
||||
@@ -54,7 +53,7 @@ static const QString gInputStreamFormatsNames[] =
|
||||
class PlaYUVerFrame
|
||||
{
|
||||
public:
|
||||
PlaYUVerFrame( UInt width, UInt height, Int pel_format );
|
||||
PlaYUVerFrame( UInt width = 0, UInt height = 0, Int pel_format = 0 );
|
||||
~PlaYUVerFrame();
|
||||
|
||||
enum PixelFormats
|
||||
@@ -119,11 +118,21 @@ public:
|
||||
{
|
||||
return m_iPixelFormat;
|
||||
}
|
||||
Int getNumberChannels()
|
||||
{
|
||||
return m_iNumberChannels;
|
||||
}
|
||||
|
||||
Bool isValid()
|
||||
{
|
||||
return ( m_uiWidth > 0 ) && ( m_uiHeight > 0 ) && ( m_iPixelFormat >= 0 );
|
||||
}
|
||||
|
||||
private:
|
||||
UInt m_uiWidth;
|
||||
UInt m_uiHeight;
|
||||
Int m_iPixelFormat;
|
||||
Int m_iNumberChannels;
|
||||
|
||||
Bool m_bHasRGBPel;
|
||||
Pel*** m_pppcInputPel;
|
||||
@@ -135,7 +144,8 @@ private:
|
||||
PixFcSSE* m_pcPixfc;
|
||||
inline Void FrametoRGB8Pixfc();
|
||||
#endif
|
||||
};
|
||||
}
|
||||
;
|
||||
|
||||
} // NAMESPACE
|
||||
|
||||
|
||||
Reference in new issue
Block a user