summaryrefslogtreecommitdiff
path: root/src/bin/jp2
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-03-14 13:53:36 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-03-14 13:53:36 +0000
commite8abf1fb250819822f6a96b11a5ed1a848f3e47a (patch)
treeb95f9fd376fe29edc64bccf82c0a7f405208e87a /src/bin/jp2
parentb7fe7d25e1fcffe3bca03b61da54a04d72cb7965 (diff)
[trunk] Add internal implementation to dump all tiles/comp info
Eg: opj_dump -f 8 -i input.j2k Update issue 3
Diffstat (limited to 'src/bin/jp2')
-rw-r--r--src/bin/jp2/opj_dump.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bin/jp2/opj_dump.c b/src/bin/jp2/opj_dump.c
index b849149f..1742f3eb 100644
--- a/src/bin/jp2/opj_dump.c
+++ b/src/bin/jp2/opj_dump.c
@@ -71,6 +71,7 @@ typedef struct img_folder{
/** Enable Cod Format for output*/
char set_out_format;
+ int flag;
}img_fol_t;
/* -------------------------------------------------------------------------- */
@@ -273,7 +274,7 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
opj_option_t long_option[]={
{"ImgDir",REQ_ARG, NULL ,'y'},
};
- const char optlist[] = "i:o:hv";
+ const char optlist[] = "i:o:f:hv";
totlen=sizeof(long_option);
img_fol->set_out_format = 0;
@@ -313,6 +314,10 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
break;
/* ----------------------------------------------------- */
+ case 'f': /* flag */
+ img_fol->flag = atoi(opj_optarg);
+ break;
+ /* ----------------------------------------------------- */
case 'h': /* display an help description */
decode_help_display();
@@ -424,6 +429,7 @@ int main(int argc, char *argv[])
/* Initialize img_fol */
memset(&img_fol,0,sizeof(img_fol_t));
+ img_fol.flag = OPJ_IMG_INFO | OPJ_J2K_MH_INFO | OPJ_J2K_MH_IND;
/* Parse input and get user encoding parameters */
if(parse_cmdline_decoder(argc, argv, &parameters,&img_fol) == 1) {
@@ -544,7 +550,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
- opj_dump_codec(l_codec, OPJ_IMG_INFO | OPJ_J2K_MH_INFO | OPJ_J2K_MH_IND, fout );
+ opj_dump_codec(l_codec, img_fol.flag, fout );
cstr_info = opj_get_cstr_info(l_codec);