Resize an image
#include <img/img.h> int img_resize_fs( const img_t *src, img_t *dst );
- The image to resize.
- 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.
Use the -l img option to qcc to link against this library.
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.
- Some fields of src are missing (that is, not marked as valid in flags)
- Unsupported format/conversion
- Insufficient memory (the function requires a small amount of working memory)