36 #include <Base/Common/BIASpragma.hh>
40 #include <Base/Image/ImageBase.hh>
41 #include <Base/Image/ImageConvert.hh>
42 #include <Base/Image/ImageIO.hh>
49 bool interleaved=
false;
51 unsigned mincoo[2], maxcoo[2];
54 unsigned char col[]={98, 234, 1};
55 im.FillImageWithConstValue(col);
57 unsigned w=im.GetWidth();
58 unsigned h=im.GetHeight();
61 im.SetROICorners(w>>2, h>>2, w-(w>>2), h-(h>>2));
65 col[0]=col[1]=col[2]=128;
66 im.FillImageWithConstValue(col);
69 cout << endl << (int)im.GetImageData()[0] <<
" "
70 << (int)im.GetImageData()[1]
71 <<
" " << (int)im.GetImageData()[2] << endl;
75 im.SetPixel((
unsigned char)215, ((w>>1)+2), (h>>1)+2, c);
76 im.SetPixel((
unsigned char)45, ((w>>1)-7), (h>>1)+5, c);
78 unsigned char min, max;
79 im.AddDebugLevel(D_IMAGE_MINMAXCOO);
80 im.GetMinMaxPixelValue(min, max, 1);
81 cerr <<
"min: "<<(int)min<<
"\tmax: "<<(
int)max<<endl;
82 im.GetMinMaxPixelValue(min, max, 1, mincoo, maxcoo);
83 cerr << "min: "<<(
int)min<<" at ("<<mincoo[0]<<", "<<mincoo[1]
84 <<")\tmax: "<<(
int)max<<" at ("<<maxcoo[0]<<", "<<maxcoo[1]<<")\n";
87 ImageIO::Save("minmax-img.mip", im);
Routines for loading and writing all kinds of image formats.