Prepare to transform an image
#include <img.h>
int img_dtransform_create( const img_t *src,
const img_t *dst,
img_dtransform_t *xform );
- src
- The image you want to convert from
- dst
- The image you want to convert to
- xform
- The address to an opaque img_dtransform_t where the function stores the transform it creates.
img
This function pepares a data transformation from one format to another, from the format in the src image to the format in the dst image. Once this function is called, you call img_dtransform_apply() to apply the transformation, then
img_dtransform_free() to free the xform opaque structure.
|
- Data transforms are capable of handling palette-based formats, abstracting the details of conversions and/or expansion. It's generally easiest to use this construct when converting data from one arbitrary format to another.
- Conversion to a palette-based format is not supported.
|
- IMG_ERR_OK
- Success. The xform is valid and must be freed when the transform is finished. For any other return code (error), the xform isn't valid, and it must not be freed.
- IMG_ERR_PARM
- Required bits in the flags member of src aren't set (at a minimum IMG_H and IMG_W need to be set).
- IMG_ERR_MEM
- Insufficient memory for transform
- IMG_ERR_NOSUPPORT
- No support for the requested transform.
Image library
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
img_t,
img_dtransform_apply(),
img_dtransform_free()