00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CIvfImage_h_
00026 #define _CIvfImage_h_
00027
00028 #include <ivf/IvfBase.h>
00029 #include <ivf/IvfGL.h>
00030
00031 IvfSmartPointer(CIvfImage);
00032
00040 class IVF_API CIvfImage : public CIvfBase {
00041 private:
00042 int m_size[2];
00043 int m_channels;
00044 double m_ratio;
00045 GLubyte* m_imageMap;
00046 GLint m_internalFormat;
00047 public:
00049 CIvfImage();
00050
00052 virtual ~CIvfImage();
00053
00054 IvfClassInfo("CIvfImage",CIvfBase);
00055
00062 void clear();
00063
00070 bool valid(int x, int y);
00071
00073 void setPixel(int x, int y, GLubyte red, GLubyte green, GLubyte blue);
00074
00076 void setValue(int x, int y, int channel, GLubyte value);
00077
00079 void setPixelAlpha(int x, int y, GLubyte alpha);
00080
00082 void getPixel(int x, int y, GLubyte &red, GLubyte &green, GLubyte &blue);
00083
00085 GLubyte getPixelAlpha(int x, int y);
00086
00088 void fillColor(GLubyte red, GLubyte green, GLubyte blue);
00089
00091 void fillColorAlpha(GLubyte alpha);
00092
00094 void fillRect(int x1, int y1, int x2, int y2, GLubyte red, GLubyte green, GLubyte blue);
00095
00097 void fillRectAlpha(int x1, int y1, int x2, int y2, GLubyte alpha);
00098
00100 void drawFrame(int x1, int y1, int x2, int y2, GLubyte red, GLubyte green, GLubyte blue);
00101
00103 void drawFrameAlpha(int x1, int y1, int x2, int y2, GLubyte alpha);
00104
00115 void replaceColor(GLubyte srcRed, GLubyte srcGreen, GLubyte srcBlue, GLubyte tgtRed, GLubyte tgtGreen, GLubyte tgtBlue);
00116
00125 void createAlphaMask(int treshold, int component, int over, int under);
00126
00128 void createAlphaFromColor();
00129
00137 void setChannels(int channels);
00138
00140 int getChannels();
00141
00148 void setInternalFormat(GLint format);
00149
00151 GLint getInternalFormat();
00152
00159 void setSize(int width, int height);
00160
00162 int getHeight();
00163
00165 int getWidth();
00166
00168 double getRatio();
00169
00171 void setImageMap(void* image);
00172
00178 GLubyte* getImageMap();
00179
00181 GLint getFormat();
00182 };
00183
00184
00185
00186 #endif
00187