transform input video
More...
|
| #define | INTERPOLATE_METHOD(name) |
| |
| #define | PIXEL(img, x, y, w, h, stride, def) |
| |
|
|
| INTERPOLATE_METHOD (interpolate_nearest) |
| | Nearest neighbor interpolation.
|
| |
|
| INTERPOLATE_METHOD (interpolate_bilinear) |
| | Bilinear interpolation.
|
| |
|
| INTERPOLATE_METHOD (interpolate_biquadratic) |
| | Biquadratic interpolation.
|
| |
| void | avfilter_get_matrix (float x_shift, float y_shift, float angle, float zoom, float *matrix) |
| | Get an affine transformation matrix from a given translation, rotation, and zoom factor. More...
|
| |
| void | avfilter_add_matrix (const float *m1, const float *m2, float *result) |
| | Add two matrices together. More...
|
| |
| void | avfilter_sub_matrix (const float *m1, const float *m2, float *result) |
| | Subtract one matrix from another. More...
|
| |
| void | avfilter_mul_matrix (const float *m1, float scalar, float *result) |
| | Multiply a matrix by a scalar value. More...
|
| |
| int | avfilter_transform (const uint8_t *src, uint8_t *dst, int src_stride, int dst_stride, int width, int height, const float *matrix, enum InterpolateMethod interpolate, enum FillMethod fill) |
| | Do an affine transformation with the given interpolation method. More...
|
| |
§ INTERPOLATE_METHOD
| #define INTERPOLATE_METHOD |
( |
|
name | ) |
|
Value:static uint8_t name(float x, float y, const uint8_t *src, \
int width, int height, int stride, uint8_t def)
§ PIXEL
| #define PIXEL |
( |
|
img, |
|
|
|
x, |
|
|
|
y, |
|
|
|
w, |
|
|
|
h, |
|
|
|
stride, |
|
|
|
def |
|
) |
| |
Value:((x) < 0 || (y) < 0) ? (def) : \
(((x) >= (w) || (y) >= (h)) ? (def) : \
img[(x) + (y) * (stride)])
§ avfilter_add_matrix()
| void avfilter_add_matrix |
( |
const float * |
m1, |
|
|
const float * |
m2, |
|
|
float * |
result |
|
) |
| |
Add two matrices together.
result = m1 + m2.
- Parameters
-
| m1 | 9-item transformation matrix |
| m2 | 9-item transformation matrix |
| result | 9-item transformation matrix |
§ avfilter_get_matrix()
| void avfilter_get_matrix |
( |
float |
x_shift, |
|
|
float |
y_shift, |
|
|
float |
angle, |
|
|
float |
zoom, |
|
|
float * |
matrix |
|
) |
| |
Get an affine transformation matrix from a given translation, rotation, and zoom factor.
The matrix will look like:
[ zoom * cos(angle), -sin(angle), x_shift, sin(angle), zoom * cos(angle), y_shift, 0, 0, 1 ]
- Parameters
-
| x_shift | horizontal translation |
| y_shift | vertical translation |
| angle | rotation in radians |
| zoom | scale percent (1.0 = 100%) |
| matrix | 9-item affine transformation matrix |
§ avfilter_mul_matrix()
| void avfilter_mul_matrix |
( |
const float * |
m1, |
|
|
float |
scalar, |
|
|
float * |
result |
|
) |
| |
Multiply a matrix by a scalar value.
result = m1 * scalar.
- Parameters
-
| m1 | 9-item transformation matrix |
| scalar | a number |
| result | 9-item transformation matrix |
§ avfilter_sub_matrix()
| void avfilter_sub_matrix |
( |
const float * |
m1, |
|
|
const float * |
m2, |
|
|
float * |
result |
|
) |
| |
Subtract one matrix from another.
result = m1 - m2.
- Parameters
-
| m1 | 9-item transformation matrix |
| m2 | 9-item transformation matrix |
| result | 9-item transformation matrix |
§ avfilter_transform()
| int avfilter_transform |
( |
const uint8_t * |
src, |
|
|
uint8_t * |
dst, |
|
|
int |
src_stride, |
|
|
int |
dst_stride, |
|
|
int |
width, |
|
|
int |
height, |
|
|
const float * |
matrix, |
|
|
enum InterpolateMethod |
interpolate, |
|
|
enum FillMethod |
fill |
|
) |
| |
Do an affine transformation with the given interpolation method.
This multiplies each vector [x,y,1] by the matrix and then interpolates to get the final value.
- Parameters
-
| src | source image |
| dst | destination image |
| src_stride | source image line size in bytes |
| dst_stride | destination image line size in bytes |
| width | image width in pixels |
| height | image height in pixels |
| matrix | 9-item affine transformation matrix |
| interpolate | pixel interpolation method |
| fill | edge fill method |
- Returns
- negative on error