[trunk] remove deprecated v1 style function opj_create_compress

This commit is contained in:
Mickael Savinaud 2012-08-09 12:26:04 +00:00
parent 3f9fb13df6
commit 9a9897a9de
3 changed files with 12 additions and 48 deletions

View File

@ -818,7 +818,7 @@ int main(int argc, char **argv)
}
/* Get the decoded image */
if (!(opj_decode_v2(l_codec, l_stream, image) && opj_end_decompress(l_codec, l_stream))) {
if (!(opj_decode(l_codec, l_stream, image) && opj_end_decompress(l_codec, l_stream))) {
fprintf(stderr,"ERROR -> j2k_to_image: failed to decode image!\n");
opj_destroy_codec(l_codec);
opj_stream_destroy(l_stream);

View File

@ -286,6 +286,9 @@ const char* OPJ_CALLCONV opj_version(void) {
return PACKAGE_VERSION;
}
/* ---------------------------------------------------------------------- */
/* DECOMPRESSION FUNCTIONS*/
opj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT p_format)
{
opj_codec_private_t *l_codec = 00;
@ -476,40 +479,8 @@ opj_bool OPJ_CALLCONV opj_setup_decoder(opj_codec_t *p_codec,
return OPJ_FALSE;
}
/* DEPRECATED */
opj_cinfo_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format) {
opj_cinfo_t *cinfo = (opj_cinfo_t*)opj_calloc(1, sizeof(opj_cinfo_t));
if(!cinfo) return NULL;
cinfo->is_decompressor = OPJ_FALSE;
switch(format) {
case CODEC_J2K:
/* get a J2K coder handle */
cinfo->j2k_handle = (void*)j2k_create_compress((opj_common_ptr)cinfo);
if(!cinfo->j2k_handle) {
opj_free(cinfo);
return NULL;
}
break;
case CODEC_JP2:
/* get a JP2 coder handle */
cinfo->jp2_handle = (void*)jp2_create_compress((opj_common_ptr)cinfo);
if(!cinfo->jp2_handle) {
opj_free(cinfo);
return NULL;
}
break;
case CODEC_JPT:
case CODEC_UNKNOWN:
default:
opj_free(cinfo);
return NULL;
}
cinfo->codec_format = format;
return cinfo;
}
/* ---------------------------------------------------------------------- */
/* COMPRESSION FUNCTIONS*/
opj_codec_t* OPJ_CALLCONV opj_create_compress_v2(OPJ_CODEC_FORMAT p_format)
{
@ -1103,7 +1074,7 @@ void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr_index)
*
*
*/
opj_bool OPJ_CALLCONV opj_decode_v2(opj_codec_t *p_codec,
opj_bool OPJ_CALLCONV opj_decode( opj_codec_t *p_codec,
opj_stream_t *p_stream,
opj_image_t* p_image)
{

View File

@ -1269,7 +1269,7 @@ OPJ_API opj_bool OPJ_CALLCONV opj_set_decode_area( opj_codec_t *p_codec,
* @param p_image the decoded image
* @return true if success, otherwise false
* */
OPJ_API opj_bool OPJ_CALLCONV opj_decode_v2(opj_codec_t *p_decompressor,
OPJ_API opj_bool OPJ_CALLCONV opj_decode( opj_codec_t *p_decompressor,
opj_stream_t *p_stream,
opj_image_t *p_image);
@ -1364,13 +1364,6 @@ OPJ_API opj_bool OPJ_CALLCONV opj_decode_tile_data( opj_codec_t *p_codec,
/* COMPRESSION FUNCTIONS*/
/**
Creates a J2K/JP2 compression structure
@param format Coder to select
@return Returns a handle to a compressor if successful, returns NULL otherwise
*/
DEPRECATED( OPJ_API opj_cinfo_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format));
/**
* Creates a J2K/JP2 compression structure
* @param format Coder to select