IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13331


Ignore:
Timestamp:
May 10, 2007, 8:53:53 AM (19 years ago)
Author:
eugene
Message:

kapa image mode works

Location:
trunk/Ohana/src/kapa2
Files:
4 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/Makefile

    r13320 r13331  
    7575$(SRC)/CheckButtons.$(ARCH).o             $(SRC)/InvertButton.$(ARCH).o       \
    7676$(SRC)/UpdatePointer.$(ARCH).o            $(SRC)/JPEGit24.$(ARCH).o           \
    77 $(SRC)/bDrawOverlay.$(ARCH).o
     77$(SRC)/bDrawOverlay.$(ARCH).o             $(SRC)/ButtonFunctions.$(ARCH).o    \
     78$(SRC)/PSimage.$(ARCH).o                  $(SRC)/PSPixmap.$(ARCH).o    \
     79$(SRC)/PSOverlay.$(ARCH).o
    7880
    7981OBJ  =  $(KAPA)
  • trunk/Ohana/src/kapa2/include/prototypes.h

    r13320 r13331  
    3939
    4040/* EventLoop */
     41int           PScommand           PROTO(());
    4142int           CheckPipe           PROTO(());
    4243int           Reconfig            PROTO((XEvent *event));
     
    4445
    4546/* CheckPipe */
    46 int           PSit                PROTO(());
    4747int           PNGit               PROTO(());
    4848int           PPMit               PROTO(());
     
    8484
    8585/* PS drawing utilities */
     86int           PSit                PROTO((char *filename, char *pagename, int scaleMode, int pageMode));
    8687int           PSFrame             PROTO((KapaGraphWidget *graph, FILE *f));
    8788int           PSObjects           PROTO((KapaGraphWidget *graph, FILE *f));
     
    9596void          PSTick              PROTO((FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis));
    9697void          ClipLinePS          PROTO((double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0, FILE *f));
     98int           PSimage             PROTO((KapaImageWidget *image, FILE *f));
     99void          PSOverlay           PROTO((KapaImageWidget *image, int N, FILE *f, int extra));
     100void          PSPixmap8           PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f));
     101void          PSPixmap16          PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f));
     102void          PSPixmap24          PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f));
     103void          PSPixmap32          PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f));
    97104
    98105/* kapa bDraw Functions */
     
    110117bDrawBuffer  *bDrawIt             PROTO(());
    111118void          bDrawGraph          PROTO((KapaGraphWidget *graph));
    112 
    113 # if (0)
    114 # endif
    115119
    116120/* misc support */
     
    157161int           InButton            PROTO((XButtonEvent *event, Button *button));
    158162int           InPicture           PROTO((XButtonEvent *event, Picture *picture));
     163
     164/* Button Functions */
     165int           greycolors          PROTO((Graphic *graphic, KapaImageWidget *image));
     166int           puns                PROTO((Graphic *graphic, KapaImageWidget *image));
     167int           rainbow             PROTO((Graphic *graphic, KapaImageWidget *image));
     168int           Recenter            PROTO((Graphic *graphic, KapaImageWidget *image));
     169int           Rescale             PROTO((Graphic *graphic, KapaImageWidget *image));
     170int           RecenterRescale     PROTO((Graphic *graphic, KapaImageWidget *image));
     171int           ToggleDEG           PROTO((Graphic *graphic, KapaImageWidget *image));
     172int           Overlay0            PROTO((Graphic *graphic, KapaImageWidget *image));
     173int           Overlay1            PROTO((Graphic *graphic, KapaImageWidget *image));
     174int           Overlay2            PROTO((Graphic *graphic, KapaImageWidget *image));
     175int           Overlay3            PROTO((Graphic *graphic, KapaImageWidget *image));
     176int           PSfunction          PROTO((Graphic *graphic, KapaImageWidget *image));
  • trunk/Ohana/src/kapa2/src/CheckPipe.c

    r13320 r13331  
    3333 
    3434  if (!strcmp (buffer, "PSIT")) {
    35     status = PSit ();
     35    status = PScommand ();
    3636    write (sock, "DONE", 4);
    3737    return (status);
  • trunk/Ohana/src/kapa2/src/EraseOverlay.c

    r13320 r13331  
    1313  image = section->image;
    1414
    15   KiiScanCommand (sock, 16, "%d", &N);
     15  KiiScanCommand (sock, 16, "%*s %d", &N);
    1616
    1717  if (N > NOVERLAYS) {
  • trunk/Ohana/src/kapa2/src/EventLoop.c

    r13320 r13331  
    4848    if (LastEvent (display, Expose,          &event)) Refresh (1);
    4949    if (LastEvent (display, MappingNotify,   &event)) XRefreshKeyboardMapping ((XMappingEvent *) &event);
    50 # if (0)
    5150    if (LastEvent (display, MotionNotify,    &event)) UpdatePointer (graphic, (XMotionEvent *) &event);
    5251    if (LastEvent (display, ButtonPress,     &event)) InterpretPresses (graphic, (XButtonEvent *) &event);
    5352    if (LastEvent (display, KeyPress,        &event)) InterpretKeys (graphic, &event);
    54 # endif
    5553
    5654    /* drop and ignore the following StructureNotifyMask events */
  • trunk/Ohana/src/kapa2/src/Image.c

    r13320 r13331  
    2727    ALLOCATE (image[0].overlay[i].objects, Object, 1);  /* allocate so later free will not crash! */
    2828    image[0].overlay[i].active = FALSE;
    29     image[0].overlay[i].color = graphic[0].overlay_color[0];
     29    image[0].overlay[i].color = graphic[0].overlay_color[i];
    3030  }
    3131  image[0].matrix.size = 0; /* a flag to show there is no data in the matrix */
     
    3939
    4040  InitButtonSize (&image[0].PS_button, PS_width, PS_height, PS_bits);
    41   InitButtonFunc (&image[0].PS_button, PSit);
     41  InitButtonFunc (&image[0].PS_button, PSfunction);
    4242
    4343  InitButtonSize (&image[0].grey_button, grey_width, grey_height, grey_bits);
    44 //  InitButtonFunc (&image[0].grey_button, greycolors);
     44  InitButtonFunc (&image[0].grey_button, greycolors);
    4545
    4646  InitButtonSize (&image[0].rainbow_button, rainbow_width, rainbow_height, rainbow_bits);
    47 //  InitButtonFunc (&image[0].rainbow_button, rainbow);
     47  InitButtonFunc (&image[0].rainbow_button, rainbow);
    4848
    4949  InitButtonSize (&image[0].puns_button, puns_width, puns_height, puns_bits);
    50 //  InitButtonFunc (&image[0].puns_button, puns);
     50  InitButtonFunc (&image[0].puns_button, puns);
    5151
    5252  InitButtonSize (&image[0].recenter_button, recenter_width, recenter_height, recenter_bits);
    53 //  image[0].recenter_button.function_1 = Recenter;
    54 //  image[0].recenter_button.function_2 = RecenterRescale;
    55 //  image[0].recenter_button.function_3 = Rescale;
     53  image[0].recenter_button.function_1 = Recenter;
     54  image[0].recenter_button.function_2 = RecenterRescale;
     55  image[0].recenter_button.function_3 = Rescale;
    5656
    5757  InitButtonSize (&image[0].overlay_button[0], red_width, red_height, red_bits);
    58 //  InitButtonFunc (&image[0].overlay_button[0], Overlay0);
     58  InitButtonFunc (&image[0].overlay_button[0], Overlay0);
    5959
    6060  InitButtonSize (&image[0].overlay_button[1], green_width, green_height, green_bits);
    61 //  InitButtonFunc (&image[0].overlay_button[1], Overlay1);
     61  InitButtonFunc (&image[0].overlay_button[1], Overlay1);
    6262
    6363  InitButtonSize (&image[0].overlay_button[2], blue_width, blue_height, blue_bits);
    64 //  InitButtonFunc (&image[0].overlay_button[2], Overlay2);
     64  InitButtonFunc (&image[0].overlay_button[2], Overlay2);
    6565
    6666  InitButtonSize (&image[0].overlay_button[3], yellow_width, yellow_height, yellow_bits);
    67 //  InitButtonFunc (&image[0].overlay_button[3], Overlay3);
     67  InitButtonFunc (&image[0].overlay_button[3], Overlay3);
    6868
    6969  InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
    70 //  InitButtonFunc (&image[0].hms_button, ToggleDEG);
     70  InitButtonFunc (&image[0].hms_button, ToggleDEG);
    7171
    7272  return (image);
     
    113113  CrossHairs (graphic, image);
    114114
     115  for (i = 0; i < NOVERLAYS; i++) {
     116    if (image[0].overlay[i].active) {
     117      PaintOverlay (graphic, image, i);
     118    }
     119  }
    115120# if (0)
    116   for (i = 0; i < NOVERLAYS; i++) {
    117     if (OVERLAY[i])
    118       PaintOverlay (graphic, image, i);
    119   }
    120121  PaintTickmarks (graphic, image);
    121122# endif
  • trunk/Ohana/src/kapa2/src/LoadOverlay.c

    r13320 r13331  
    88  double x, y, dx, dy;
    99  int Nin, bytes, status;
    10   int i, N, NOBJECTS, Nobjects, Nstart, done;
     10  int i, N, NOBJECTS, Nobjects, Nstart;
    1111  Section *section;
    1212  KapaImageWidget *image;
     
    1919  ALLOCATE (buffer, char, 65536);  /* space for 512 lines of 128 bytes */
    2020  bzero (buffer, 65536);
    21   done = FALSE;
    2221
    2322  KiiScanCommand (sock, 16, "%*s %d", &N);
    2423  Nstart = image[0].overlay[N].Nobjects;
    2524
    26   while (!done) {
     25  while (1) {
    2726    KiiScanCommand (sock, 16, "%s %d", word, &Nin);
    2827    if (!strcmp (word, "DONE")) break;
    29     if (strcmp (word, "NLINES")) {
    30       fprintf (stderr, "!");
    31       continue;
    32     }
     28    if (strcmp (word, "NLINES")) abort();
    3329
    3430    buff = buffer;
  • trunk/Ohana/src/kapa2/src/PSit.c

    r13320 r13331  
    66static Graphic *graphic;
    77
    8 int PSit () {
     8int PScommand () {
    99
    10   int i, Nsection, pageMode, scaleMode;
     10  int status, scaleMode, pageMode;
     11  char filename[1024], pagename[1024];
     12
     13  /* expect a line telling the number of bytes and a filename */
     14  KiiScanMessage (sock, "%s %s %d %d", filename, pagename, &scaleMode, &pageMode);
     15  status = PSit (filename, pagename, scaleMode, pageMode);
     16  return (status);
     17}
     18
     19int PSit (char *filename, char *pagename, int scaleMode, int pageMode) {
     20
     21  int i, Nsection;
    1122  double scale;
    1223  FILE *f;
    13   char filename[1024], pagename[1024], *version;
     24  char *version;
    1425  Section *section;
    1526
    1627  graphic = GetGraphic();
    17 
    18   /* expect a line telling the number of bytes and a filename */
    19   KiiScanMessage (sock, "%s %s %d %d", filename, pagename, &scaleMode, &pageMode);
    2028
    2129  if (pageMode == KAPA_PS_NEWPAGE) {
     
    7684  }
    7785
     86  Nsection = GetNumberOfSections ();
    7887  for (i = 0; i < Nsection; i++) {
    7988    section = GetSectionByNumber (i);
     
    8594    }
    8695    if (section->image) {
    87       // PSimage ();
     96      PSimage (section->image, f);
    8897    }
    8998  }
Note: See TracChangeset for help on using the changeset viewer.