home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Viewers / pCD0.3.4 / Source / hpcdtoppm.0.4 / error.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-12  |  6.4 KB  |  97 lines

  1. /* hpcdtoppm (Hadmut's pcdtoppm) v0.4
  2. *  Copyright (c) 1992, 1993 by Hadmut Danisch (danisch@ira.uka.de).
  3. *  Permission to use and distribute this software and its
  4. *  documentation for noncommercial use and without fee is hereby granted,
  5. *  provided that the above copyright notice appear in all copies and that
  6. *  both that copyright notice and this permission notice appear in
  7. *  supporting documentation. It is not allowed to sell this software in 
  8. *  any way. This software is not public domain.
  9. */
  10.  
  11. #include "hpcdtoppm.h"
  12. #define X(a,b) ((a == b) ? "->" : "  ")
  13.  
  14. void error(e)
  15.   enum ERRORS e;
  16.  {
  17.   
  18.   switch(e)
  19.    {case E_NONE:   return;
  20.     case E_IMP:    fprintf(stderr,"Sorry, Not yet implemented.\n"); break;
  21.     case E_READ:   fprintf(stderr,"Error while reading.\n"); break;
  22.     case E_WRITE:  fprintf(stderr,"Error while writing.\n"); break;
  23.     case E_INTERN: fprintf(stderr,"Internal error.\n"); break;
  24.     case E_ARG:    fprintf(stderr,"Error in Arguments !\n\n"); 
  25.                    fprintf(stderr,"Usage: hpcdtoppm [options] pcd-file [ppm-file]\n\n");
  26.                    fprintf(stderr,"Opts:         [ -> = Default ] \n\n");
  27.  
  28.                    fprintf(stderr,"     -x     Overskip mode (tries to improve color quality.)\n");
  29.                    fprintf(stderr,"     -s     Apply simple sharpness-operator on the Luma-channel.\n");
  30.                    fprintf(stderr,"     -d     Show differential picture only.\n");
  31.                    fprintf(stderr,"     -i     Give some (buggy) informations from fileheader.\n");
  32.                    fprintf(stderr,"     -m     Show the decoding steps to stderr.\n");
  33.                    fprintf(stderr,"     -crop  Try to cut off the black frame.\n");
  34.                    fprintf(stderr,"     -pos   Print file position of image to stderr.\n");
  35.                    fprintf(stderr,"     -rep   Try to jump over defects in the Huffman Code.\n");
  36.                    fprintf(stderr,"     -vert  Flip image vert.\n");
  37.                    fprintf(stderr,"     -hori  Flip image horiz.\n");
  38.                    fprintf(stderr,"\n");
  39.  
  40.                    fprintf(stderr," %s  -n     Don't rotate.\n",                                 X(T_DEFAULT,T_NONE));
  41.                    fprintf(stderr," %s  -r     Rotate clockwise for portraits.\n" ,              X(T_DEFAULT,T_RIGHT));
  42.                    fprintf(stderr," %s  -l     Rotate counter-clockwise for portraits.\n",       X(T_DEFAULT,T_LEFT));
  43.                    fprintf(stderr," %s  -a     Try to find out orientation automatically.\n",    X(T_DEFAULT,T_AUTO));
  44.                    fprintf(stderr,"\n");
  45.  
  46.                    fprintf(stderr," %s  -ppm   output rgb  (ppm-format). \n",                    X(O_DEFAULT,O_PPM));
  47.                    fprintf(stderr," %s  -pgm   output gray (pgm-format). \n",                    X(O_DEFAULT,O_PGM));
  48.                    fprintf(stderr," %s  -ycc   output ycc  (ppm-format). \n",                    X(O_DEFAULT,O_YCC));
  49.                    fprintf(stderr," %s  -ps    output postscript (rgb). \n",                     X(O_DEFAULT,O_PS));
  50.                    fprintf(stderr," %s  -eps   output encapsulated postscript (rgb). \n",        X(O_DEFAULT,O_EPS));
  51.                    fprintf(stderr," %s  -psg   output postscript (grayscale). \n",               X(O_DEFAULT,O_PSG));
  52.                    fprintf(stderr," %s  -epsg  output encapsulated postscript (grayscale). \n",  X(O_DEFAULT,O_EPSG));
  53.                    fprintf(stderr,"     -pl f  Postscript paper left position    [ Def:  %8.3f ]\n",DEF_PAPER_LEFT);
  54.                    fprintf(stderr,"     -pb f  Postscript paper bottom position  [ Def:  %8.3f ]\n",DEF_PAPER_BOTTOM);
  55.                    fprintf(stderr,"     -pw f  Postscript paper width            [ Def:  %8.3f ]\n",DEF_PAPER_WIDTH);
  56.                    fprintf(stderr,"     -ph f  Postscript paper height           [ Def:  %8.3f ]\n",DEF_PAPER_HEIGHT);
  57.                    fprintf(stderr,"\n");
  58.  
  59.                    fprintf(stderr," %s  -c0    don't correct (linear).\n", X(C_DEFAULT,C_LINEAR));
  60.                    fprintf(stderr," %s  -c-    correct darker.\n",         X(C_DEFAULT,C_DARK));
  61.                    fprintf(stderr," %s  -c+    correct brighter.\n",       X(C_DEFAULT,C_BRIGHT));
  62.                    fprintf(stderr,"\n");
  63.  
  64.                    fprintf(stderr," %s  -0     Extract thumbnails from Overview file.\n",        X(S_DEFAULT,S_Over));
  65.                    fprintf(stderr," %s  -C d   Extract contact sheet from Overview file, d images width.\n",X(S_DEFAULT,S_Contact)); 
  66.                    fprintf(stderr," %s  -1     Extract  128x192   from Image file.\n",           X(S_DEFAULT,S_Base16));
  67.                    fprintf(stderr," %s  -2     Extract  256x384   from Image file.\n",           X(S_DEFAULT,S_Base4));
  68.                    fprintf(stderr," %s  -3     Extract  512x768   from Image file.\n",           X(S_DEFAULT,S_Base));
  69.                    fprintf(stderr," %s  -4     Extract 1024x1536  from Image file.\n",           X(S_DEFAULT,S_4Base));
  70.                    fprintf(stderr," %s  -5     Extract 2048x3072  from Image file.\n",           X(S_DEFAULT,S_16Base));
  71.                    fprintf(stderr,"\n");
  72.  
  73.                    break;
  74.     case E_OPT:    fprintf(stderr,"These Options are not allowed together.\n");break;
  75.     case E_MEM:    fprintf(stderr,"Not enough memory !\n"); break;
  76.     case E_HUFF:   fprintf(stderr,"Error in Huffman-Code-Table\n"); break;
  77.     case E_SEQ:    fprintf(stderr,"Error in Huffman-Sequence\n"); break;
  78.     case E_SEQ1:   fprintf(stderr,"Error1 in Huffman-Sequence\n"); break;
  79.     case E_SEQ2:   fprintf(stderr,"Error2 in Huffman-Sequence\n"); break;
  80.     case E_SEQ3:   fprintf(stderr,"Error3 in Huffman-Sequence\n"); break;
  81.     case E_SEQ4:   fprintf(stderr,"Error4 in Huffman-Sequence\n"); break;
  82.     case E_SEQ5:   fprintf(stderr,"Error5 in Huffman-Sequence\n"); break;
  83.     case E_SEQ6:   fprintf(stderr,"Error6 in Huffman-Sequence\n"); break;
  84.     case E_SEQ7:   fprintf(stderr,"Error7 in Huffman-Sequence\n"); break;
  85.     case E_POS:    fprintf(stderr,"Error in file-position\n"); break;
  86.     case E_OVSKIP: fprintf(stderr,"Can't read this resolution in overskip-mode\n"); break;
  87.     case E_TAUTO:  fprintf(stderr,"Can't determine the orientation in overview mode\n");break;
  88.     case E_TCANT:  fprintf(stderr,"Sorry, can't determine orientation for this file.\n");
  89.                    fprintf(stderr,"Please give orientation parameters. \n");break;
  90.     default:       fprintf(stderr,"Unknown error %d ???\n",e);break;
  91.    }
  92.   close_all();
  93.   exit(9);
  94.  }
  95.  
  96.  
  97.