From fef7d00dc8f646913141fa55687eef52064e7e20 Mon Sep 17 00:00:00 2001 From: Antonin Descampe Date: Tue, 12 Apr 2011 17:24:30 +0000 Subject: [PATCH] Fixed internal function names conflict with Jasper (http://code.google.com/p/openjpeg/issues/detail?id=30) --- ChangeLog | 3 +++ libopenjpeg/jp2.c | 6 +++--- libopenjpeg/jp2.h | 6 +++--- libopenjpeg/openjpeg.c | 8 ++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c15de01..3c8fec28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ What's New for OpenJPEG ! : changed + : added +April 12, 2011 +* [antonin] Fixed internal function names conflict with Jasper (http://code.google.com/p/openjpeg/issues/detail?id=30) + November 25, 2010 * [antonin] Fix leak in jp2_read_header_procedure() (from even.rouault, see issue 29 on googlecode) diff --git a/libopenjpeg/jp2.c b/libopenjpeg/jp2.c index 2de3eafa..15769089 100644 --- a/libopenjpeg/jp2.c +++ b/libopenjpeg/jp2.c @@ -1829,7 +1829,7 @@ Encode an image into a JPEG-2000 file stream @param cstr_info Codestream information structure if required, NULL otherwise @return Returns true if successful, returns false otherwise */ -bool jp2_encode(opj_jp2_t *jp2, struct opj_stream_private *cio, struct opj_event_mgr * p_manager) +bool opj_jp2_encode(opj_jp2_t *jp2, struct opj_stream_private *cio, struct opj_event_mgr * p_manager) { return j2k_encode(jp2->j2k,cio,p_manager); } @@ -1857,7 +1857,7 @@ bool jp2_write_tile ( * @param p_stream the stream to write data to. * @param p_manager the user event manager. */ -bool jp2_decode_tile ( +bool opj_jp2_decode_tile ( opj_jp2_t * p_jp2, OPJ_UINT32 p_tile_index, OPJ_BYTE * p_data, @@ -2074,7 +2074,7 @@ bool jp2_skip_jp2c( return true; } -struct opj_image * jp2_decode(opj_jp2_t *jp2, struct opj_stream_private *cio, struct opj_event_mgr * p_manager) +struct opj_image * opj_jp2_decode(opj_jp2_t *jp2, struct opj_stream_private *cio, struct opj_event_mgr * p_manager) { /* J2K decoding */ struct opj_image * image = j2k_decode(jp2->j2k, cio, p_manager); diff --git a/libopenjpeg/jp2.h b/libopenjpeg/jp2.h index e98cde39..4dfa36cf 100644 --- a/libopenjpeg/jp2.h +++ b/libopenjpeg/jp2.h @@ -203,7 +203,7 @@ void jp2_setup_decoder(opj_jp2_t *jp2, struct opj_dparameters *parameters); * @param cstr_info Codestream information structure if required, NULL otherwise * @return Returns a decoded image if successful, returns NULL otherwise */ -struct opj_image* jp2_decode(opj_jp2_t *jp2, struct opj_stream_private *cio, struct opj_event_mgr * p_manager); +struct opj_image* opj_jp2_decode(opj_jp2_t *jp2, struct opj_stream_private *cio, struct opj_event_mgr * p_manager); /** Setup the encoder parameters using the current image and using user parameters. Coding parameters are returned in jp2->j2k->cp. @@ -237,7 +237,7 @@ Encode an image into a JPEG-2000 file stream @param cstr_info Codestream information structure if required, NULL otherwise @return Returns true if successful, returns false otherwise */ -bool jp2_encode(opj_jp2_t *jp2, struct opj_stream_private *cio, struct opj_event_mgr * p_manager); +bool opj_jp2_encode(opj_jp2_t *jp2, struct opj_stream_private *cio, struct opj_event_mgr * p_manager); /** * Reads a jpeg2000 file header structure. @@ -286,7 +286,7 @@ bool jp2_write_tile ( * @param p_stream the stream to write data to. * @param p_manager the user event manager. */ -bool jp2_decode_tile ( +bool opj_jp2_decode_tile ( opj_jp2_t * p_jp2, OPJ_UINT32 p_tile_index, OPJ_BYTE * p_data, diff --git a/libopenjpeg/openjpeg.c b/libopenjpeg/openjpeg.c index a50ee705..bb93c08c 100644 --- a/libopenjpeg/openjpeg.c +++ b/libopenjpeg/openjpeg.c @@ -231,7 +231,7 @@ opj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT p_format) case CODEC_JP2: /* get a JP2 decoder handle */ - l_info->m_codec_data.m_decompression.opj_decode = (opj_image_t* (*) (void *, struct opj_stream_private *, struct opj_event_mgr * ))jp2_decode; + l_info->m_codec_data.m_decompression.opj_decode = (opj_image_t* (*) (void *, struct opj_stream_private *, struct opj_event_mgr * ))opj_jp2_decode; l_info->m_codec_data.m_decompression.opj_end_decompress = (bool (*) (void *,struct opj_stream_private *,struct opj_event_mgr *)) jp2_end_decompress; l_info->m_codec_data.m_decompression.opj_read_header = (bool (*) ( void *, @@ -260,7 +260,7 @@ opj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT p_format) struct opj_stream_private *, struct opj_event_mgr * )) jp2_read_tile_header; - l_info->m_codec_data.m_decompression.opj_decode_tile_data = (bool (*) (void *,OPJ_UINT32,OPJ_BYTE*,OPJ_UINT32,struct opj_stream_private *, struct opj_event_mgr * )) jp2_decode_tile; + l_info->m_codec_data.m_decompression.opj_decode_tile_data = (bool (*) (void *,OPJ_UINT32,OPJ_BYTE*,OPJ_UINT32,struct opj_stream_private *, struct opj_event_mgr * )) opj_jp2_decode_tile; l_info->m_codec_data.m_decompression.opj_destroy = (void (*) (void *))jp2_destroy; l_info->m_codec_data.m_decompression.opj_setup_decoder = (void (*) (void * ,opj_dparameters_t * )) jp2_setup_decoder; @@ -612,7 +612,7 @@ opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT p_format) case CODEC_JP2: /* get a JP2 decoder handle */ - l_info->m_codec_data.m_compression.opj_encode = (bool (*) (void *, struct opj_stream_private *, struct opj_event_mgr * )) jp2_encode; + l_info->m_codec_data.m_compression.opj_encode = (bool (*) (void *, struct opj_stream_private *, struct opj_event_mgr * )) opj_jp2_encode; l_info->m_codec_data.m_compression.opj_end_compress = (bool (*) (void *, struct opj_stream_private *, struct opj_event_mgr *)) jp2_end_compress; l_info->m_codec_data.m_compression.opj_start_compress = (bool (*) (void *,struct opj_stream_private *,struct opj_image * , struct opj_event_mgr *)) jp2_start_compress; l_info->m_codec_data.m_compression.opj_write_tile = (bool (*) (void *,OPJ_UINT32,OPJ_BYTE*,OPJ_UINT32,struct opj_stream_private *, struct opj_event_mgr *)) jp2_write_tile; @@ -840,7 +840,7 @@ bool OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec, opj_msg_callback case CODEC_J2K: return j2k_encode((opj_j2k_t*)cinfo->j2k_handle, (opj_stream_private_t *) cio, image, cstr_info); case CODEC_JP2: - return jp2_encode((opj_jp2_t*)cinfo->jp2_handle, (opj_stream_private_t *) cio, image, cstr_info); + return opj_jp2_encode((opj_jp2_t*)cinfo->jp2_handle, (opj_stream_private_t *) cio, image, cstr_info); case CODEC_JPT: case CODEC_UNKNOWN: default: