enable processing of 16, 32 and 64 bit 4 channel data using GDAL1.2

This commit is contained in:
StevenPuttemans 2017-02-07 11:37:42 +01:00
parent 072f873df6
commit 22d8a81a57

View File

@ -308,6 +308,11 @@ void write_pixel( const double& pixelValue,
// input: 4 channel, output: 4 channel
else if( gdalChannels == 4 && image.channels() == 4 ){
if( image.depth() == CV_8U ){ image.at<Vec4b>(row,col)[channel] = newValue; }
else if( image.depth() == CV_16U ){ image.at<Vec4s>(row,col)[channel] = newValue; }
else if( image.depth() == CV_16S ){ image.at<Vec4s>(row,col)[channel] = newValue; }
else if( image.depth() == CV_32S ){ image.at<Vec4i>(row,col)[channel] = newValue; }
else if( image.depth() == CV_32F ){ image.at<Vec4f>(row,col)[channel] = newValue; }
else if( image.depth() == CV_64F ){ image.at<Vec4d>(row,col)[channel] = newValue; }
else{ throw std::runtime_error("Unknown image depth, gdal: 4, image: 4"); }
}