~ubuntu-branches/ubuntu/lucid/ffmpeg/lucid-security

« back to all changes in this revision

Viewing changes to libswscale/swscale.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-03-13 09:18:28 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090313091828-n4ktby5eca487uhv
Tags: 3:0.svn20090303-1ubuntu1+unstripped1
merge from ubuntu.jaunty branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "libavutil/avutil.h"
31
31
 
32
32
#define LIBSWSCALE_VERSION_MAJOR 0
33
 
#define LIBSWSCALE_VERSION_MINOR 6
 
33
#define LIBSWSCALE_VERSION_MINOR 7
34
34
#define LIBSWSCALE_VERSION_MICRO 1
35
35
 
36
36
#define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
98
98
// when used for filters they must have an odd number of elements
99
99
// coeffs cannot be shared between vectors
100
100
typedef struct {
101
 
    double *coeff;
102
 
    int length;
 
101
    double *coeff;              ///< pointer to the list of coefficients
 
102
    int length;                 ///< number of coefficients in the vector
103
103
} SwsVector;
104
104
 
105
105
// vectors can be shared
114
114
 
115
115
void sws_freeContext(struct SwsContext *swsContext);
116
116
 
117
 
struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
 
117
/**
 
118
 * Allocates and returns a SwsContext. You need it to perform
 
119
 * scaling/conversion operations using sws_scale().
 
120
 *
 
121
 * @param srcW the width of the source image
 
122
 * @param srcH the height of the source image
 
123
 * @param srcFormat the source image format
 
124
 * @param dstW the width of the destination image
 
125
 * @param dstH the height of the destination image
 
126
 * @param dstFormat the destination image format
 
127
 * @param flags specify which algorithm and options to use for rescaling
 
128
 * @return a pointer to an allocated context, or NULL in case of error
 
129
 */
 
130
struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, int flags,
118
131
                                  SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
119
 
int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
 
132
 
 
133
/**
 
134
 * Scales the image slice in \p srcSlice and puts the resulting scaled
 
135
 * slice in the image in \p dst. A slice is a sequence of consecutive
 
136
 * rows in an image.
 
137
 *
 
138
 * @param context   the scaling context previously created with
 
139
 *                  sws_getContext()
 
140
 * @param srcSlice  the array containing the pointers to the planes of
 
141
 *                  the source slice
 
142
 * @param srcStride the array containing the strides for each plane of
 
143
 *                  the source image
 
144
 * @param srcSliceY the position in the source image of the slice to
 
145
 *                  process, that is the number (counted starting from
 
146
 *                  zero) in the image of the first row of the slice
 
147
 * @param srcSliceH the height of the source slice, that is the number
 
148
 *                  of rows in the slice
 
149
 * @param dst       the array containing the pointers to the planes of
 
150
 *                  the destination image
 
151
 * @param dstStride the array containing the strides for each plane of
 
152
 *                  the destination image
 
153
 * @return          the height of the output slice
 
154
 */
 
155
int sws_scale(struct SwsContext *context, uint8_t* srcSlice[], int srcStride[], int srcSliceY,
120
156
              int srcSliceH, uint8_t* dst[], int dstStride[]);
 
157
#if LIBSWSCALE_VERSION_MAJOR < 1
 
158
/**
 
159
 * @deprecated Use sws_scale() instead.
 
160
 */
121
161
int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
122
162
                      int srcSliceH, uint8_t* dst[], int dstStride[]) attribute_deprecated;
 
163
#endif
123
164
 
124
165
 
125
166
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);
126
167
int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation);
 
168
 
 
169
/**
 
170
 * Returns a normalized Gaussian curve used to filter stuff
 
171
 * quality=3 is high quality, lower is lower quality.
 
172
 */
127
173
SwsVector *sws_getGaussianVec(double variance, double quality);
 
174
 
 
175
/**
 
176
 * Allocates and returns a vector with \p length coefficients, all
 
177
 * with the same value \p c.
 
178
 */
128
179
SwsVector *sws_getConstVec(double c, int length);
 
180
 
 
181
/**
 
182
 * Allocates and returns a vector with just one coefficient, with
 
183
 * value 1.0.
 
184
 */
129
185
SwsVector *sws_getIdentityVec(void);
 
186
 
 
187
/**
 
188
 * Scales all the coefficients of \p a by the \p scalar value.
 
189
 */
130
190
void sws_scaleVec(SwsVector *a, double scalar);
 
191
 
 
192
/**
 
193
 * Scales all the coefficients of \p a so that their sum equals \p
 
194
 * height."
 
195
 */
131
196
void sws_normalizeVec(SwsVector *a, double height);
132
197
void sws_convVec(SwsVector *a, SwsVector *b);
133
198
void sws_addVec(SwsVector *a, SwsVector *b);
134
199
void sws_subVec(SwsVector *a, SwsVector *b);
135
200
void sws_shiftVec(SwsVector *a, int shift);
 
201
 
 
202
/**
 
203
 * Allocates and returns a clone of the vector \p a, that is a vector
 
204
 * with the same coefficients as \p a.
 
205
 */
136
206
SwsVector *sws_cloneVec(SwsVector *a);
137
207
 
138
 
void sws_printVec(SwsVector *a);
 
208
#if LIBSWSCALE_VERSION_MAJOR < 1
 
209
/**
 
210
 * @deprecated Use sws_printVec2() instead.
 
211
 */
 
212
attribute_deprecated void sws_printVec(SwsVector *a);
 
213
#endif
 
214
 
 
215
/**
 
216
 * Prints with av_log() a textual representation of the vector \p a
 
217
 * if \p log_level <= av_log_level.
 
218
 */
 
219
void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
 
220
 
139
221
void sws_freeVec(SwsVector *a);
140
222
 
141
223
SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
142
 
                                float lumaSarpen, float chromaSharpen,
 
224
                                float lumaSharpen, float chromaSharpen,
143
225
                                float chromaHShift, float chromaVShift,
144
226
                                int verbose);
145
227
void sws_freeFilter(SwsFilter *filter);
146
228
 
 
229
/**
 
230
 * Checks if \p context can be reused, otherwise reallocates a new
 
231
 * one.
 
232
 *
 
233
 * If \p context is NULL, just calls sws_getContext() to get a new
 
234
 * context. Otherwise, checks if the parameters are the ones already
 
235
 * saved in \p context. If that is the case, returns the current
 
236
 * context. Otherwise, frees \p context and gets a new context with
 
237
 * the new parameters.
 
238
 *
 
239
 * Be warned that \p srcFilter and \p dstFilter are not checked, they
 
240
 * are assumed to remain the same.
 
241
 */
147
242
struct SwsContext *sws_getCachedContext(struct SwsContext *context,
148
 
                                        int srcW, int srcH, int srcFormat,
149
 
                                        int dstW, int dstH, int dstFormat, int flags,
 
243
                                        int srcW, int srcH, enum PixelFormat srcFormat,
 
244
                                        int dstW, int dstH, enum PixelFormat dstFormat, int flags,
150
245
                                        SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
151
246
 
152
247
#endif /* SWSCALE_SWSCALE_H */