img_decode_begin()

Prepare to decode one or more frames from a stream

Synopsis:

#include <img/img.h>

int img_decode_begin( img_codec_t  codec,
                      io_stream_t *input,
                      uintptr_t    *decode_data );

Arguments:

codec
The codec to use. To figure out a codec to use, see img_codec_list, list_byext, list_bymime, and img_decode_validate.
input
The input source.
decode_data
An address of a uintptr_t which the decoder uses to store data it needs across the decode process. You should not pass NULL, but instead pass a valid address of a uintptr_t initialized to 0.

Library:

libimg

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

Description:

This function prepares to decode a frame (or series of frames) from a stream.

Returns:

IMG_ERR_OK
Success.
IMG_ERR_NOTIMPL
The codec doesn't provide an implementation for this function.
Other
Any other code that a decoder's begin() function may pass back to flag an error (see img_errno.h for a list of defined errors).

Classification:

Image library

Safety:  
Interrupt handler No
Signal handler No
Thread No