diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-09-19 16:52:07 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-09-19 17:06:19 +0200 |
| commit | 7e2b6bebff12eab8bdc17fc9af017e8c11652f4f (patch) | |
| tree | 1f1456a4b3962862d3ab581e7b1b080919c53d34 /src/lib/openjp2/jp2.h | |
| parent | ce199f42e77f972d6ee782b63492f6d861891053 (diff) | |
Add capability to decode only a subset of all components of an image.
This adds a opj_set_decoded_components(opj_codec_t *p_codec,
OPJ_UINT32 numcomps, const OPJ_UINT32* comps_indices) function,
and equivalent "opj_decompress -c compno[,compno]*" option.
When specified, neither the MCT transform nor JP2 channel transformations
will be applied.
Tests added for various combinations of whole image vs tiled-based decoding,
full or reduced resolution, use of decode area or not.
Diffstat (limited to 'src/lib/openjp2/jp2.h')
| -rw-r--r-- | src/lib/openjp2/jp2.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/openjp2/jp2.h b/src/lib/openjp2/jp2.h index 3ff66ebe..34abd511 100644 --- a/src/lib/openjp2/jp2.h +++ b/src/lib/openjp2/jp2.h @@ -235,6 +235,12 @@ Decoding parameters are returned in jp2->j2k->cp. */ void opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters); +/** Allocates worker threads for the compressor/decompressor. + * + * @param jp2 JP2 decompressor handle + * @param num_threads Number of threads. + * @return OPJ_TRUE in case of success. + */ OPJ_BOOL opj_jp2_set_threads(opj_jp2_t *jp2, OPJ_UINT32 num_threads); /** @@ -327,6 +333,21 @@ OPJ_BOOL opj_jp2_read_header(opj_stream_private_t *p_stream, opj_image_t ** p_image, opj_event_mgr_t * p_manager); +/** Sets the indices of the components to decode. + * + * @param jp2 JP2 decompressor handle + * @param numcomps Number of components to decode. + * @param comps_indices Array of num_compts indices (numbering starting at 0) + * corresponding to the components to decode. + * @param p_manager Event manager; + * + * @return OPJ_TRUE in case of success. + */ +OPJ_BOOL opj_jp2_set_decoded_components(opj_jp2_t *jp2, + OPJ_UINT32 numcomps, + const OPJ_UINT32* comps_indices, + opj_event_mgr_t * p_manager); + /** * Reads a tile header. * @param p_jp2 the jpeg2000 codec. |
