00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SWSCALE_H
00020 #define SWSCALE_H
00021
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032
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
00054
00055 #define SWS_FULL_CHR_H_INT 0x2000
00056
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
00078
00079 typedef struct {
00080 double *coeff;
00081 int length;
00082 } SwsVector;
00083
00084
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