Refactor ClpPixelFormats enum

This commit is contained in:
jfmcarreira committed 2021-10-27 23:17:32 +01:00
1 parent bb2a1ac228
commit 480a7f1d38
29 files changed
+87 -88

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ bool AbsoluteFrameDifference::create( std::vector<CalypFrame*> apcFrameList )
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], CalypFrame::MATCH_COLOR_SPACE_IGNORE_GRAY | CalypFrame::MATCH_COLOR_SPACE | CalypFrame::MATCH_RESOLUTION | CalypFrame::MATCH_BITS ) )
return false;
m_pcFrameDifference = std::make_unique<CalypFrame>( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::CLP_GRAY, apcFrameList[0]->getBitsPel() );
m_pcFrameDifference = std::make_unique<CalypFrame>( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::Gray, apcFrameList[0]->getBitsPel() );
return true;
}
+1 -1
View File
@@ -51,7 +51,7 @@ bool DisparityStereoBM::create( std::vector<CalypFrame*> apcFrameList )
{
_BASIC_MODULE_API_2_CHECK_
m_pcDisparityFrame =
new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::CLP_GRAY );
new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::Gray );
if( ( m_uiBlockSize % 2 ) == 0 )
{
m_uiBlockSize++;
+1 -1
View File
@@ -51,7 +51,7 @@ bool DisparityStereoSGBM::create( std::vector<CalypFrame*> apcFrameList )
{
_BASIC_MODULE_API_2_CHECK_
m_pcDisparityFrame =
new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::CLP_GRAY );
new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::Gray );
if( ( m_uiBlockSize % 2 ) == 0 )
{
m_uiBlockSize++;
+1 -1
View File
@@ -41,7 +41,7 @@ FilterComponentModule::FilterComponentModule()
bool FilterComponentModule::createFilter( unsigned int uiWidth, unsigned int uiHeight, unsigned int bitsPixel )
{
m_pcFilteredFrame = NULL;
m_pcFilteredFrame = new CalypFrame( uiWidth, uiHeight, ClpPixelFormats::CLP_GRAY, bitsPixel );
m_pcFilteredFrame = new CalypFrame( uiWidth, uiHeight, ClpPixelFormats::Gray, bitsPixel );
return true;
}
+1 -1
View File
@@ -45,7 +45,7 @@ FrameBinarization::FrameBinarization()
void FrameBinarization::create( CalypFrame* frame )
{
m_pcBinFrame = NULL;
m_pcBinFrame = new CalypFrame( frame->getWidth(), frame->getHeight(), ClpPixelFormats::CLP_GRAY, 8 );
m_pcBinFrame = new CalypFrame( frame->getWidth(), frame->getHeight(), ClpPixelFormats::Gray, 8 );
}
CalypFrame* FrameBinarization::process( CalypFrame* frame )
+4 -4
View File
@@ -61,7 +61,7 @@ bool FrameMask::create( std::vector<CalypFrame*> apcFrameList )
m_iWeight = m_iWeight > 100 || m_iWeight < 0 ? 5 : m_iWeight;
m_iWeight = m_iWeight > 10 ? m_iWeight / 10 : m_iWeight;
auto iPelFmt = ClpPixelFormats::CLP_INVALID_FMT;
auto iPelFmt = ClpPixelFormats::Invalid;
int iColorSpace = apcFrameList[0]->getColorSpace();
if( iColorSpace == CLP_COLOR_GRAY )
{
@@ -70,13 +70,13 @@ bool FrameMask::create( std::vector<CalypFrame*> apcFrameList )
switch( iColorSpace )
{
case CLP_COLOR_GRAY:
iPelFmt = ClpPixelFormats::CLP_GRAY;
iPelFmt = ClpPixelFormats::Gray;
break;
case CLP_COLOR_YUV:
iPelFmt = ClpPixelFormats::CLP_YUV444P;
iPelFmt = ClpPixelFormats::YUV444p;
break;
case CLP_COLOR_RGB:
iPelFmt = ClpPixelFormats::CLP_RGB24;
iPelFmt = ClpPixelFormats::RGB24;
break;
}
+1 -1
View File
@@ -61,7 +61,7 @@ bool HEVCIntraPrediction::create( std::vector<CalypFrame*> apcFrameList )
{
_BASIC_MODULE_API_2_CHECK_
m_pcPredBlock = NULL;
m_pcPredBlock = new CalypFrame( m_iBlockSize * 2 + 1, m_iBlockSize * 2 + 1, ClpPixelFormats::CLP_GRAY, apcFrameList[0]->getBitsPel() );
m_pcPredBlock = new CalypFrame( m_iBlockSize * 2 + 1, m_iBlockSize * 2 + 1, ClpPixelFormats::Gray, apcFrameList[0]->getBitsPel() );
m_referenceMem.resize( m_iBlockSize * 4 );
+1 -1
View File
@@ -53,7 +53,7 @@ bool InterFrameVariance::create( std::vector<CalypFrame*> apcFrameList )
return false;
m_pcFrameVariance =
new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::CLP_GRAY, 8 );
new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::Gray, 8 );
m_pVariance = CalypPlane<double>{ apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight() };
+1 -1
View File
@@ -69,7 +69,7 @@ bool MeasureOpticalFlowDualTVL1::create( std::vector<CalypFrame*> apcFrameList )
#else
m_cTvl1 = cv::createOptFlow_DualTVL1();
#endif
m_pcOutputFrame = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::CLP_GRAY );
m_pcOutputFrame = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::Gray );
return true;
}
+1 -1
View File
@@ -62,7 +62,7 @@ bool OpticalFlowModule::commonCreate( std::vector<CalypFrame*> apcFrameList )
return false;
m_iStep = 16;
m_pcOutputFrame = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::CLP_GRAY );
m_pcOutputFrame = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::Gray );
return true;
}
+1 -1
View File
@@ -200,7 +200,7 @@ bool ThreeSixtyDownsampling::createDownsamplingMask( CalypFrame* pcInputFrame )
return false;
// m_pcDownsampled = new CalypFrame( m_iWidth, m_uiHeight, pcInputFrame->getPelFormat(), pcInputFrame->getBitsPel() );
m_pcDownsampled = new CalypFrame( m_iWidth, m_iHeight, ClpPixelFormats::CLP_GRAY, pcInputFrame->getBitsPel() );
m_pcDownsampled = new CalypFrame( m_iWidth, m_iHeight, ClpPixelFormats::Gray, pcInputFrame->getBitsPel() );
m_isOdd = !( m_iHeight % 2 );
for( unsigned ch = 0; ch < m_pcDownsampled->getNumberChannels(); ch++ )
+1 -1
View File
@@ -39,7 +39,7 @@ protected:
std::string moduleName = CALYP_TEST_MODULE_NAME;
pcStream = std::make_unique<CalypStream>();
pcStream->open( std::string( CALYP_TEST_DATA_DIR ) + std::string( "/BasketballDrill_F10_832x480_yuv420p.yuv" ), 832, 480, ClpPixelFormats::CLP_YUV420P, 8,
pcStream->open( std::string( CALYP_TEST_DATA_DIR ) + std::string( "/BasketballDrill_F10_832x480_yuv420p.yuv" ), 832, 480, ClpPixelFormats::YUV420p, 8,
CLP_BIG_ENDIAN, 1, CalypStream::Type::Input );
}
@@ -52,7 +52,7 @@ protected:
std::string moduleName = CALYP_TEST_MODULE_NAME;
pcStream = std::make_unique<CalypStream>();
pcStream->open( std::string( CALYP_TEST_DATA_DIR ) + std::string( "/BasketballDrill_F10_832x480_yuv420p.yuv" ), 832, 480, ClpPixelFormats::CLP_YUV420P, 8,
pcStream->open( std::string( CALYP_TEST_DATA_DIR ) + std::string( "/BasketballDrill_F10_832x480_yuv420p.yuv" ), 832, 480, ClpPixelFormats::YUV420p, 8,
CLP_BIG_ENDIAN, 1, CalypStream::Type::Input );
CalypModulesFactoryMap& moduleFactoryMap = CalypModulesFactory::Get()->getMap();