00001
00033 #ifndef __VETLIB_VETFRAMERGB96_H__
00034 #define __VETLIB_VETFRAMERGB96_H__
00035
00036 #include "vetFrame.h"
00037 #include "PixelRGB96.h"
00038
00039 class vetFrameRGB96;
00040 #include "vetFrameYUV420.h"
00041 #include "vetFrameRGB24.h"
00042 #include "vetFrameRGBA32.h"
00043 #include "vetFrameGrey.h"
00044
00045
00046 class vetFrameRGB96 : public virtual vetFrame
00053 {
00054 public:
00055
00059 bool autoFreeData;
00060
00064 PixelRGB96 *data;
00065
00066
00067
00068 public:
00069
00073 enum ChannelRGB { RED, GREEN, BLUE };
00074
00075
00076
00077 public:
00078
00079
00083 vetFrameRGB96();
00084
00090 vetFrameRGB96(unsigned int width, unsigned int height);
00091
00096 vetFrameRGB96(vetFrameRGB96& img);
00097
00102 vetFrameRGB96(vetFrameRGB24& img);
00103
00108 vetFrameRGB96(vetFrameRGBA32& img);
00109
00114 vetFrameRGB96(vetFrameGrey& img);
00115
00119 ~vetFrameRGB96();
00120
00121
00122 VETRESULT setWidth(unsigned int newWidth);
00123 VETRESULT setHeight(unsigned int newHeight);
00124
00125 void* dump_buffer() { return static_cast<void*>(data); };
00126
00127 VETRESULT reAllocCanvas(unsigned int w, unsigned int h);
00128
00129
00130 unsigned int getBufferSize() { return (unsigned int)( width * height * 4); };
00131
00132
00133 unsigned int getBpp() { return sizeof(PixelRGB96) * 8; };
00134 VETRESULT setBlack();
00135 VETRESULT setWhite();
00136
00137 VETRESULT extractBrightness(unsigned char* buffer, unsigned int* size = NULL );
00138
00149 VETRESULT setPixel(unsigned int x, unsigned int y, PixelRGB96 p);
00150
00160 VETRESULT setRGB(unsigned int x, unsigned int y, int red, int green, int blue);
00161
00170 VETRESULT setChannel(unsigned int x, unsigned int y, ChannelRGB ch, int value);
00171
00179 VETRESULT getPixel(unsigned int x, unsigned int y, PixelRGB96& p) const;
00180
00181 const PixelRGB96& getPixel(unsigned int x, unsigned int y) const;
00182
00192 int getChannel(unsigned int x, unsigned int y, ChannelRGB ch) const;
00193
00201 vetFrameRGB96& clear(int = 0);
00202
00210 vetFrameRGB96& clearWith(PixelRGB96& bg);
00211
00220 vetFrameRGB96& clearChannel(ChannelRGB ch, int bg = 0);
00221
00222
00223
00224
00233 vetFrameRGB96& copy(vetFrameRGB96& img);
00234
00235
00236
00237
00246 vetFrameRGB96& operator = (vetFrameRGB96& img) { return this->copy(img); };
00247
00248
00257 vetFrameRGB96& operator += (vetFrameRGB96& img) ;
00258
00267 vetFrameRGB96& operator -= (vetFrameRGB96& img) ;
00268
00269
00270
00279 vetFrameRGB96& operator >> (vetFrameYUV420& img);
00280
00289 vetFrameRGB96& operator >> (vetFrameRGB24& img);
00290
00299 vetFrameRGB96& operator >> (vetFrameRGBA32& img);
00300
00309 vetFrameRGB96& operator >> (vetFrameGrey& img);
00310
00311
00318 void operator << (const vetFrameYUV420& img);
00319
00326 void operator << (const vetFrameRGB24& img);
00327
00334 void operator << (const vetFrameRGBA32& img);
00335
00342 void operator << (const vetFrameGrey& img);
00343
00344 VETFRAME_PROFILE getProfile() { return vetFrame::VETFRAME_RGB96; };
00345 VETFRAME_CHANNEL_TYPE getChannelType() { return vetFrame::VETFRAME_CT_PACKED; };
00346
00347 int getFOURCC() { return 0x32424752; };
00348
00349 };
00350
00351
00352 #endif // __VETLIB_VETFRAMERGB96_H__
00353