img_decode_set_frame_index()

Set the current frame index in the image decoder

Synopsis:

#include <img/img.h>

int img_decode_set_frame_index(img_codec_t  codec,
                               io_stream_t *input,
                               uintptr_t   *decode_data,
                               unsigned     index );

Since:

BlackBerry 10.2.0

Arguments:

codec
The handle of the codec to use to decode the frame.
input
The input source.
decode_data
The address of the uintptr_t that was used for img_decode_begin() .
index
The frame index that should be set. The first frame has index 0, and the last frame has index img_decode_get_frame_count() - 1.

Library:

libimg

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

Description:

Sets the current frame index for the current decode. Use this function to perform non-sequential decoding of frames from an image stream.

This function may only be called after calling img_decode_begin() , and before calling img_decode_finish() . If the function is successful, the frame index is updated and is used on the next call to img_decode_frame() or img_decode_frame_resize() .

Returns:

IMG_ERR_OK
Success. The complete frame was decoded.
IMG_ERR_PARM
One of the parameters supplied was invalid.
IMG_ERR_NOTIMPL
The codec does not provide an implementation for this function.
IMG_ERR_NODATA
No frame data was present. This return code indicates the end of a multi-frame data source.
IMG_ERR_CORRUPT
Invalid data was encountered in the stream, preventing the decode from proceeding. Some of the frame may be intact.
IMG_ERR_TRUNC
Premature end of data encountered. Some of the frame may be intact.

Classification:

Image library

Safety:  
Interrupt handler No
Signal handler No
Thread No