int da_y0=0;
int da_x1=1000;
int da_y1=1000;
- char input_file[64];
+ const char *input_file;
/* should be test_tile_decoder 0 0 1000 1000 tte1.j2k */
if( argc == 6 )
da_y0=atoi(argv[2]);
da_x1=atoi(argv[3]);
da_y1=atoi(argv[4]);
- strcpy(input_file,argv[5]);
+ input_file = argv[5];
}
else
da_y0=0;
da_x1=1000;
da_y1=1000;
- strcpy(input_file,"test.j2k");
+ input_file = "test.j2k";
}
if (! l_data) {
return EXIT_FAILURE;
}
- l_stream = opj_stream_create_default_file_stream_v3(input_file,OPJ_TRUE);
+ l_stream = opj_stream_create_default_file_stream(input_file,OPJ_TRUE);
if (!l_stream){
free(l_data);
fprintf(stderr, "ERROR -> failed to create the stream from the file\n");
{
fprintf(stderr, "ERROR -> Not a valid JPEG2000 file!\n");
free(l_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
return EXIT_FAILURE;
}
}
{
fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n");
free(l_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
}
{
fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n");
free(l_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
}
if (!opj_set_decode_area(l_codec, l_image, da_x0, da_y0,da_x1, da_y1)){
fprintf(stderr, "ERROR -> j2k_to_image: failed to set the decoded area\n");
free(l_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
&l_go_on))
{
free(l_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
if (! l_new_data)
{
free(l_new_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
if (! opj_decode_tile_data(l_codec,l_tile_index,l_data,l_data_size,l_stream))
{
free(l_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
if (! opj_end_decompress(l_codec,l_stream))
{
free(l_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
/* Free memory */
free(l_data);
- opj_stream_destroy_v3(l_stream);
+ opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);