Logo Search packages:      
Sourcecode: blender version File versions  Download package

int av_read_image ( ByteIOContext *  pb,
const char *  filename,
AVImageFormat *  fmt,
int(*)(void *, AVImageInfo *info)  alloc_cb,
void *  opaque 
)

Read an image from a stream.

Parameters:
gb byte stream containing the image
fmt image format, NULL if probing is required

Definition at line 3250 of file utils.c.

References av_probe_image_format(), and PROBE_BUF_MIN.

{
    uint8_t buf[PROBE_BUF_MIN];
    AVProbeData probe_data, *pd = &probe_data;
    offset_t pos;
    int ret;

    if (!fmt) {
        pd->filename = filename;
        pd->buf = buf;
        pos = url_ftell(pb);
        pd->buf_size = get_buffer(pb, buf, PROBE_BUF_MIN);
        url_fseek(pb, pos, SEEK_SET);
        fmt = av_probe_image_format(pd);
    }
    if (!fmt)
        return AVERROR_NOFMT;
    ret = fmt->img_read(pb, alloc_cb, opaque);
    return ret;
}


Generated by  Doxygen 1.6.0   Back to index