I just started using OpenJPEG, so I'm still learning my way around the public API. Sorry if this is a stupid or very obvious question.
I want to quickly extract the color space value from a jp2 image. So far the only way I've found how to do it is populating a jp2_image_t struct's color_space value by calling opj_decode(). However, this is slow because it seems to decode the entire JPEG-2000 code-steam. Is there a faster way? I'm only interested in the header value and not reading any of the pixel information. I'd like avoid parsing the boxes of the header myself if possible.
Truncated example of what I've been doing to get my data.
opj_stream_t *l_stream = NULL;
opj_codec_t* l_codec = NULL;
opj_image_t* image = NULL;
l_codec = opj_create_decompress(OPJ_CODEC_JP2);
opj_read_header(l_stream, l_codec, &image);
opj_decode(l_codec,l_stream, image );
// The information I'm looking for is only now found in "image->color_space"
Any ideas? Thanks