Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 typedef struct Myrgb16 {
00021 unsigned short blue:5;
00022 unsigned short green:6;
00023 unsigned short red:5;
00024 } Myrgb16;
00025 typedef struct Myrgb24 {
00026 unsigned char blue;
00027 unsigned char green;
00028 unsigned char red;
00029 } Myrgb24;
00030 typedef struct Myrgb32 {
00031 unsigned char blue;
00032 unsigned char green;
00033 unsigned char red;
00034 unsigned char alpha;
00035 } Myrgb32;
00036
00037 typedef struct MyYUV422 {
00038 unsigned char y0;
00039 unsigned char u;
00040 unsigned char y1;
00041 unsigned char v;
00042 } MyYUV422;
00043
00044 typedef struct MyYUV444 {
00045 unsigned char y;
00046 unsigned char u;
00047 unsigned char v;
00048 } MyYUV444;
00049
00050 #define CLIP(color) (unsigned char)(((color)>0xFF)?0xff:(((color)<0)?0:(color)))
00051
00052 unsigned char
00053 RGB24_TO_Y(unsigned char r, unsigned char g, unsigned char b);
00054
00055 unsigned char
00056 YR_TO_V(unsigned char r, unsigned char y);
00057
00058 unsigned char
00059 YB_TO_U(unsigned char b, unsigned char y);
00060
00061 unsigned char
00062 R_FROMYV(unsigned char y, unsigned char v);
00063
00064 unsigned char
00065 G_FROMYUV(unsigned char y, unsigned char u, unsigned char v);
00066
00067 unsigned char
00068 B_FROMYU(unsigned char y, unsigned char u);
00069
00070 #define YfromRGB(r,g,b) CLIP((77*(r)+150*(g)+29*(b))>>8)
00071 #define UfromRGB(r,g,b) CLIP(((128*(b)-85*(g)-43*(r))>>8 )+128)
00072 #define VfromRGB(r,g,b) CLIP(((128*(r)-107*(g)-21*(b))>>8) +128)
00073
00074 #define PACKRGB16(r,g,b) (__u16) ((((b) & 0xF8) << 8 ) | (((g) & 0xFC) << 3 ) | (((r) & 0xF8) >> 3 ))
00075 #define UNPACK16(pixel,r,g,b) r=((pixel)&0xf800) >> 8; g=((pixel)&0x07e0) >> 3; b=(((pixel)&0x001f) << 3)
00076
00077 void initLut(void);
00078 void freeLut(void);