colormodels.h

00001 /*******************************************************************************
00002  colormodels.h
00003 
00004  libquicktime - A library for reading and writing quicktime/avi/mp4 files.
00005  http://libquicktime.sourceforge.net
00006 
00007  Copyright (C) 2002 Heroine Virtual Ltd.
00008  Copyright (C) 2002-2007 Members of the libquicktime project.
00009 
00010  This library is free software; you can redistribute it and/or modify it under
00011  the terms of the GNU Lesser General Public License as published by the Free
00012  Software Foundation; either version 2.1 of the License, or (at your option)
00013  any later version.
00014 
00015  This library is distributed in the hope that it will be useful, but WITHOUT
00016  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
00018  details.
00019 
00020  You should have received a copy of the GNU Lesser General Public License along
00021  with this library; if not, write to the Free Software Foundation, Inc., 51
00022  Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00023 *******************************************************************************/ 
00024  
00025 #ifndef COLORMODELS_H
00026 #define COLORMODELS_H
00027 
00036 // Colormodels
00037 #define BC_COMPRESSED   1
00038 
00045 #define BC_RGB565       2
00046 
00053 #define BC_BGR565       3
00054 
00060 #define BC_BGR888       4
00061 
00067 #define BC_BGR8888      5
00068 
00075 #define BC_RGB888       6
00076 
00082 #define BC_RGBA8888     7
00083 
00089 #define BC_RGB161616    8
00090 
00096 #define BC_RGBA16161616 9
00097 
00103 #define BC_YUVA8888     10
00104 
00110 #define BC_YUV422       13
00111 // Planar
00112 
00119 #define BC_YUV420P      14
00120 
00126 #define BC_YUV422P      15
00127 
00133 #define BC_YUV444P      16
00134 
00140 #define BC_YUV411P      17
00141 /* JPEG scaled colormodels */
00142 
00148 #define BC_YUVJ420P     18
00149 
00155 #define BC_YUVJ422P     19
00156 
00162 #define BC_YUVJ444P     20
00163 /* 16 bit per component planar formats */
00164 
00170 #define BC_YUV422P16    21
00171 
00177 #define BC_YUV444P16    22
00178 
00179 // Colormodels purely used by Quicktime are done in Quicktime.
00180 
00181 // For communication with the X Server
00182 #define FOURCC_YV12 0x32315659  /* YV12   YUV420P */
00183 #define FOURCC_YUV2 0x32595559  /* YUV2   YUV422 */
00184 #define FOURCC_I420 0x30323449  /* I420   Intel Indeo 4 */
00185 
00186 // #undef RECLIP
00187 // #define RECLIP(x, y, z) ((x) = ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x))))
00188 
00189 #ifdef __cplusplus
00190 extern "C" {
00191 #endif
00192 
00193 int cmodel_calculate_pixelsize(int colormodel);
00194 int cmodel_calculate_datasize(int w, int h, int bytes_per_line, int color_model);
00195 int cmodel_calculate_max(int colormodel);
00196 int cmodel_components(int colormodel);
00197 int cmodel_is_yuv(int colormodel);
00198 
00199 void cmodel_transfer(unsigned char **output_rows, /* Leave NULL if non existent */
00200         unsigned char **input_rows,
00201         int in_x,        /* Dimensions to capture from input frame */
00202         int in_y, 
00203         int in_w, 
00204         int in_h,
00205         int out_w, 
00206         int out_h,
00207         int in_colormodel, 
00208         int out_colormodel,
00209         int in_rowspan,       /* For planar use the luma rowspan */
00210         int out_rowspan,      /* For planar use the luma rowspan */
00211         int in_rowspan_uv,    /* Chroma rowspan */
00212         int out_rowspan_uv    /* Chroma rowspan */);     
00213 
00214 int cmodel_bc_to_x(int color_model);
00215 // Tell when to use plane arguments or row pointer arguments to functions
00216 int cmodel_is_planar(int color_model);
00217 
00218 
00219 
00220 
00221 
00222 #ifdef __cplusplus
00223 }
00224 #endif
00225 
00226 #endif

Generated on Sat Aug 9 11:08:37 2008 for libquicktime by  doxygen 1.5.6