33 #include <Base/Image/Image.hh>
34 #include <Base/Image/ImageIO.hh>
42 int main(
int argc,
char *argv[])
46 BIASERR(argv[0]<<
" <image-file>");
52 BIASERR(
"error loading "<<argv[1]);
63 unsigned char **pDb = imbilinear.GetImageDataArray();
67 for (
unsigned int x=2; x<im.
GetWidth()-3; x++) {
68 for (
unsigned int y=2; y<im.
GetHeight()-3; y++) {
69 for (
unsigned int c=0; c<channelcount; c++) {
71 double(y)+
double(OFFY),
74 if (CurValue<0.0)CurValue = 0.0;
75 if (CurValue>255.0)CurValue = 255.0;
76 pDc[y][(x*channelcount)+c] = (
unsigned char) CurValue;
78 double(y)+
double(OFFY),
81 if (CurValue<0.0)CurValue = 0.0;
82 if (CurValue>255.0)CurValue = 255.0;
83 pDb[y][(x*channelcount)+c] = (
unsigned char) CurValue;
90 BIASERR(
"error writing cubic image");
95 BIASERR(
"error writing bilinear image");
double BilinearInterpolation(const double x, const double y, const unsigned short int channel=0) const
Generic bilinear interpolation.
unsigned int GetWidth() const
double BicubicInterpolation(const double &x, const double &y, const unsigned short int channel=0) const
Generic bicubic interpolation.
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.
unsigned int GetHeight() const
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
const StorageType ** GetImageDataArray() const
overloaded GetImageDataArray() from ImageBase