X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2Fgdcmjpegls%2FDecoder%2Fdecoder.c;h=b193724ec8206a8538dabc3580757042fab04c3d;hb=88d681d129a1e8b361c75a0d4f246f68b39db1b9;hp=0343c0899e135239214917f34775026945651cb9;hpb=94015b89675cf4431c7e4953a597b70cfde03bcc;p=gdcm.git diff --git a/src/gdcmjpegls/Decoder/decoder.c b/src/gdcmjpegls/Decoder/decoder.c index 0343c089..b193724e 100644 --- a/src/gdcmjpegls/Decoder/decoder.c +++ b/src/gdcmjpegls/Decoder/decoder.c @@ -58,7 +58,12 @@ #define PGMNAME PGMPREFIX "d" #define EPGMNAME PGMPREFIX "e" -static char *banner="\n\ +/* define color mode strings */ +char plane_int_string[] = "plane by plane", + line_int_string[] = "line intlv", + pixel_int_string[] = "sample intlv"; + +static char banner[]="\n\ =============================================\n\ SPMG/JPEG-LS DECOMPRESSOR " JPEGLSVERSION "\n\ =============================================\n\ @@ -118,8 +123,8 @@ int alpha, /* alphabet size */ int highmask; #endif -void usage(); +void usage(); @@ -127,7 +132,6 @@ void usage(); /* Write one row of pixel values */ inline void write_one_line(pixel* line, int cols, FILE* outfile) { - int i, index; unsigned int* maptable; @@ -139,7 +143,7 @@ inline void write_one_line(pixel* line, int cols, FILE* outfile) line8 = (unsigned char*)safealloc(cols); for (i=0; i< cols; i++) - *(line8+i)=ENDIAN8(*(line+i)); + *(line8+i)=(unsigned char)ENDIAN8(*(line+i)); fwrite(line8, sizeof(unsigned char), cols, outfile); @@ -227,7 +231,8 @@ inline void write_one_line(pixel* line, int cols, FILE* outfile) -void initbuffers(int multi, int comp) { +void initbuffers(int multi, int comp) +{ int i; @@ -282,28 +287,29 @@ void c_swaplines(int i) c_cscanline[i] = c_cscanl0[i] + (LEFTMARGIN-1); } -void closebuffers(int multi) { +void closebuffers(int multi) +{ - int i; + int i; fclose(in); if (multi==0) - fclose(out); - else - for (i=0;i : Alternate input specification, use -i- for stdin.\n\ --o : Alternate output specification, use -o- for stdout.\n\ --P : Generate single (.ppm) output file for sample/line int. mode.\n\ -"); - fprintf(stderr,"\ --h : Print this help.\n\ -*** No spaces allowed between a flag and its argument.\n\ -"); + fprintf(stderr,"FLAGS:\n\ + outfile2, ... : Multiple output specification for plane or line int. mode.\n\ + -i : Alternate input specification, use -i- for stdin.\n\ + -o : Alternate output specification, use -o- for stdout.\n\ + -P : Generate single (.ppm) output file for sample/line int. mode.\n\ + "); + fprintf(stderr,"\ + -h : Print this help.\n\ + *** No spaces allowed between a flag and its argument.\n\ + "); } void bad_flag(char *s) { - fprintf(stderr,"Bad flag %s\n",s); - usage(); - exit(10); + fprintf(stderr,"Bad flag %s\n",s); + usage(); + exit(10); }