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

vetFrameYUV420.h

00001 
00026 //http://www.fourcc.org
00027 
00028 #ifndef __VETLIB_VETFRAMEYUV420_H__
00029  #define __VETLIB_VETFRAMEYUV420_H__
00030 
00031  #define _VETFRAMECACHE24_SLOWMODE
00032 
00033  #include "vetDefs.h"
00034 
00035  #include "vetFrame.h"
00036 class vetFrameYUV420;
00037   #include "vetFrameRGB24.h"
00038 
00039 //      PLANAR  PLANAR  PLANAR  PLANAR  PLANAR  PLANAR  PLANAR  PLANAR  PLANAR  PLANAR  PLANAR
00040 
00041 class vetFrameYUV420 : public virtual vetFrame
00042  {
00043 
00044         public:
00045 
00046 
00047                 bool autoFreeData;
00048 
00052                 unsigned char *data;
00053 
00054                 unsigned char *Y; // = data[0]
00055                 unsigned char *U; // = data[ width*height* ]
00056                 unsigned char *V; // = data[ width*height*1.25 ]
00057 
00058 
00059         public:
00060 
00064                 enum ChannelYUV { Lum, Cb, Cr }; // YUV
00065 
00069                 vetFrameYUV420();
00070 
00076                 vetFrameYUV420(unsigned int width, unsigned int height);
00077 
00082                 vetFrameYUV420(vetFrameYUV420& img);
00083 
00087                 ~vetFrameYUV420();
00088 
00089 
00090                 void* dump_buffer() { return static_cast<void*>(data); };
00091 
00092                 VETRESULT reAllocCanvas(unsigned int w, unsigned int h);
00093 
00094 
00095                 //width*height*1.5 * 8bit / width/height = 1.5*8bit = 12bit
00096                 unsigned int getBpp() { return 12; };
00097                 VETRESULT setBlack();
00098                 VETRESULT setWhite();
00099 
00100                 VETRESULT extractBrightness(unsigned char* buffer, unsigned int* size = NULL );
00101 
00102                 unsigned int getBufferSize() { return (unsigned int)( width * height * 1.5); };
00103 
00104 
00112                 vetFrameYUV420& clearWith(unsigned char* bg, ChannelYUV channel);
00113 
00114 
00124                 VETRESULT setPixel(unsigned int x, unsigned int y, unsigned char& value, ChannelYUV channel);
00125 
00126 
00136                 VETRESULT getPixel(unsigned int x, unsigned int y, unsigned char& value, ChannelYUV channel);
00137 
00138 
00139 
00148                 vetFrameYUV420& operator = (vetFrameYUV420& img);
00149 
00158                 vetFrameYUV420& operator += (vetFrameYUV420& img);
00159 
00168                 vetFrameYUV420& operator *= (vetFrameYUV420& img);
00169 
00170 
00171                 void operator << (const vetFrameRGB24& img);
00172 
00173                 vetFrameYUV420& operator >> (vetFrameRGB24& img);
00174 
00175                 VETFRAME_PROFILE getProfile() { return vetFrame::VETFRAME_I420; };
00176                 VETFRAME_CHANNEL_TYPE getChannelType() { return vetFrame::VETFRAME_CT_PLANAR; };
00177 
00178                 int getFOURCC() { return 0x30323449; };
00179  };
00180 
00181 
00182 
00183 #endif //__VETLIB_VETFRAMEYUV420_H__
00184 

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