Image transformation
[Video]
Detailed Description
gavl includes a generic image transformation engine. You pass a function pointer to the init function, which transforms the destination coordinates into source coordinates.
The interpolation method is set with gavl_video_options_set_scale_mode, but not all modes are supported. When initialized with an invalid scale mode, the transformation engine will silently choose the closest one.
Typedef Documentation
Opaque image transformation engine.
You don't want to know what's inside.
Function describing the method.
- Parameters:
-
| priv | User data - Parameters:
-
| xdst | X-coordinate of the destination - Parameters:
-
| ydst | Y-coordinate of the destination - Parameters:
-
| xsrc | Returns X-coordinate of the source - Parameters:
-
| ysrc | Returns Y-coordinate of the source |
All coordinates are in fractional pixels. 0,0 is the upper left corner. Return negative values or values larger than the dimesion to signal that a pixel is outside the source image. |
|
|
|
Function Documentation
Create a transformation engine.
- Returns:
- A newly allocated transformation engine
Since 1.1.0.
Destroy a transformation engine.
- Parameters:
-
| t | A transformation engine Since 1.1.0. |
Initialize a transformation engine.
- Parameters:
-
| t | A transformation engine - Parameters:
-
| format | Format (can be changed) - Parameters:
-
| func | Coordinate transform function - Parameters:
-
| priv | The priv argument for func - Returns:
- 1 if the transform was sucessfully initialized, 0 else.
If you enabled multithreading support, func will be called from multiple threads at the same time. Make sure, that it doesn't access any global data. |
Return type was changed from void to in in version 1.1.2 Under normal circumstances, this function always returns 1. |
Since 1.1.0. |
|
Transform an image.
- Parameters:
-
| t | A transformation engine - Parameters:
-
| in_frame | Input frame - Parameters:
-
| out_frame | Output frame Since 1.1.0. |
|
|
Get transformation options.
- Parameters:
-
| t | A transformation engine - Returns:
- Options
After you called this, you can use the gavl_video_options_set_*() functions to change the options. Options will become valid with the next call to gavl_image_transform_init. |
Since 1.1.0.