Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

IntegerImage.hpp

00001 #ifndef _IntegerImage_H
00002 #define _IntegerImage_H
00003 
00004 
00005 
00024 #include <stdio.h>
00025 
00026 #include "AnImage.hpp"
00027 #include "RImage.hpp"
00028 #include "CImage.hpp"
00029 #include "FImage.hpp"
00030 
00031 class IntegerImage : public AnImage
00032 {
00033 private:
00034 
00035 int*    image;
00036 
00037 public:
00038 
00039 IntegerImage(int w, int h);
00040 IntegerImage(int w, int h, int data);
00041 IntegerImage(int w, int h, int* data);
00042 IntegerImage(RImage& data);
00043 virtual ~IntegerImage(){ delete[] image; }
00044 
00045 virtual void set(RImage& data, int ch=0);
00046 virtual void set(FImage& data, int ch=0);
00047 virtual void set(CImage& data, int ctype=0, int ch=0){}
00048 
00049 virtual AnImage* copy();
00050 
00051 // data limits of each image type
00052 virtual int getMinBoundaryValue(){ return -2147483648; }
00053 virtual int getMaxBoundaryValue(){ return 2147483647; }
00054 virtual int getPower2MaxRangeBoundary(){ return 31; }
00055 
00056 virtual AnImage* rotate90Left(){ return 0; }
00057 virtual AnImage* rotate90Right(){ return 0; }
00058 
00059 virtual AnImage* scaleDown(int multiplier=2);
00060 virtual AnImage* scaleUp(int multiplier=2);
00061 virtual AnImage* zeroInterleaving();
00062 
00063 virtual AnImage* partImage(int x0=0, int y0=0, int w=256, int h=256){return 0;}
00064 virtual AnImage* subImage(int x0, int y0, int x1, int y1);
00065 virtual AnImage* smallImage(double xscale, double yscale);
00066 
00067 
00068 virtual int getRed(int x, int y){ return image[x+width*y]; }
00069 virtual int getGreen(int x, int y){ return image[x+width*y]; }
00070 virtual int getBlue(int x, int y){ return image[x+width*y]; }
00071 virtual int getGrey(int x, int y){ return image[x+width*y]; }
00072 
00073 virtual void setRed(int x, int y, int value){ image[x+width*y]=value; }
00074 virtual void setGreen(int x, int y, int value){ image[x+width*y]=value; }
00075 virtual void setBlue(int x, int y, int value){ image[x+width*y]=value; }
00076 virtual void setGrey(int x, int y, int value){ image[x+width*y]=value; }
00077 
00078 virtual void set(int x, int y, int value){ image[x+width*y]=value; }
00079 virtual int get(int x, int y)
00080         { return image[x+width*y]; }
00081 
00082 // RGB simulation
00083 virtual void setRGB(int x, int y, int r, int g, int b)
00084         {
00085         int val= (3*r+5*g+2*b)/10;
00086  
00087         image[x+width*y]=val; 
00088         }
00089 
00090 virtual unsigned char* getData(){ return (unsigned char*)image; }
00091 
00092 virtual void restaure(int iterations, double coeff){}
00093 virtual void restaure(int type, int iterations, double coeff){}
00094 
00095 virtual void report(FILE* file);
00096 virtual void output();
00097 };
00098 
00099 #endif
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com