diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-09-17 15:11:20 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-09-17 15:11:20 +0000 |
| commit | 55c4c14352519b84ad79abcb2f8527e1c25b9e54 (patch) | |
| tree | eb3efc84b540eccc43ca1ef19d8ca11ef0370942 /libopenjpeg/openjpeg.c | |
| parent | 569bbb00776f08211f7184ea4ea94571b652adae (diff) | |
OpenJPEG library interface modified to retain compatibility with version 1.2. Sorry if some of you already adapted their code to the previous interface, but we want to avoid a ABI break....
Diffstat (limited to 'libopenjpeg/openjpeg.c')
| -rw-r--r-- | libopenjpeg/openjpeg.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libopenjpeg/openjpeg.c b/libopenjpeg/openjpeg.c index 95653d06..356d2ca9 100644 --- a/libopenjpeg/openjpeg.c +++ b/libopenjpeg/openjpeg.c @@ -147,7 +147,11 @@ void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *param } } -opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio, opj_codestream_info_t *cstr_info) { +opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio) { + return opj_decode_with_info(dinfo, cio, NULL); +} + +opj_image_t* OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo, opj_cio_t *cio, opj_codestream_info_t *cstr_info) { if(dinfo && cio) { switch(dinfo->codec_format) { case CODEC_J2K: @@ -161,7 +165,6 @@ opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio, opj_cod break; } } - return NULL; } @@ -287,7 +290,15 @@ void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *param } } -bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info) { +bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index) { + if (index != NULL) + opj_event_msg((opj_common_ptr)cinfo, EVT_WARNING, "Set index to NULL when calling the opj_encode function.\n" + "To extract the index, use the opj_encode_with_info() function.\n" + "No index will be generated during this encoding\n"); + return opj_encode_with_info(cinfo, cio, image, NULL); +} + +bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info) { if(cinfo && cio && image) { switch(cinfo->codec_format) { case CODEC_J2K: |
