Crop an image
#include <img.h>
int img_crop( const img_t *src,
img_t *dst,
const unsigned x,
const unsigned y );
- 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.
img
This function will crop a source image at a given set of source coordinates
x, y to the dimensions specified by the destination image.
- IMG_ERR_OK
- Success
- IMG_ERR_PARM
-
- source image width, height, and/or format not set.
- destination image width, and/or height not set.
- destination image larger than source image.
- crop co-ordinates plus size of destination image exceed source image bounds.
- IMG_ERR_NOSUPPORT
- Destination image format not supported
- IMG_ERR_MEM
- Memory allocation failure
Image library
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
img_resize_fs()