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-2011 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 
00028 #pragma GCC visibility push(default)
00029 
00038 // Colormodels
00039 #define BC_COMPRESSED   1
00040 
00047 #define BC_RGB565       2
00048 
00055 #define BC_BGR565       3
00056 
00062 #define BC_BGR888       4
00063 
00069 #define BC_BGR8888      5
00070 
00077 #define BC_RGB888       6
00078 
00084 #define BC_RGBA8888     7
00085 
00091 #define BC_RGB161616    8
00092 
00098 #define BC_RGBA16161616 9
00099 
00105 #define BC_YUVA8888     10
00106 
00112 #define BC_YUV422       13
00113 // Planar
00114 
00121 #define BC_YUV420P      14
00122 
00128 #define BC_YUV422P      15
00129 
00135 #define BC_YUV444P      16
00136 
00142 #define BC_YUV411P      17
00143 /* JPEG scaled colormodels */
00144 
00150 #define BC_YUVJ420P     18
00151 
00157 #define BC_YUVJ422P     19
00158 
00164 #define BC_YUVJ444P     20
00165 /* 16 bit per component planar formats */
00166 
00172 #define BC_YUV422P16    21
00173 
00179 #define BC_YUV444P16    22
00180 
00185 #define BC_YUV422P10    23
00186 
00192 #define BC_YUVJ422P10   24
00193 
00194 // Colormodels purely used by Quicktime are done in Quicktime.
00195 
00196 // For communication with the X Server
00197 #define FOURCC_YV12 0x32315659  /* YV12   YUV420P */
00198 #define FOURCC_YUV2 0x32595559  /* YUV2   YUV422 */
00199 #define FOURCC_I420 0x30323449  /* I420   Intel Indeo 4 */
00200 
00201 // #undef RECLIP
00202 // #define RECLIP(x, y, z) ((x) = ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x))))
00203 
00204 #ifdef __cplusplus
00205 extern "C" {
00206 #endif
00207 
00208 int cmodel_calculate_pixelsize(int colormodel);
00209 int cmodel_calculate_datasize(int w, int h, int bytes_per_line, int color_model);
00210 int cmodel_calculate_max(int colormodel);
00211 int cmodel_components(int colormodel);
00212 int cmodel_is_yuv(int colormodel);
00213 
00214 void cmodel_transfer(unsigned char **output_rows, /* Leave NULL if non existent */
00215         unsigned char **input_rows,
00216         int in_x,        /* Dimensions to capture from input frame */
00217         int in_y, 
00218         int in_w, 
00219         int in_h,
00220         int out_w, 
00221         int out_h,
00222         int in_colormodel, 
00223         int out_colormodel,
00224         int in_rowspan,       /* For planar use the luma rowspan */
00225         int out_rowspan,      /* For planar use the luma rowspan */
00226         int in_rowspan_uv,    /* Chroma rowspan */
00227         int out_rowspan_uv    /* Chroma rowspan */);     
00228 
00229 int cmodel_bc_to_x(int color_model);
00230 // Tell when to use plane arguments or row pointer arguments to functions
00231 int cmodel_is_planar(int color_model);
00232 
00233 
00234 
00235 
00236 
00237 #ifdef __cplusplus
00238 }
00239 #endif
00240 
00241 #pragma GCC visibility pop
00242 
00243 #endif
Generated on Thu Mar 8 22:27:04 2012 for libquicktime by  doxygen 1.6.3