IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 15, 2007, 9:10:13 AM (19 years ago)
Author:
eugene
Message:

adding image projection I/O APIs

Location:
trunk/Ohana/src/kapa2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/include/prototypes.h

    r13479 r14500  
    6767int           SetImageData        PROTO((int sock));
    6868int           GetImageData        PROTO((int sock));
     69int           SetImageCoords      PROTO((int sock));
     70int           GetImageCoords      PROTO((int sock));
     71int           GetImageRange       PROTO((int sock));
    6972
    7073int           LoadVectorData      PROTO((int sock, KapaGraphWidget *graph, int N, char *type));
  • trunk/Ohana/src/kapa2/src/CheckPipe.c

    r13899 r14500  
    155155  }
    156156 
     157  if (!strcmp (word, "SIMC")) {
     158    SetImageCoords (sock);
     159    KiiSendCommand (sock, 4, "DONE");
     160    FINISHED (TRUE);
     161  }
     162 
     163  if (!strcmp (word, "GIMC")) {
     164    GetImageCoords (sock);
     165    KiiSendCommand (sock, 4, "DONE");
     166    FINISHED (TRUE);
     167  }
     168 
     169  if (!strcmp (word, "GIMR")) {
     170    GetImageRange (sock);
     171    KiiSendCommand (sock, 4, "DONE");
     172    FINISHED (TRUE);
     173  }
     174 
    157175  if (!strcmp (word, "GIMD")) {
    158176    GetImageData (sock);
  • trunk/Ohana/src/kapa2/src/SetImageData.c

    r13479 r14500  
    5252  return (TRUE);
    5353}
     54
     55int SetImageCoords (int sock) {
     56 
     57  int i;
     58  double xmin, xmax, ymin, ymax;
     59  Graphic *graphic;
     60  Section *section;
     61  KapaImageWidget *image;
     62
     63  graphic = GetGraphic();
     64
     65  section = GetActiveSection();
     66  if (section->image == NULL) {
     67    section->image = InitImage ();
     68    SetSectionSizes (section);
     69  }
     70  image = section->image;
     71 
     72  KiiScanMessage (sock, "%f %f %f %f",
     73                  &image[0].coords.pc1_1, &image[0].coords.pc2_2,
     74                  &image[0].coords.pc1_2, &image[0].coords.pc2_1);
     75
     76  KiiScanMessage (sock, "%s", image[0].coords.ctype);
     77
     78  KiiScanMessage (sock, "%lf %lf %f %f %f %f",
     79                  &image[0].coords.crval1,
     80                  &image[0].coords.crval2,
     81                  &image[0].coords.crpix1,
     82                  &image[0].coords.crpix2,
     83                  &image[0].coords.cdelt1,
     84                  &image[0].coords.cdelt2);
     85
     86  return (TRUE); 
     87}
     88
     89int GetImageCoords (int sock) {
     90 
     91  Section *section;
     92  KapaImageWidget *image;
     93
     94  section = GetActiveSection();
     95  if (section->image == NULL) {
     96    section->image = InitImage ();
     97    SetSectionSizes (section);
     98  }
     99  image = section->image;
     100
     101  KiiSendMessage (sock, "%g %g %g %g",
     102                  image[0].coords.pc1_1, image[0].coords.pc2_2,
     103                  image[0].coords.pc1_2, image[0].coords.pc2_1);
     104
     105  KiiSendMessage (sock, "%s", image[0].coords.ctype);
     106
     107  KiiSendMessage (sock, "%g %g %g %g %g %g",
     108                  image[0].coords.crval1,
     109                  image[0].coords.crval2,
     110                  image[0].coords.crpix1,
     111                  image[0].coords.crpix2,
     112                  image[0].coords.cdelt1,
     113                  image[0].coords.cdelt2);
     114
     115  return (TRUE);
     116}
     117
     118int GetImageRange (int sock) {
     119 
     120  Section *section;
     121  KapaImageWidget *image;
     122  double Xmin, Xmax, Ymin, Ymax;
     123
     124  section = GetActiveSection();
     125  if (section->image == NULL) {
     126    section->image = InitImage ();
     127    SetSectionSizes (section);
     128  }
     129  image = section->image;
     130
     131  Screen_to_Image (&Xmin, &Ymin, 0.0, 0.0, image);
     132  Screen_to_Image (&Xmax, &Ymax, image[0].picture.dx, image[0].picture.dy, image);
     133
     134  KiiSendMessage (sock, "%g %g %g %g", Xmin, Xmax, Ymin, Ymax);
     135
     136  return (TRUE);
     137}
     138
  • trunk/Ohana/src/kapa2/src/SetImageSize.c

    r13479 r14500  
    7777      image[0].text_dx = ZOOM_X;
    7878      image[0].text_dy = 6*textpad + 7*PAD1;
     79      image[0].text_dyo = 3*textpad + 4*PAD1;
    7980
    8081      image[0].overlay_button[0].x = image[0].text_x;
     
    144145      image[0].text_dx = ZOOM_X;
    145146      image[0].text_dy = 6*textpad + 7*PAD1;
     147      image[0].text_dyo = 3*textpad + 4*PAD1;
    146148
    147149      image[0].overlay_button[0].x = image[0].text_x;
     
    209211      image[0].text_dx = ZOOM_X;
    210212      image[0].text_dy = 6*textpad + 7*PAD1;
     213      image[0].text_dyo = 3*textpad + 4*PAD1;
    211214
    212215      image[0].overlay_button[0].x = image[0].text_x;
     
    274277      image[0].text_dx = ZOOM_X;
    275278      image[0].text_dy = 6*textpad + 7*PAD1;
     279      image[0].text_dyo = 3*textpad + 4*PAD1;
    276280
    277281      image[0].overlay_button[0].x = image[0].text_x;
Note: See TracChangeset for help on using the changeset viewer.