mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
enable processing of 16, 32 and 64 bit 4 channel data using GDAL1.2
This commit is contained in:
parent
072f873df6
commit
22d8a81a57
@ -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"); }
|
||||
}
|
||||
|
||||
@ -574,4 +579,4 @@ bool GdalDecoder::checkSignature( const String& signature )const{
|
||||
|
||||
} /// End of cv Namespace
|
||||
|
||||
#endif /**< End of HAVE_GDAL Definition */
|
||||
#endif /**< End of HAVE_GDAL Definition */
|
||||
|
Loading…
Reference in New Issue
Block a user