Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

vetFrameHSV.h

00001 
00039 #ifndef __VETLIB_VETFRAMEHSV_H__
00040  #define __VETLIB_VETFRAMEHSV_H__
00041 
00042  #include "vetFrame.h"
00043 
00044 
00045 
00046  #include "PixelHSV.h"
00047 /*
00048  struct PixelHSV {
00049          unsigned short int hue;        //16bit |
00050          unsigned char sat;                     //8bit  |> 32bit
00051          unsigned char vat;                     //8bit  |
00052  }
00053 */
00054 
00055 
00056  #include "vetFrameRGB96.h"
00057  #include "vetFrameGrey.h"
00058 
00059 
00060 class vetFrameHSV : public virtual vetFrame
00067 {
00068         public:
00069 
00073                 PixelHSV *data;
00074 
00075 
00076         public:
00077 
00081                 enum ChannelHSV { HUE, SAT, VAL };
00082 
00083 
00084 
00085         public:
00086 
00087 
00091                 vetFrameHSV();
00092 
00098                 vetFrameHSV(unsigned int width, unsigned int height);
00099 
00100 
00105                 vetFrameHSV(vetFrameHSV& img);
00106 
00111                 vetFrameHSV(vetFrameRGB96& img);
00112 
00117                 vetFrameHSV(vetFrameGrey& img);
00118 
00119 
00123                 ~vetFrameHSV();
00124 
00125 
00126                 VETRESULT setWidth(unsigned int newWidth);
00127                 VETRESULT setHeight(unsigned int newHeight);
00128 
00129                 void* dump_buffer() { return static_cast<void*>(data); };
00130 
00131                 VETRESULT reAllocCanvas(unsigned int w, unsigned int h);
00132 
00133 
00134                 unsigned int getBpp() { return sizeof(PixelHSV) * 8; };
00135                 VETRESULT setBlack();
00136                 VETRESULT setWhite();
00137 
00138                 VETRESULT extractBrightness(unsigned char* buffer, unsigned int* size = NULL );
00139 
00150                 VETRESULT setPixel(unsigned int x, unsigned int y, PixelHSV p);
00151 
00161                 VETRESULT setHSV(unsigned int x, unsigned int y, unsigned short int hue, unsigned char sat, unsigned char val);
00162 
00171                 VETRESULT setChannel(unsigned int x, unsigned int y, ChannelHSV ch, unsigned int value);
00172 
00180                 VETRESULT getPixel(unsigned int x, unsigned int y, PixelHSV& p);
00181 
00191                 unsigned int getChannel(unsigned int x, unsigned int y, ChannelHSV ch);
00192 
00200                 vetFrameHSV& clearWith(PixelHSV& bg);
00201 
00210                 vetFrameHSV& clearChannel(ChannelHSV ch, unsigned int value = 0);
00211 
00220                 vetFrameHSV& copy(vetFrameHSV& img);
00221 
00222 
00223                 /* Operators overloading */
00224 
00233                 vetFrameHSV& operator = (vetFrameHSV& img) { return this->copy(img); };
00234 
00235 
00244                 vetFrameHSV& operator += (vetFrameHSV& img) ;
00245 
00246 
00255                 vetFrameHSV& operator -= (vetFrameHSV& img) ;
00256 
00265                 vetFrameHSV& operator /= (vetFrameHSV& img) ;
00266 
00275                 vetFrameHSV& operator *= (vetFrameHSV& img) ;
00276 
00277 
00278 
00287                 vetFrameHSV& operator >> (vetFrameRGB24& img);
00288 
00297                 vetFrameHSV& operator >> (vetFrameHSV& img);
00298 
00307                 vetFrameHSV& operator >> (vetFrameRGB96& img);
00308 
00317                 vetFrameHSV& operator >> (vetFrameGrey& img);
00318 
00319 
00320 
00327                 void operator << (const vetFrameRGB24& img);
00328 
00335                 void operator << (const vetFrameHSV& img);
00336 
00343                 void operator << (const vetFrameRGB96& img);
00344 
00351                 void operator << (const vetFrameGrey& img);
00352 
00353 
00354 
00355 
00357         static void convPixel_RGB32toHSV (const PixelRGB96&, PixelHSV&);
00358         static void convPixel_HSVtoRGB32 (const PixelHSV&, PixelRGB96&);
00359 
00360         static void convPixel_RGB24toHSV (const PixelRGB24&, PixelHSV&);
00361         static void convPixel_HSVtoRGB24 (const PixelHSV&, PixelRGB24&);
00362 
00363         static void convPixel_GREYtoHSV (const PixelGrey&, PixelHSV&);
00364         static void convPixel_HSVtoGREY (const PixelHSV&, PixelGrey&);
00365 
00366 
00367                 VETFRAME_PROFILE getProfile() { return vetFrame::VETFRAME_CUSTOM; };
00368                 VETFRAME_CHANNEL_TYPE getChannelType() { return vetFrame::VETFRAME_CT_PACKED; };
00369 
00370                 int getFOURCC() { return 0;};
00371 
00372 
00373  };
00374 
00375 
00376 #endif  // __VETLIB_VETFRAMEHSV_H__
00377 

Generated on Tue Jan 24 11:59:03 2006 for VETLib by  doxygen 1.4.4