IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 27, 2005, 3:21:40 PM (21 years ago)
Author:
eugene
Message:

substantial work to move kii/kapa call into libkapa

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/jpeg.c

    r5846 r5850  
    33int jpeg (int argc, char **argv) {
    44
    5   char filename[1024], buffer[20], type[16];
    6   int N, Source, Nsource, IsImage;
     5  char filename[1024];
     6  int N, Source, Nsource, IsImage, IsPNG;
    77 
    88  if ((N = get_argument (argc, argv, "--help"))) {
     
    1212
    1313  /* image type */
    14   strcpy (type, "PNGF");
     14  IsPNG = TRUE;
    1515  if ((N = get_argument (argc, argv, "-ppm"))) {
    1616    remove_argument (N, &argc, argv);
    17     strcpy (type, "PPMF");
     17    IsPNG = FALSE;
    1818  }
    1919
     
    4545    if (!GetImage (&Source, &Nsource)) return (FALSE);
    4646    if (!filename[0]) strcpy (filename, "Ximage.jpg");
    47     strcpy (type, "JPEG");
    48     KiiJpeg (Source, filename);
     47    KiiJPEG (Source, filename);
    4948  } else {
    5049    if (!GetGraph (NULL, &Source, &Nsource)) return (FALSE);
    5150    if (!filename[0]) strcpy (filename, "Xgraph.png");
    52     SendGraphCommand (Source, 4, type);
    53     SendGraphCommand (Source, 16, "LEN: %11d", strlen(filename));
    54     write (Source, filename, strlen(filename));
    55     read (Source, buffer, 4);
     51    if (IsPNG) {
     52      KapaPNG (Source, filename);
     53    } else {
     54      KapaPPM (Source, filename);
     55    }
    5656  }
    5757  return (TRUE);
    5858}
    5959
    60 /* jpeg -g converts graph to png
     60/* jpeg converts graph to png or ppm
    6161   jpeg converts image to jpeg */
Note: See TracChangeset for help on using the changeset viewer.