img_crop()

Crop an image

Synopsis:

#include <img.h>

int img_crop( const img_t *src, 
              img_t *dst, 
              const unsigned x, 
              const unsigned y );

Arguments:

src
The address of the source img_t structure to crop.
dst
The address of the destination img_t structure, which requires the width (IMG_W) and height (IMG_H) to be specified at a minimum.
x
The horizontal coordinate in the source image to begin the crop operation.
y
The vertical coordinate in the source image to begin the crop operation.

Library:

img

Description:

This function will crop a source image at a given set of source coordinates x, y to the dimensions specified by the destination image.

Returns:

IMG_ERR_OK
Success
IMG_ERR_PARM
IMG_ERR_NOSUPPORT
Destination image format not supported
IMG_ERR_MEM
Memory allocation failure

Classification:

Image library

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

img_resize_fs()