Decode and resize a frame from a stream
#include <img/img.h>
int img_decode_frame_resize(img_codec_t codec,
io_stream_t *input,
const img_decode_callouts_t *callouts,
img_t *img,
uintptr_t *decode_data );
BlackBerry 10.1.0
If you set the image width and height (img.w and img.h) before calling this function, then the image is sized to fit the specified dimensions rather than clipped, as it is with img_load_file(). The resizing is performed on-the-fly during the decoding, without incurring the memory penalty of loading the entire original image and then subsequently resizing it.
If you specify only one of the dimensions, then the other dimension is calculated based on the aspect ratio of the original image.
You also set the corresponding dimension flag in the img structure. For example, if you specify the width, then you set the IMG_W bit in flags.
This function decodes a frame and optionally resizes it if the image width and height are specified. You need to call img_decode_begin() first to prepare for the decode, and img_decode_finish() to release any resources allocated for the decode.
Image library
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |