Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

swscale.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2001-2003 Michael Niedermayer <[email protected]>
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018 
00019 #ifndef SWSCALE_H
00020 #define SWSCALE_H
00021 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 /* values for the flags, the stuff on the command line is different */
00033 #define SWS_FAST_BILINEAR 1
00034 #define SWS_BILINEAR 2
00035 #define SWS_BICUBIC  4
00036 #define SWS_X        8
00037 #define SWS_POINT    0x10
00038 #define SWS_AREA     0x20
00039 #define SWS_BICUBLIN 0x40
00040 #define SWS_GAUSS    0x80
00041 #define SWS_SINC     0x100
00042 #define SWS_LANCZOS  0x200
00043 #define SWS_SPLINE   0x400
00044 
00045 #define SWS_SRC_V_CHR_DROP_MASK         0x30000
00046 #define SWS_SRC_V_CHR_DROP_SHIFT        16
00047 
00048 #define SWS_PARAM_MASK                  0x3FC0000
00049 #define SWS_PARAM_SHIFT                 18
00050 
00051 #define SWS_PRINT_INFO          0x1000
00052 
00053 //the following 3 flags are not completly implemented
00054 //internal chrominace subsamling info
00055 #define SWS_FULL_CHR_H_INT      0x2000
00056 //input subsampling info
00057 #define SWS_FULL_CHR_H_INP      0x4000
00058 #define SWS_DIRECT_BGR          0x8000
00059 
00060 #define SWS_CPU_CAPS_MMX   0x80000000
00061 #define SWS_CPU_CAPS_MMX2  0x20000000
00062 #define SWS_CPU_CAPS_3DNOW 0x40000000
00063 #define SWS_CPU_CAPS_ALTIVEC 0x10000000
00064 
00065 #define SWS_MAX_REDUCE_CUTOFF 0.002
00066 
00067 #define SWS_CS_ITU709           1
00068 #define SWS_CS_FCC              4
00069 #define SWS_CS_ITU601           5
00070 #define SWS_CS_ITU624           5
00071 #define SWS_CS_SMPTE170M        5
00072 #define SWS_CS_SMPTE240M        7
00073 #define SWS_CS_DEFAULT          5
00074 
00075 
00076 
00077 // when used for filters they must have an odd number of elements
00078 // coeffs cannot be shared between vectors
00079 typedef struct {
00080         double *coeff;
00081         int length;
00082 } SwsVector;
00083 
00084 // vectors can be shared
00085 typedef struct {
00086         SwsVector *lumH;
00087         SwsVector *lumV;
00088         SwsVector *chrH;
00089         SwsVector *chrV;
00090 } SwsFilter;
00091 
00092 struct SwsContext;
00093 
00094 void sws_freeContext(struct SwsContext *swsContext);
00095 
00096 struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
00097                          SwsFilter *srcFilter, SwsFilter *dstFilter);
00098 int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
00099                            int srcSliceH, uint8_t* dst[], int dstStride[]);
00100 int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
00101                            int srcSliceH, uint8_t* dst[], int dstStride[]);
00102 
00103 
00104 int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation);
00105 int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation);
00106 SwsVector *sws_getGaussianVec(double variance, double quality);
00107 SwsVector *sws_getConstVec(double c, int length);
00108 SwsVector *sws_getIdentityVec(void);
00109 void sws_scaleVec(SwsVector *a, double scalar);
00110 void sws_normalizeVec(SwsVector *a, double height);
00111 void sws_convVec(SwsVector *a, SwsVector *b);
00112 void sws_addVec(SwsVector *a, SwsVector *b);
00113 void sws_subVec(SwsVector *a, SwsVector *b);
00114 void sws_shiftVec(SwsVector *a, int shift);
00115 SwsVector *sws_cloneVec(SwsVector *a);
00116 
00117 void sws_printVec(SwsVector *a);
00118 void sws_freeVec(SwsVector *a);
00119 
00120 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, 
00121                                 float lumaSarpen, float chromaSharpen,
00122                                 float chromaHShift, float chromaVShift,
00123                                 int verbose);
00124 void sws_freeFilter(SwsFilter *filter);
00125 
00126 #ifdef __cplusplus
00127 }
00128 #endif
00129 
00130 #endif

Generated on Tue Dec 20 10:14:54 2005 for vlc-0.8.4a by  doxygen 1.4.2