IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29783


Ignore:
Timestamp:
Nov 16, 2010, 10:21:30 AM (15 years ago)
Author:
eugene
Message:

mod on kapa image display: PS button does PS for button 1, PNG for button 2, JPEG for button 3; also fixed error in jpeg of overlays

Location:
branches/eam_branches/ipp-20101103/Ohana/src/kapa2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101103/Ohana/src/kapa2/include/prototypes.h

    r29539 r29783  
    4646/* EventLoop */
    4747int           PScommand           PROTO((int sock));
     48int           PNGcommand          PROTO((int sock));
    4849int           CheckPipe           PROTO((void));
    4950int           Reconfig            PROTO((XEvent *event));
     
    5253
    5354/* CheckPipe */
    54 int           PNGit               PROTO((int sock));
     55int           PNGit               PROTO((char *filename));
    5556int           PPMit               PROTO((int sock));
    5657int           LoadFrame           PROTO((int sock));
     
    212213int           Overlay3            PROTO((Graphic *graphic, KapaImageWidget *image));
    213214int           PSfunction          PROTO((Graphic *graphic, KapaImageWidget *image));
     215int           PNGfunction         PROTO((Graphic *graphic, KapaImageWidget *image));
     216int           JPEGfunction        PROTO((Graphic *graphic, KapaImageWidget *image));
    214217
    215218/* misc functions */
     
    219222int           SaveOverlay  (int sock);
    220223int           CSaveOverlay (int sock);
    221 int           JPEGit24     (int sock);
     224int           JPEGit24     (char *filename);
     225int           JPEGcommand  (int sock);
    222226
    223227int           UpdatePointer (Graphic *graphic, XMotionEvent *event);
  • branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/ButtonFunctions.c

    r29539 r29783  
    77
    88  status = PSit ("kapa.ps", "default", TRUE, KAPA_PS_NEWPLOT);
     9  return (status);
     10}
     11
     12int PNGfunction (Graphic *graphic, KapaImageWidget *image) {
     13
     14  int status;
     15
     16  status = PNGit ("kapa.png");
     17  return (status);
     18}
     19
     20int JPEGfunction (Graphic *graphic, KapaImageWidget *image) {
     21
     22  int status;
     23
     24  status = JPEGit24 ("kapa.jpg");
    925  return (status);
    1026}
  • branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/CheckPipe.c

    r27790 r29783  
    8989 
    9090  if (!strcmp (word, "PNGF")) {
    91     status = PNGit (sock);
    92     KiiSendCommand (sock, 4, "DONE");
    93     FINISHED (status);
    94   }
    95  
     91    status = PNGcommand (sock);
     92    KiiSendCommand (sock, 4, "DONE");
     93    FINISHED (status);
     94  }
     95 
     96  if (!strcmp (word, "JPEG")) {
     97    status = JPEGcommand (sock);
     98    KiiSendCommand (sock, 4, "DONE");
     99    FINISHED (status);
     100  }
     101
    96102  if (!strcmp (word, "PPMF")) {
    97103    status = PPMit (sock);
     
    304310  }
    305311
    306   if (!strcmp (word, "JPEG")) {
    307     status = JPEGit24 (sock);
    308     KiiSendCommand (sock, 4, "DONE");
    309     FINISHED (status);
    310   }
    311 
    312312  if (!strcmp (word, "CENT")) {
    313313    status = Center (sock);
  • branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/Image.c

    r29539 r29783  
    8888
    8989  InitButtonSize (&image[0].PS_button, PS_width, PS_height, PS_bits);
    90   InitButtonFunc (&image[0].PS_button, PSfunction);
     90  // InitButtonFunc (&image[0].PS_button, PSfunction);
     91  image->PS_button.function_1 = PSfunction;
     92  image->PS_button.function_2 = PNGfunction;
     93  image->PS_button.function_3 = JPEGfunction;
    9194
    9295  InitButtonSize (&image[0].grey_button, grey_width, grey_height, grey_bits);
  • branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/JPEGit24.c

    r27601 r29783  
    88# define WHITE_B 255
    99
     10int JPEGcommand (int sock) {
     11
     12  int status;
     13  char filename[1024];
     14
     15  KiiScanMessage (sock, "%s", filename);
     16  status = JPEGit24 (filename);
     17  return (status);
     18}
     19
    1020// XXX this currently writes out the jpeg for just the active image
    11 int JPEGit24 (int sock) {
     21int JPEGit24 (char *filename) {
    1222
    1323  struct jpeg_compress_struct cinfo;
     
    3141  unsigned short *in_pix, *in_pix_ref;
    3242  unsigned char *pixel1, *pixel2, *pixel3;
    33   char filename[1024];
    3443  FILE *f;
    35 
    36   /* expect a line telling the number of bytes and a filename */
    37   KiiScanMessage (sock, "%s", filename);
    3844
    3945  graphic = GetGraphic();
     
    199205    bDrawSetBuffer (buffer);
    200206    for (i = 0; i < NOVERLAYS; i++) {
    201       if (image[i].overlay[i].active) bDrawOverlay (image, i);
     207      if (image[0].overlay[i].active) bDrawOverlay (image, i);
    202208    }
    203209
  • branches/eam_branches/ipp-20101103/Ohana/src/kapa2/src/PNGit.c

    r29408 r29783  
    1010int bDrawImage (bDrawBuffer *buffer, Graphic *graphic);
    1111
    12 int PNGit (int sock) {
     12int PNGcommand (int sock) {
     13
     14  int status;
     15  char filename[1024];
     16
     17  KiiScanMessage (sock, "%s", filename);
     18  status = PNGit (filename);
     19  return (status);
     20}
     21
     22int PNGit (char *filename) {
    1323
    1424  FILE *f;
     
    1626  png_infop info_ptr;
    1727  int status, Npalette;
    18   char filename[1024];
    1928  bDrawBuffer *buffer = NULL;
    2029  Graphic *graphic = NULL;
     
    2231
    2332  graphic = GetGraphic();
    24 
    25   /* expect a line telling the number of bytes and a filename */
    26   KiiScanMessage (sock, "%s", filename);
    2733
    2834  f = fopen (filename, "w");
Note: See TracChangeset for help on using the changeset viewer.