conversions.h

Go to the documentation of this file.
00001         /***************************************************************************
00002  *   Copyright (C) 2006 by Miguel Armando Riem de Oliveira   *
00003  *   mike@BlackBandit   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 
00022 /*
00023  * Copyright (C) 2000-2001 Dan Dennedy  <dan@dennedy.org>
00024  *
00025  * This program is free software; you can redistribute it and/or modify
00026  * it under the terms of the GNU General Public License as published by
00027  * the Free Software Foundation; either version 2 of the License, or
00028  * (at your option) any later version.
00029  *
00030  * This program is distributed in the hope that it will be useful,
00031  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00032  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00033  * GNU General Public License for more details.
00034  *
00035  * You should have received a copy of the GNU General Public License
00036  * along with this program; if not, write to the Free Software Foundation,
00037  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00038  */
00039 
00040 #ifndef __CONVERSIONS_H__
00041 #define __CONVERSIONS_H__
00042 
00043 #define  OPENCV_CONVERSIONS // OpenCV requires different byte ordering.
00044                             // Warning: this is _only_ implemented for uyvy2rgb.
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 // UYVY <-> YUYV
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 // XXX -> UYVY
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 // XXX -> RGB
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 // BAYER -> RGB
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 // XXX -> BGR
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

Generated on Tue Jan 30 15:33:07 2007 for camera1394_control.kdevelop by  doxygen 1.4.7