Home | History | Annotate | Download | only in src

Lines Matching refs:image

218                   Mat& image,
224 double newValue = range_cast(gdalType, image.depth(), pixelValue );
227 if( gdalChannels == 1 && image.channels() == 1 ){
228 if( image.depth() == CV_8U ){ image.at<uchar>(row,col) = newValue; }
229 else if( image.depth() == CV_16U ){ image.at<unsigned short>(row,col) = newValue; }
230 else if( image.depth() == CV_16S ){ image.at<short>(row,col) = newValue; }
231 else if( image.depth() == CV_32S ){ image.at<int>(row,col) = newValue; }
232 else if( image.depth() == CV_32F ){ image.at<float>(row,col) = newValue; }
233 else if( image.depth() == CV_64F ){ image.at<double>(row,col) = newValue; }
234 else{ throw std::runtime_error("Unknown image depth, gdal: 1, img: 1"); }
238 else if( gdalChannels == 1 && image.channels() == 3 ){
239 if( image.depth() == CV_8U ){ image.at<Vec3b>(row,col) = Vec3b(newValue,newValue,newValue); }
240 else if( image.depth() == CV_16U ){ image.at<Vec3s>(row,col) = Vec3s(newValue,newValue,newValue); }
241 else if( image.depth() == CV_16S ){ image.at<Vec3s>(row,col) = Vec3s(newValue,newValue,newValue); }
242 else if( image.depth() == CV_32S ){ image.at<Vec3i>(row,col) = Vec3i(newValue,newValue,newValue); }
243 else if( image.depth() == CV_32F ){ image.at<Vec3f>(row,col) = Vec3f(newValue,newValue,newValue); }
244 else if( image.depth() == CV_64F ){ image.at<Vec3d>(row,col) = Vec3d(newValue,newValue,newValue); }
245 else{ throw std::runtime_error("Unknown image depth, gdal:1, img: 3"); }
249 else if( gdalChannels == 3 && image.channels() == 1 ){
250 if( image.depth() == CV_8U ){ image.at<uchar>(row,col) += (newValue/3.0); }
251 else{ throw std::runtime_error("Unknown image depth, gdal:3, img: 1"); }
255 else if( gdalChannels == 4 && image.channels() == 1 ){
256 if( image.depth() == CV_8U ){ image.at<uchar>(row,col) = newValue; }
257 else{ throw std::runtime_error("Unknown image depth, gdal: 4, image: 1"); }
261 else if( gdalChannels == 3 && image.channels() == 3 ){
262 if( image.depth() == CV_8U ){ image.at<Vec3b>(row,col)[channel] = newValue; }
263 else if( image.depth() == CV_16U ){ image.at<Vec3s>(row,col)[channel] = newValue; }
264 else if( image.depth() == CV_16S ){ image.at<Vec3s>(row,col)[channel] = newValue; }
265 else if( image.depth() == CV_32S ){ image.at<Vec3i>(row,col)[channel] = newValue; }
266 else if( image.depth() == CV_32F ){ image.at<Vec3f>(row,col)[channel] = newValue; }
267 else if( image.depth() == CV_64F ){ image.at<Vec3d>(row,col)[channel] = newValue; }
268 else{ throw std::runtime_error("Unknown image depth, gdal: 3, image: 3"); }
272 else if( gdalChannels == 4 && image.channels() == 3 ){
274 else if( image.depth() == CV_8U && channel < 4 ){ image.at<Vec3b>(row,col)[channel] = newValue; }
275 else if( image.depth() == CV_16U && channel < 4 ){ image.at<Vec3s>(row,col)[channel] = newValue; }
276 else if( image.depth() == CV_16S && channel < 4 ){ image.at<Vec3s>(row,col)[channel] = newValue; }
277 else if( image.depth() == CV_32S && channel < 4 ){ image.at<Vec3i>(row,col)[channel] = newValue; }
278 else if( image.depth() == CV_32F && channel < 4 ){ image.at<Vec3f>(row,col)[channel] = newValue; }
279 else if( image.depth() == CV_64F && channel < 4 ){ image.at<Vec3d>(row,col)[channel] = newValue; }
280 else{ throw std::runtime_error("Unknown image depth, gdal: 4, image: 3"); }
284 else if( gdalChannels == 4 && image.channels() == 4 ){
285 if( image.depth() == CV_8U ){ image.at<Vec4b>(row,col)[channel] = newValue; }
286 else{ throw std::runtime_error("Unknown image depth, gdal: 4, image: 4"); }
300 Mat& image,
306 write_pixel( pixelValue, gdalType, 1, image, y, x, c );
311 write_pixel( pixelValue, gdalType, 1, image, y, x, c );
323 write_pixel( r, gdalType, 4, image, y, x, 2 );
324 write_pixel( g, gdalType, 4, image, y, x, 1 );
325 write_pixel( b, gdalType, 4, image, y, x, 0 );
326 if( image.channels() > 3 ){
327 write_pixel( a, gdalType, 4, image, y, x, 1 );
333 write_pixel( pixelValue, gdalType, 1, image, y, x, c );
345 // make sure the image is the proper size
358 // set the image to zero
382 // make sure the image band has the same dimensions as the image
398 // set inside the image
401 // set depending on image types
423 * Read image header
449 // get the image dimensions