}
default:
fprintf(stderr, "skipping file..\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
continue;
}
fout = fopen(parameters.outfile, "wb");
if (! fout) {
fprintf(stderr, "Not enable to create output file!\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
return 1;
}
for (i=0;i<l_nb_tiles;++i) {
if (! opj_write_tile(l_codec,i,l_data,l_data_size,l_stream)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to write the tile %d!\n",i);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fout);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
}
if (!bSuccess) {
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fout);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
fprintf(stderr,"Generated outfile %s\n",parameters.outfile);
/* close and free the byte stream */
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fout);
/* free remaining compression structures */
}
default:
fprintf(stderr, "skipping file..\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
continue;
}
/* Setup the decoder decoding parameters using user parameters */
if ( !opj_setup_decoder(l_codec, ¶meters) ){
fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
/* Read the main header of the codestream and if necessary the JP2 boxes*/
if(! opj_read_header(l_stream, l_codec, &image)){
fprintf(stderr, "ERROR -> opj_decompress: failed to read the header\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
if (!opj_set_decode_area(l_codec, image, parameters.DA_x0,
parameters.DA_y0, parameters.DA_x1, parameters.DA_y1)){
fprintf(stderr, "ERROR -> opj_decompress: failed to set the decoded area\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
fclose(fsrc);
if (!(opj_decode(l_codec, l_stream, image) && opj_end_decompress(l_codec, l_stream))) {
fprintf(stderr,"ERROR -> opj_decompress: failed to decode image!\n");
opj_destroy_codec(l_codec);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_image_destroy(image);
fclose(fsrc);
return EXIT_FAILURE;
/*if (!opj_set_decoded_resolution_factor(l_codec, 5)) {
fprintf(stderr, "ERROR -> opj_decompress: failed to set the resolution factor tile!\n");
opj_destroy_codec(l_codec);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_image_destroy(image);
fclose(fsrc);
return EXIT_FAILURE;
if (!opj_get_decoded_tile(l_codec, l_stream, image, parameters.tile_index)) {
fprintf(stderr, "ERROR -> opj_decompress: failed to decode tile!\n");
opj_destroy_codec(l_codec);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_image_destroy(image);
fclose(fsrc);
return EXIT_FAILURE;
}
/* Close the byte stream */
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
if(image->color_space == OPJ_CLRSPC_SYCC){
}
default:
fprintf(stderr, "skipping file..\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
continue;
}
/* Setup the decoder decoding parameters using user parameters */
if ( !opj_setup_decoder(l_codec, ¶meters) ){
fprintf(stderr, "ERROR -> opj_dump: failed to setup the decoder\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(l_codec);
fclose(fout);
/* Read the main header of the codestream and if necessary the JP2 boxes*/
if(! opj_read_header(l_stream, l_codec, &image)){
fprintf(stderr, "ERROR -> opj_dump: failed to read the header\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
cstr_index = opj_get_cstr_index(l_codec);
/* close the byte stream */
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
/* free remaining structures */
/* Setup the decoder decoding parameters using user parameters */
if ( !opj_setup_decoder(l_codec, ¶meters) ){
fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
/* Read the main header of the codestream and if necessary the JP2 boxes*/
if(! opj_read_header(l_stream, l_codec, &image)){
fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
fprintf(stdout, "Decoding tile %d ...\n", tile_index); \
if(!opj_get_decoded_tile(l_codec, l_stream, image, tile_index )){ \
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode tile %d\n", tile_index); \
- opj_stream_destroy(l_stream); \
+ opj_stream_destroy_v3(l_stream); \
opj_destroy_cstr_info(&cstr_info); \
opj_destroy_codec(l_codec); \
opj_image_destroy(image); \
for(index = 0; index < image->numcomps; ++index) { \
if( image->comps[index].data == NULL ){ \
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode tile %d\n", tile_index); \
- opj_stream_destroy(l_stream); \
+ opj_stream_destroy_v3(l_stream); \
opj_destroy_cstr_info(&cstr_info); \
opj_destroy_codec(l_codec); \
opj_image_destroy(image); \
TEST_TILE(tile_lr)
/* Close the byte stream */
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
/* Destroy code stream info */
opj_destroy_cstr_info(&cstr_info);
fprintf(stderr, "ERROR -> Not a valid JPEG2000 file!\n");
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
return EXIT_FAILURE;
}
}
fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n");
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
}
fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n");
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
}
fprintf(stderr, "ERROR -> j2k_to_image: failed to set the decoded area\n");
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
{
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
{
fclose(l_file);
free(l_new_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
{
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
{
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
/* Free memory */
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
if (! opj_start_compress(l_codec,l_image,l_stream)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to start compress!\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(l_file);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
for (i=0;i<l_nb_tiles;++i) {
if (! opj_write_tile(l_codec,i,l_data,l_data_size,l_stream)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to write the tile %d!\n",i);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(l_file);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
if (! opj_end_compress(l_codec,l_stream)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to end compress!\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(l_file);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return 1;
}
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(l_file);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
}
}
- /* catch events using our callbacks and give a local context */ \r
- opj_set_info_handler(l_codec, info_callback,00);\r
- opj_set_warning_handler(l_codec, warning_callback,00);\r
+ /* catch events using our callbacks and give a local context */
+ opj_set_info_handler(l_codec, info_callback,00);
+ opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
l_codec = opj_create_compress(OPJ_CODEC_J2K);
bSuccess = opj_end_compress(l_codec, l_stream);
assert( bSuccess );
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(f);
opj_destroy_codec(l_codec);
}
}
- /* catch events using our callbacks and give a local context */ \r
- opj_set_info_handler(l_codec, info_callback,00);\r
- opj_set_warning_handler(l_codec, warning_callback,00);\r
+ /* catch events using our callbacks and give a local context */
+ opj_set_info_handler(l_codec, info_callback,00);
+ opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
l_codec = opj_create_compress(OPJ_CODEC_J2K);
bSuccess = opj_end_compress(l_codec, l_stream);
assert( bSuccess );
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(f);
opj_destroy_codec(l_codec);
bSuccess = opj_end_decompress(l_codec, l_stream);
assert( bSuccess );
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(d_codec);