img_resize_fs()

Resize an image

Synopsis:

#include <img/img.h>

int img_resize_fs( const img_t *src,
                   img_t *dst );

Arguments:

src
The image to resize.
dst
The address of an img_t describing the destination. If you do not specify one of width or height in the dst (that is, the field isn't marked as valid in flags) then this function will calculate the missing dimension based on the aspect ratio of the src image.

Library:

libimg

Use the -l img option to qcc to link against this library.

Description:

This function resizes the image src to fit into the image described by dst. The algorithm is a simple "fast smooth" algorithm (that is, the algorithm yields results much more visually pleasing and smooth than simple pixel replication, but is faster than applying a filter function).

The formats of src and dst do not have to be the same; if they are different the data will be converted. However, a palette-based dst format is not supported.

Resize can be done in place, but the src and dst data pointers must be the same. You will get unpredictable results by partially overlapping src and dst data buffers.

Returns:

IMG_ERR_OK
Success
IMG_ERR_PARM
Some fields of src are missing (that is, not marked as valid in flags)
IMG_ERR_NOSUPPORT
Unsupported format/conversion
IMG_ERR_MEM
Insufficient memory (the function requires a small amount of working memory)

Classification:

Image library

Safety:  
Interrupt handler No
Signal handler No
Thread No