Avoided ABI breakage
[openjpeg.git] / codec / image_to_j2k.c
index 06b1215ef38262ae71d1b28c62acac25637e455a..54ca14a1a5c47bc5bd42a691b662d4cf60653e61 100644 (file)
@@ -199,7 +199,7 @@ void encode_help_display() {
        fprintf(stdout,"\n");
        fprintf(stdout,"-ROI         : c=%%d,U=%%d : quantization indices upshifted \n");
        fprintf(stdout,"               for component c=%%d [%%d = 0,1,2]\n");
-       fprintf(stdout,"               with a value of U=%%d [0 <= %%d <= 37] (i.e. -ROI:c=0,U=25) \n");
+       fprintf(stdout,"               with a value of U=%%d [0 <= %%d <= 37] (i.e. -ROI c=0,U=25) \n");
        fprintf(stdout,"\n");
        fprintf(stdout,"-d           : offset of the origin of the image (-d 150,300) \n");
        fprintf(stdout,"\n");
@@ -639,10 +639,11 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
                }       
 
                fprintf(stream, "\nTILE %d DETAILS\n", tileno); 
-               fprintf(stream, "part_nb tileno  num_packs  start_pos end_tph_pos   end_pos\n");
+               fprintf(stream, "part_nb tileno  start_pack num_packs  start_pos end_tph_pos   end_pos\n");
                for (tilepartno = 0; tilepartno < cstr_info->tile[tileno].num_tps; tilepartno++)
-                       fprintf(stream, "%4d %9d  %9d  %9d %11d %9d\n",
+                       fprintf(stream, "%4d %9d   %9d %9d  %9d %11d %9d\n",
                                tilepartno, tileno,
+                               cstr_info->tile[tileno].tp[tilepartno].tp_start_pack,
                                cstr_info->tile[tileno].tp[tilepartno].tp_numpacks,
                                cstr_info->tile[tileno].tp[tilepartno].tp_start_pos,
                                cstr_info->tile[tileno].tp[tilepartno].tp_end_header,
@@ -824,6 +825,14 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
        
        fprintf(stream, "%8e\n", cstr_info->D_max); /* SE max */
        fprintf(stream, "%.8e\n", total_disto); /* SE totale */
+/* UniPG>> */
+       /* print the markers' list */
+       fprintf(stream, "\nMARKER LIST\n");
+       fprintf(stream, "%d\n", cstr_info->marknum);
+       fprintf(stream, "type\tstart_pos    length\n");
+       for (x = 0; x < cstr_info->marknum; x++)
+               fprintf(stream, "%X\t%9d %9d\n", cstr_info->marker[x].type, cstr_info->marker[x].pos, cstr_info->marker[x].len);
+/* <<UniPG */
        fclose(stream);
 
        fprintf(stderr,"Generated index file %s\n", index);
@@ -845,6 +854,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
                {"EPH",NO_ARG, NULL ,'E'},
                {"OutFor",REQ_ARG, NULL ,'O'},
                {"POC",REQ_ARG, NULL ,'P'},
+               {"ROI",REQ_ARG, NULL ,'R'},
        };
 
        /* parse the command line */
@@ -1219,9 +1229,9 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters,
 
                        case 'R':                       /* ROI */
                        {
-                               if (sscanf(optarg, "OI:c=%d,U=%d", &parameters->roi_compno,
+                               if (sscanf(optarg, "c=%d,U=%d", &parameters->roi_compno,
                                            &parameters->roi_shift) != 2) {
-                                       fprintf(stderr, "ROI error !! [-ROI:c='compno',U='shift']\n");
+                                       fprintf(stderr, "ROI error !! [-ROI c='compno',U='shift']\n");
                                        return 1;
                                }
                        }