Make CalypPixel work on stack

This commit is contained in:
2021-10-09 18:31:21 +01:00
parent 5b6d3e9031
commit 5b9e16a708
3 changed files with 122 additions and 157 deletions
+3 -3
View File
@@ -569,7 +569,7 @@ CalypPixel CalypFrame::getPixel( unsigned int xPos, unsigned int yPos ) const
return PixelValue;
}
CalypPixel CalypFrame::getPixel( unsigned int xPos, unsigned int yPos, CalypColorSpace eColorSpace )
CalypPixel CalypFrame::getPixel( unsigned int xPos, unsigned int yPos, CalypColorSpace eColorSpace ) const
{
return getPixel( xPos, yPos ).convertPixel( eColorSpace );
}
@@ -1262,12 +1262,12 @@ bool CalypFrame::toMat( cv::Mat& cvMat, bool convertToGray, bool scale, unsigned
cv::Mat tmpMat( imgHeight, imgWidth, CV_MAKETYPE( cvPrecision, numChannels ) );
unsigned char* cv_data = tmpMat.data;
CalypPixel currPel;
for( unsigned y = 0; y < imgHeight; y++ )
{
for( unsigned x = 0; x < imgWidth; x++ )
{
currPel = getPixel( x, y ) * scaleFactor;
CalypPixel currPel = getPixel( x, y );
currPel *= scaleFactor;
for( unsigned int ch = 0; ch < numChannels; ch++ )
for( unsigned b = 0; b < numBytes; b++ )
{