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
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __CONVERSIONS_H__
00041 #define __CONVERSIONS_H__
00042
00043 #define OPENCV_CONVERSIONS // OpenCV requires different byte ordering.
00044
00045 #include <string.h>
00046
00047 typedef enum
00048 {
00049 NO_BAYER_DECODING,
00050 BAYER_DECODING_NEAREST,
00051 BAYER_DECODING_EDGE_SENSE,
00052 BAYER_DECODING_DOWNSAMPLE
00053 } bayer_decoding_t;
00054
00055 typedef enum
00056 {
00057 NO_STEREO_DECODING,
00058 STEREO_DECODING
00059 } stereo_decoding_t;
00060
00061 typedef enum
00062 {
00063 BAYER_PATTERN_BGGR,
00064 BAYER_PATTERN_GRBG,
00065 BAYER_PATTERN_RGGB,
00066 BAYER_PATTERN_GBRG
00067 } bayer_pattern_t;
00068
00069
00070 void
00071 uyvy2yuyv (unsigned char *src, unsigned char *dest, int NumPixels);
00072
00073 void
00074 yuyv2uyvy (unsigned char *src, unsigned char *dest, int NumPixels);
00075
00076
00077 void
00078 uyyvyy2uyvy (unsigned char *src, unsigned char *dest, int NumPixels);
00079
00080 void
00081 uyv2uyvy (unsigned char *src, unsigned char *dest, int NumPixels);
00082
00083 void
00084 y2uyvy (unsigned char *src, unsigned char *dest, int NumPixels);
00085
00086 void
00087 y162uyvy (unsigned char *src, unsigned char *dest, int NumPixels, int bits);
00088
00089 void
00090 y162y (unsigned char *src, unsigned char *dest, int NumPixels, int bits);
00091
00092 void
00093 rgb2uyvy (unsigned char *src, unsigned char *dest, int NumPixels);
00094
00095 void
00096 rgb482uyvy (unsigned char *src, unsigned char *dest, int NumPixels);
00097
00098
00099 void
00100 rgb482rgb (unsigned char *src, unsigned char *dest, int NumPixels);
00101
00102 void
00103 uyv2rgb (unsigned char *src, unsigned char *dest, int NumPixels);
00104
00105 void
00106 uyvy2rgb (unsigned char *src, unsigned char *dest, int NumPixels);
00107
00108 void
00109 uyvy2bgr (unsigned char *src, unsigned char *dest, int NumPixels);
00110
00111 void
00112 uyyvyy2rgb (unsigned char *src, unsigned char *dest, int NumPixels);
00113
00114 void
00115 y2rgb (unsigned char *src, unsigned char *dest, int NumPixels);
00116
00117 void
00118 y162rgb (unsigned char *src, unsigned char *dest, int NumPixels, int bits);
00119
00120
00121 void
00122 BayerNearestNeighbor(unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type);
00123
00124 void
00125 BayerEdgeSense(unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type);
00126
00127 void
00128 BayerDownsample(unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type);
00129
00130 void
00131 StereoDecode(unsigned char *src, unsigned char *dest, int NumPixels);
00132
00133 void
00134 convert_to_rgb(unsigned char *src, unsigned char *dest, int mode,
00135 int width, int height, int f7_colormode, int bayer, int bits);
00136
00137
00138
00139 void
00140 convert_to_bgr(unsigned char *src, unsigned char *dest, int mode,
00141 int width, int height, int f7_colormode, int bayer, int bits);
00142
00143 void
00144 uyv2rgb (unsigned char *src, unsigned char *dest, int NumPixels);
00145
00146 void
00147 uyyvyy2rgb (unsigned char *src, unsigned char *dest, int NumPixels);
00148
00149 #endif