Changeset 15925
- Timestamp:
- Dec 24, 2007, 5:47:04 PM (18 years ago)
- Location:
- branches/eam_branch_20071222/Ohana/src/kapa2
- Files:
-
- 2 added
- 39 edited
-
Makefile (modified) (1 diff)
-
include/buttons.h (modified) (1 diff)
-
include/constants.h (modified) (1 diff)
-
include/prototypes.h (modified) (3 diffs)
-
include/structures.h (modified) (5 diffs)
-
src/ButtonFunctions.c (modified) (7 diffs)
-
src/CSaveOverlay.c (modified) (1 diff)
-
src/Center.c (modified) (2 diffs)
-
src/CheckButtons.c (modified) (3 diffs)
-
src/CheckPipe.c (modified) (1 diff)
-
src/CheckVisual.c (modified) (6 diffs)
-
src/CreateZoom16.c (modified) (4 diffs)
-
src/CreateZoom24.c (modified) (4 diffs)
-
src/CreateZoom32.c (modified) (4 diffs)
-
src/CreateZoom8.c (modified) (4 diffs)
-
src/CursorOps.c (modified) (2 diffs)
-
src/DragColorbar.c (modified) (2 diffs)
-
src/Image.c (modified) (6 diffs)
-
src/InterpretKeys.c (modified) (5 diffs)
-
src/InterpretPresses.c (modified) (3 diffs)
-
src/JPEGit24.c (modified) (3 diffs)
-
src/LoadOverlay.c (modified) (1 diff)
-
src/LoadPicture.c (modified) (5 diffs)
-
src/LoadTickmarks.c (modified) (1 diff)
-
src/MakeColormap.c (modified) (1 diff)
-
src/PSPixmap.c (modified) (4 diffs)
-
src/Remap.c (modified) (1 diff)
-
src/Remap16.c (modified) (1 diff)
-
src/Remap24.c (modified) (1 diff)
-
src/Remap32.c (modified) (1 diff)
-
src/Remap8.c (modified) (1 diff)
-
src/Reorient.c (modified) (1 diff)
-
src/Rescale.c (added)
-
src/SetChannel.c (added)
-
src/SetColormap.c (modified) (4 diffs)
-
src/SetImageData.c (modified) (9 diffs)
-
src/SetImageSize.c (modified) (6 diffs)
-
src/SetToolbox.c (modified) (2 diffs)
-
src/StatusBox.c (modified) (1 diff)
-
src/UpdatePointer.c (modified) (2 diffs)
-
src/UpdateStatusBox.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071222/Ohana/src/kapa2/Makefile
r13484 r15925 77 77 $(SRC)/bDrawOverlay.$(ARCH).o $(SRC)/ButtonFunctions.$(ARCH).o \ 78 78 $(SRC)/PSimage.$(ARCH).o $(SRC)/PSPixmap.$(ARCH).o \ 79 $(SRC)/PSOverlay.$(ARCH).o 79 $(SRC)/PSOverlay.$(ARCH).o $(SRC)/SetChannel.$(ARCH).o 80 80 81 81 OBJ = $(KAPA) -
branches/eam_branch_20071222/Ohana/src/kapa2/include/buttons.h
r13320 r15925 47 47 0x80, 0xef, 0x03, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 48 0x00, 0x00, 0x00, 0x00}; 49 #define puns_width 2550 #define puns_height 2551 static char puns_bits[] = {49 #define heat_width 25 50 #define heat_height 25 51 static char heat_bits[] = { 52 52 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xd8, 0x01, 53 53 0x00, 0x0c, 0x37, 0x00, 0xf8, 0xc9, 0x6f, 0x00, 0x0c, 0xde, 0xf0, 0x00, -
branches/eam_branch_20071222/Ohana/src/kapa2/include/constants.h
r13479 r15925 9 9 | StructureNotifyMask \ 10 10 | PointerMotionMask) 11 12 # define NCHANNELS 3 13 # define NPIXELS_DYNAMIC 128 14 # define NPIXELS_STATIC 1024 11 15 12 16 # define PAD1 3 -
branches/eam_branch_20071222/Ohana/src/kapa2/include/prototypes.h
r14590 r15925 140 140 141 141 int Center PROTO(()); 142 void Remap PROTO((Graphic *graphic, KapaImageWidget *image , Matrix *matrix));142 void Remap PROTO((Graphic *graphic, KapaImageWidget *image)); 143 143 void Remap8 PROTO((Graphic *graphic, KapaImageWidget *image, Matrix *matrix)); 144 144 void Remap16 PROTO((Graphic *graphic, KapaImageWidget *image, Matrix *matrix)); … … 147 147 int LoadPicture PROTO((int sock)); 148 148 149 KapaImageWidget *InitImage PROTO(()); 149 KapaImageWidget *InitImageWidget PROTO(()); 150 int InitImageChannel PROTO((KapaImageChannel *channel)); 150 151 void FreeImage PROTO((KapaImageWidget *image)); 151 152 void SetImageSize PROTO((Section *section)); … … 179 180 /* Button Functions */ 180 181 int greycolors PROTO((Graphic *graphic, KapaImageWidget *image)); 181 int punsPROTO((Graphic *graphic, KapaImageWidget *image));182 int heat PROTO((Graphic *graphic, KapaImageWidget *image)); 182 183 int rainbow PROTO((Graphic *graphic, KapaImageWidget *image)); 183 184 int Recenter PROTO((Graphic *graphic, KapaImageWidget *image)); -
branches/eam_branch_20071222/Ohana/src/kapa2/include/structures.h
r15906 r15925 2 2 /**************** Graphic carries X info around ****************/ 3 3 typedef struct { 4 Display *display; 5 int screen; 4 Display *display; // X display pointer 5 int screen; // X screen number 6 6 int depth; 7 7 Window window; 8 8 Visual *visual; 9 int visualclass; 10 int Nbits; 9 int visualclass; // is visual dynamic? (XXX change name?) 10 int Nbits; // pixel depth in bits (8, 16, 24, 32) 11 11 GC gc; 12 12 XFontStruct *font; … … 14 14 int x, y; 15 15 unsigned int dx, dy; 16 XColor cmap[1024];16 XColor *cmap; 17 17 Colormap colormap; 18 unsigned long fore; 19 unsigned long back; 20 unsigned long *color; 21 unsigned long pixels[1024]; 22 unsigned long overlay_color[NOVERLAYS]; 23 int Npixels; 18 unsigned long *color; // graph plotting colors 24 19 int Ncolors; 20 21 unsigned long *pixels; // image pixel colors 22 int Npixels; // number of pixels 23 24 unsigned long fore; // basic foreground color 25 unsigned long back; // basic background color 26 27 unsigned long overlay_color[NOVERLAYS]; // image plotting colors 25 28 } Graphic; 26 29 … … 125 128 } KapaGraphWidget; 126 129 130 typedef struct { 131 // data associated with this image element 132 Matrix matrix; /* data for picture */ 133 double zero, range; /* zero, range for picture to cmap */ 134 double max, min; /* zero, range for data to z-value */ 135 double start, slope; /* zero, range for cmap to pixels */ 136 Coords coords; 137 char file[1024]; /* name of file */ 138 char name[1024]; /* name of buffer */ 139 } KapaImageChannel; 140 127 141 // a single image in the display window 128 142 typedef struct { … … 139 153 Button grey_button; 140 154 Button rainbow_button; 141 Button puns_button;155 Button heat_button; 142 156 Button overlay_button[NOVERLAYS]; 143 157 … … 149 163 int DecimalDegrees; 150 164 151 // data associated with this image element 165 double X, Y; /* image pixel at screen center */ 166 int expand; /* zoomscale */ 167 double x, y, z; /* last pointer coords */ 168 152 169 Overlay overlay[NOVERLAYS]; 153 170 Overlay tickmarks; 154 Matrix matrix; /* data for picture */ 155 double X, Y; /* image pixel at screen center */ 156 int expand; /* zoomscale */ 157 double zero, range; /* zero, range for picture to cmap */ 158 double max, min; /* zero, range for data to z-value */ 159 double start, slope; /* zero, range for cmap to pixels */ 160 double x, y, z; /* last pointer coords */ 161 Coords coords; 162 char file[1024]; /* name of file */ 163 char name[1024]; /* name of buffer */ 171 172 unsigned short *pixmap; // lookup table for image pixel value to pixel index 173 KapaImageChannel *image; 174 KapaImageChannel channel[NCHANNELS]; 164 175 } KapaImageWidget; 165 176 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/ButtonFunctions.c
r13331 r15925 2 2 3 3 static char *GREY = "greyscale"; 4 static char * PUNS = "Puns";4 static char *HEAT = "Heat"; 5 5 static char *RAINBOW = "Rainbow"; 6 6 … … 18 18 SetColormap (name); 19 19 CreateColorbar (image, graphic); 20 Remap (graphic, image , &image[0].matrix);20 Remap (graphic, image); 21 21 CreateZoom (image, graphic, 0, 0); 22 22 Refresh (); … … 25 25 } 26 26 27 int puns(Graphic *graphic, KapaImageWidget *image) {27 int heat (Graphic *graphic, KapaImageWidget *image) { 28 28 char *name; 29 name = PUNS;29 name = HEAT; 30 30 SetColormap (name); 31 31 CreateColorbar (image, graphic); 32 Remap (graphic, image , &image[0].matrix);32 Remap (graphic, image); 33 33 CreateZoom (image, graphic, 0, 0); 34 34 Refresh (); … … 42 42 SetColormap (name); 43 43 CreateColorbar (image, graphic); 44 Remap (graphic, image , &image[0].matrix);44 Remap (graphic, image); 45 45 CreateZoom (image, graphic, 0, 0); 46 46 Refresh (); … … 54 54 image[0].Y = 0; 55 55 56 Remap (graphic, image , &image[0].matrix);56 Remap (graphic, image); 57 57 Refresh (); 58 58 FlushDisplay (graphic[0].display); … … 64 64 65 65 image[0].expand = 1; 66 Remap (graphic, image , &image[0].matrix);66 Remap (graphic, image); 67 67 Refresh (); 68 68 FlushDisplay (graphic[0].display); … … 77 77 image[0].expand = 1; 78 78 79 Remap (graphic, image , &image[0].matrix);79 Remap (graphic, image); 80 80 Refresh (); 81 81 FlushDisplay (graphic[0].display); -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CSaveOverlay.c
r13479 r15925 24 24 for (i = 0; i < image[0].overlay[N].Nobjects; i++) { 25 25 if (image[0].overlay[N].objects[i].type == KII_OVERLAY_LINE) { 26 XY_to_RD (&ra, &dec, image[0].overlay[N].objects[i].x, image[0].overlay[N].objects[i].y, &image[0]. coords);26 XY_to_RD (&ra, &dec, image[0].overlay[N].objects[i].x, image[0].overlay[N].objects[i].y, &image[0].image[0].coords); 27 27 x1 = image[0].overlay[N].objects[i].x + image[0].overlay[N].objects[i].dx; 28 28 y1 = image[0].overlay[N].objects[i].y + image[0].overlay[N].objects[i].dy; 29 XY_to_RD (&ra1, &dec1, x1, y1, &image[0]. coords);29 XY_to_RD (&ra1, &dec1, x1, y1, &image[0].image[0].coords); 30 30 dra = (ra1 - ra); 31 31 ddec = (dec1 - dec); 32 32 } else { 33 XY_to_RD (&ra, &dec, image[0].overlay[N].objects[i].x, image[0].overlay[N].objects[i].y, &image[0]. coords);33 XY_to_RD (&ra, &dec, image[0].overlay[N].objects[i].x, image[0].overlay[N].objects[i].y, &image[0].image[0].coords); 34 34 x1 = image[0].overlay[N].objects[i].x; 35 35 y1 = image[0].overlay[N].objects[i].y + image[0].overlay[N].objects[i].dy; 36 XY_to_RD (&ra1, &dec1, x1, y1, &image[0]. coords);36 XY_to_RD (&ra1, &dec1, x1, y1, &image[0].image[0].coords); 37 37 ddec = fabs (dec1 - dec); 38 38 x1 = image[0].overlay[N].objects[i].x + image[0].overlay[N].objects[i].dx; 39 39 y1 = image[0].overlay[N].objects[i].y; 40 XY_to_RD (&ra1, &dec1, x1, y1, &image[0]. coords);40 XY_to_RD (&ra1, &dec1, x1, y1, &image[0].image[0].coords); 41 41 dra = cos (dec*RAD_DEG) * fabs (ra1 - ra); 42 42 } -
branches/eam_branch_20071222/Ohana/src/kapa2/src/Center.c
r13479 r15925 16 16 if (image == NULL) return (TRUE); 17 17 18 image[0].X = 0.5*image[0]. matrix.Naxis[0] - X;19 image[0].Y = 0.5*image[0]. matrix.Naxis[1] - Y;18 image[0].X = 0.5*image[0].image[0].matrix.Naxis[0] - X; 19 image[0].Y = 0.5*image[0].image[0].matrix.Naxis[1] - Y; 20 20 if ((zoom != 0) && (zoom != -1)) { 21 21 image[0].expand = zoom; … … 23 23 24 24 if (USE_XWINDOW) { 25 Remap (graphic, image , &image[0].matrix);25 Remap (graphic, image); 26 26 Refresh (); 27 27 XFlush (graphic[0].display); -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckButtons.c
r13320 r15925 1 1 # include "Ximage.h" 2 # define PAD_X 103 # define PAD_Y 104 # define NPLANES 15 # define NPIXELS 2556 2 7 3 /******** Here we test the Buttons specific to this program *******/ … … 21 17 button = &image[0].rainbow_button; 22 18 23 if (InButton (event, &image[0]. puns_button))24 button = &image[0]. puns_button;19 if (InButton (event, &image[0].heat_button)) 20 button = &image[0].heat_button; 25 21 26 22 if (InButton (event, &image[0].PS_button)) … … 39 35 } 40 36 41 42 37 /* To define a button, you must: 43 38 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckPipe.c
r14590 r15925 268 268 } 269 269 270 if (!strcmp (word, "CHAN")) { 271 status = SetChannel (sock); 272 KiiSendCommand (sock, 4, "DONE"); 273 FINISHED (status); 274 } 275 270 276 if (!strcmp (word, "SAVE")) { 271 277 status = SaveOverlay (sock); -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckVisual.c
r15906 r15925 1 1 # include "Ximage.h" 2 # define NPIXELS 643 2 4 3 /* DirectColor doesn't seem to work, even though it is available: … … 11 10 12 11 int i, Nfound, N; 13 int col, def, dyn;12 int isColor, isDefault, isDynamic; 14 13 XVisualInfo *visual_list, visual_temp; 15 14 unsigned long planes[3]; … … 20 19 fprintf (stderr, "DirectColor: %d\n", DirectColor); 21 20 fprintf (stderr, "PseudoColor: %d\n", PseudoColor); 22 fprintf (stderr, "TrueColor: %d\n", TrueColor);23 fprintf (stderr, "GrayScale: %d\n", GrayScale);21 fprintf (stderr, "TrueColor: %d\n", TrueColor); 22 fprintf (stderr, "GrayScale: %d\n", GrayScale); 24 23 fprintf (stderr, "StaticColor: %d\n", StaticColor); 25 fprintf (stderr, "StaticGray: %d\n", StaticGray);24 fprintf (stderr, "StaticGray: %d\n", StaticGray); 26 25 } 27 26 … … 42 41 } 43 42 44 col = def = dyn = FALSE; 43 // set these based on selected visual 44 isColor = isDefault = isDynamic = FALSE; 45 46 // attempt to select the most desirable type of visual: Default as PseudoColor (XXX is it still true?) 45 47 if (DEBUG) fprintf (stderr, "default visual class is %d\n", visual_list[i].class); 46 switch (visual_list[i].class) { 47 case PseudoColor: 48 col = def = dyn = TRUE; 48 if (visual_list[i].class == PseudoColor) { 49 isColor = isDefault = isDynamic = TRUE; 49 50 graphic[0].visual = visual_list[i].visual; 50 51 graphic[0].visualclass = TRUE; 51 52 goto test_pixels; 52 break;53 default:54 break;55 53 } 56 54 57 for (i = 0; i < Nfound; i++) { 58 switch (visual_list[i].class) { 59 case PseudoColor: 60 if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class); 61 col = dyn = TRUE; 62 if (graphic[0].visual == visual_list[i].visual) { 63 def = TRUE; 64 } else { 65 graphic[0].visual = visual_list[i].visual; 66 } 67 graphic[0].visualclass = TRUE; 68 goto test_pixels; 69 break; 70 default: 71 break; 72 } 55 // attempt to select the most desirable type of visual: PseudoColor (XXX is it still true?) 56 for (i = 0; (i < Nfound) && (visual_list[i].class != PseudoColor); i++); 57 if (i != Nfound) { 58 isColor = isDynamic = TRUE; 59 if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class); 60 isDefault = (graphic[0].visual == visual_list[i].visual); 61 graphic[0].visual = visual_list[i].visual; 62 graphic[0].visualclass = TRUE; 63 goto test_pixels; 73 64 } 74 65 75 for (i = 0; i < Nfound; i++) { 76 switch (visual_list[i].class) { 77 case GrayScale: 78 if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class); 79 dyn = TRUE; 80 if (graphic[0].visual == visual_list[i].visual) { 81 def = TRUE; 82 } else { 83 graphic[0].visual = visual_list[i].visual; 84 } 85 graphic[0].visualclass = TRUE; 86 goto test_pixels; 87 break; 88 default: 89 break; 90 } 66 // attempt to select the most desirable type of visual: GrayScale (XXX is it still true?) 67 for (i = 0; (i < Nfound) && (visual_list[i].class != GrayScale); i++); 68 if (i != Nfound) { 69 isDynamic = TRUE; 70 if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class); 71 isDefault = (graphic[0].visual == visual_list[i].visual); 72 graphic[0].visual = visual_list[i].visual; 73 graphic[0].visualclass = TRUE; 74 goto test_pixels; 91 75 } 92 76 77 // attempt to select the most desirable type of visual: TrueColor (XXX is it still true?) 93 78 for (i = 0; (i < Nfound) && (visual_list[i].class != TrueColor); i++); 94 79 if (i != Nfound) { 95 col= TRUE;80 isColor = TRUE; 96 81 if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class); 97 if (graphic[0].visual == visual_list[i].visual) { 98 def = TRUE; 99 } else { 100 graphic[0].visual = visual_list[i].visual; 101 } 82 isDefault = (graphic[0].visual == visual_list[i].visual); 83 graphic[0].visual = visual_list[i].visual; 102 84 graphic[0].visualclass = FALSE; 103 85 goto test_pixels; 104 86 } 105 87 88 // attempt to select the most desirable type of visual: TrueColor (XXX is it still true?) 106 89 for (i = 0; (i < Nfound) && (visual_list[i].class != StaticColor); i++); 107 90 if (i != Nfound) { 108 91 if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class); 109 if (graphic[0].visual == visual_list[i].visual) { 110 def = TRUE; 111 } else { 112 graphic[0].visual = visual_list[i].visual; 113 } 92 isDefault = (graphic[0].visual == visual_list[i].visual); 93 graphic[0].visual = visual_list[i].visual; 114 94 graphic[0].visualclass = FALSE; 115 95 goto test_pixels; 116 96 } 117 97 98 // attempt to select the most desirable type of visual: TrueColor (XXX is it still true?) 118 99 for (i = 0; (i < Nfound) && (visual_list[i].class != StaticGray); i++); 119 100 if (i != Nfound) { 120 101 if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class); 121 if (graphic[0].visual == visual_list[i].visual) { 122 def = TRUE; 123 } else { 124 graphic[0].visual = visual_list[i].visual; 125 } 102 isDefault = (graphic[0].visual == visual_list[i].visual); 103 graphic[0].visual = visual_list[i].visual; 126 104 graphic[0].visualclass = FALSE; 127 105 goto test_pixels; … … 136 114 /* NEED TO ADD A COUPLE LINES DEFINING THE VARIOUS HARD COLORS (BLACK, WHITE, AND THE OVERLAYS) */ 137 115 116 // allow user to force a private colormap 138 117 if ((N = get_argument (*argc, argv, "-private"))) { 139 118 remove_argument(N, argc, argv); 140 def= FALSE;119 isDefault = FALSE; 141 120 } 142 121 143 if (!def) { 122 // allocate a private colormap, if needed 123 if (!isDefault) { 144 124 if (DEBUG) fprintf (stderr, "allocated private colormap\n"); 145 125 graphic[0].colormap = XCreateColormap (graphic[0].display, RootWindow (graphic[0].display, graphic[0].screen), graphic[0].visual, AllocNone); 146 126 } 147 127 148 if (dyn) { 149 /* allocate color cells */ 150 for (graphic[0].Npixels = NPIXELS; 151 ((graphic[0].Npixels >= 16) && 152 !XAllocColorCells (graphic[0].display, graphic[0].colormap, FALSE, planes, 1, graphic[0].pixels, graphic[0].Npixels)); 153 graphic[0].Npixels -= 4) { 128 if (isDynamic) { 129 /* allocate color cells */ 130 ALLOCATE (graphic[0].pixels, unsigned long, NPIXELS_DYNAMIC); 131 ALLOCATE (graphic[0].cmap, XColor, NPIXELS_DYNAMIC); 132 for (graphic[0].Npixels = NPIXELS_DYNAMIC; graphic[0].Npixels >= 16; graphic[0].Npixels -= 4) { 154 133 if (DEBUG) fprintf (stderr, "trying %d colors\n", (int) graphic[0].Npixels); 134 if (XAllocColorCells (graphic[0].display, graphic[0].colormap, FALSE, planes, 1, graphic[0].pixels, graphic[0].Npixels)) { 135 break; 136 } 155 137 } 156 138 139 /* insufficient cells, can we make a private colormap? */ 140 if (graphic[0].Npixels < 16) { 141 if (!isDefault) { 142 fprintf (stderr, "can't allocate enough cells in private colormap\n"); 143 exit (0); 144 } 145 if (DEBUG) fprintf (stderr, "can't allocate enough cells, using private colormap\n"); 146 graphic[0].colormap = XCreateColormap (graphic[0].display, RootWindow (graphic[0].display, graphic[0].screen), graphic[0].visual, AllocNone); 157 147 158 /* make private colormap */ 159 if (graphic[0].Npixels < 16) { 160 // fprintf (stderr, "can't allocate enough cells, using private colormap\n"); 161 graphic[0].colormap = XCreateColormap (graphic[0].display, RootWindow (graphic[0].display, graphic[0].screen), graphic[0].visual, AllocNone); 162 for (graphic[0].Npixels = NPIXELS; 163 ((graphic[0].Npixels >= 16) && 164 !XAllocColorCells (graphic[0].display, graphic[0].colormap, FALSE, planes, 1, graphic[0].pixels, graphic[0].Npixels)); 165 graphic[0].Npixels -= 4); 148 for (graphic[0].Npixels = NPIXELS_DYNAMIC; graphic[0].Npixels >= 16; graphic[0].Npixels -= 4) { 149 if (DEBUG) fprintf (stderr, "trying %d colors\n", (int) graphic[0].Npixels); 150 if (XAllocColorCells (graphic[0].display, graphic[0].colormap, FALSE, planes, 1, graphic[0].pixels, graphic[0].Npixels)) { 151 break; 152 } 153 } 166 154 167 155 if ((N = get_argument (*argc, argv, "-colorcount"))) { 168 fprintf (stderr, "k ii can grab %d colors\n", (int)graphic[0].Npixels);156 fprintf (stderr, "kapa can grab %d colors\n", graphic[0].Npixels); 169 157 exit (0); 170 158 } … … 174 162 } 175 163 } 176 } 177 178 if (!dyn) { 179 graphic[0].Npixels = 1024; 180 // fprintf (stderr, "can't use dynamic colors, color scrollbar inactive\n"); 181 // fprintf (stderr, " this can be avoided by using a dynamic visual class\n"); 182 // fprintf (stderr, " (see Kii help page for details)\n"); 164 } else { 165 // XXX allocate the unsigned long *pixels here and above 166 ALLOCATE (graphic[0].pixels, unsigned long, NPIXELS_STATIC); 167 ALLOCATE (graphic[0].cmap, XColor, NPIXELS_STATIC); 168 graphic[0].Npixels = NPIXELS_STATIC; 183 169 } 184 170 185 171 if ((N = get_argument (*argc, argv, "-colorcount"))) { 186 fprintf (stderr, "kii can grab %d colors\n", (int)graphic[0].Npixels);172 fprintf (stderr, "kii can grab %d colors\n", graphic[0].Npixels); 187 173 exit (0); 188 174 } -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom16.c
r13479 r15925 31 31 dy = image[0].zoom.dy; 32 32 33 if (image[0]. matrix.size == 0) { /* create a test pattern */33 if (image[0].image[0].matrix.size == 0) { /* create a test pattern */ 34 34 REALLOCATE (image[0].zoom.data, char, 2*dy*dx); 35 35 bzero (image[0].zoom.data, image[0].zoom.dx*image[0].zoom.dy); … … 48 48 // define the color transform parameters 49 49 MaxValue = graphic[0].Npixels - 1; 50 if (image[0]. range != 0.0) {51 slope = graphic[0].Npixels / image[0]. range;52 start = graphic[0].Npixels * image[0]. zero /image[0].range;50 if (image[0].image[0].range != 0.0) { 51 slope = graphic[0].Npixels / image[0].image[0].range; 52 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 53 53 } else { 54 54 slope = 1.0; 55 start = image[0]. zero;55 start = image[0].image[0].zero; 56 56 } 57 57 … … 61 61 expand_in = 1; 62 62 63 DX = image[0]. matrix.Naxis[0];64 DY = image[0]. matrix.Naxis[1];63 DX = image[0].image[0].matrix.Naxis[0]; 64 DY = image[0].image[0].matrix.Naxis[1]; 65 65 Rx = x - expand*(int)(0.5*(dx + 1)) + 1; 66 66 Ry = y - expand*(int)(0.5*(dy + 1)) + 1; … … 74 74 75 75 data = out_pix = (unsigned char *) image[0].zoom.data; 76 imdata = (float *) image[0]. matrix.buffer;76 imdata = (float *) image[0].image[0].matrix.buffer; 77 77 in_pix = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)]; 78 78 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom24.c
r13479 r15925 32 32 extra = 4 - (dx * 3) % 4; 33 33 34 if (image[0]. matrix.size == 0) { /* create a test pattern */34 if (image[0].image[0].matrix.size == 0) { /* create a test pattern */ 35 35 REALLOCATE (image[0].zoom.data, char, dy*(3*dx+extra)); 36 36 bzero (image[0].zoom.data, image[0].zoom.dx*image[0].zoom.dy); … … 52 52 // define the color transform parameters 53 53 MaxValue = graphic[0].Npixels - 1; 54 if (image[0]. range != 0.0) {55 slope = graphic[0].Npixels / image[0]. range;56 start = graphic[0].Npixels * image[0]. zero /image[0].range;54 if (image[0].image[0].range != 0.0) { 55 slope = graphic[0].Npixels / image[0].image[0].range; 56 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 57 57 } else { 58 58 slope = 1.0; 59 start = image[0]. zero;59 start = image[0].image[0].zero; 60 60 } 61 61 … … 65 65 expand_in = 1; 66 66 67 DX = image[0]. matrix.Naxis[0];68 DY = image[0]. matrix.Naxis[1];67 DX = image[0].image[0].matrix.Naxis[0]; 68 DY = image[0].image[0].matrix.Naxis[1]; 69 69 Rx = x - expand*(int)(0.5*(dx + 1)) + 1; 70 70 Ry = y - expand*(int)(0.5*(dy + 1)) + 1; … … 78 78 79 79 data = out_pix = (unsigned char *) image[0].zoom.data; 80 imdata = (float *) image[0]. matrix.buffer;80 imdata = (float *) image[0].image[0].matrix.buffer; 81 81 in_pix = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)]; 82 82 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom32.c
r13479 r15925 26 26 unsigned long back; 27 27 28 if (image[0]. matrix.size == 0) { /* create a test pattern */28 if (image[0].image[0].matrix.size == 0) { /* create a test pattern */ 29 29 REALLOCATE (image[0].zoom.data, char, 4*image[0].zoom.dx*image[0].zoom.dy); 30 30 image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, … … 40 40 // define the color transform parameters 41 41 MaxValue = graphic[0].Npixels - 1; 42 if (image[0]. range != 0.0) {43 slope = graphic[0].Npixels / image[0]. range;44 start = graphic[0].Npixels * image[0]. zero /image[0].range;42 if (image[0].image[0].range != 0.0) { 43 slope = graphic[0].Npixels / image[0].image[0].range; 44 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 45 45 } else { 46 46 slope = 1.0; 47 start = image[0]. zero;47 start = image[0].image[0].zero; 48 48 } 49 49 … … 55 55 dx = image[0].zoom.dx; 56 56 dy = image[0].zoom.dy; 57 DX = image[0]. matrix.Naxis[0];58 DY = image[0]. matrix.Naxis[1];57 DX = image[0].image[0].matrix.Naxis[0]; 58 DY = image[0].image[0].matrix.Naxis[1]; 59 59 Rx = x - expand*(int)(0.5*(dx + 1)) + 1; 60 60 Ry = y - expand*(int)(0.5*(dy + 1)) + 1; … … 68 68 69 69 out_pix = (unsigned int *) image[0].zoom.data; 70 imdata = (float *) image[0]. matrix.buffer;70 imdata = (float *) image[0].image[0].matrix.buffer; 71 71 in_pix = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)]; 72 72 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom8.c
r14590 r15925 26 26 unsigned long back; 27 27 28 if (image[0]. matrix.size == 0) { /* create a test pattern */28 if (image[0].image[0].matrix.size == 0) { /* create a test pattern */ 29 29 REALLOCATE (image[0].zoom.data, char, image[0].zoom.dx*image[0].zoom.dy); 30 30 bzero (image[0].zoom.data, image[0].zoom.dx*image[0].zoom.dy); … … 41 41 // define the color transform parameters 42 42 MaxValue = graphic[0].Npixels - 1; 43 if (image[0]. range != 0.0) {44 slope = graphic[0].Npixels / image[0]. range;45 start = graphic[0].Npixels * image[0]. zero /image[0].range;43 if (image[0].image[0].range != 0.0) { 44 slope = graphic[0].Npixels / image[0].image[0].range; 45 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 46 46 } else { 47 47 slope = 1.0; 48 start = image[0]. zero;48 start = image[0].image[0].zero; 49 49 } 50 50 … … 56 56 dx = image[0].zoom.dx; 57 57 dy = image[0].zoom.dy; 58 DX = image[0]. matrix.Naxis[0];59 DY = image[0]. matrix.Naxis[1];58 DX = image[0].image[0].matrix.Naxis[0]; 59 DY = image[0].image[0].matrix.Naxis[1]; 60 60 Rx = x - expand*(int)(0.5*(dx + 1)) + 1; 61 61 Ry = y - expand*(int)(0.5*(dy + 1)) + 1; … … 69 69 70 70 out_pix = (unsigned char *) image[0].zoom.data; 71 imdata = (float *) image[0]. matrix.buffer;71 imdata = (float *) image[0].image[0].matrix.buffer; 72 72 in_pix = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)]; 73 73 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/CursorOps.c
r13320 r15925 13 13 } 14 14 15 *x1 = expand*(x2 - image[0].picture.x - 0.5*image[0].picture.dx) + 0.5*image[0]. matrix.Naxis[0] - image[0].X;16 *y1 = expand*(y2 - image[0].picture.y - 0.5*image[0].picture.dy) + 0.5*image[0]. matrix.Naxis[1] - image[0].Y;15 *x1 = expand*(x2 - image[0].picture.x - 0.5*image[0].picture.dx) + 0.5*image[0].image[0].matrix.Naxis[0] - image[0].X; 16 *y1 = expand*(y2 - image[0].picture.y - 0.5*image[0].picture.dy) + 0.5*image[0].image[0].matrix.Naxis[1] - image[0].Y; 17 17 18 18 } … … 31 31 } 32 32 33 *x1 = (x2 - 0.5*image[0]. matrix.Naxis[0] + image[0].X) * expand + image[0].picture.x + 0.5*image[0].picture.dx;34 *y1 = (y2 - 0.5*image[0]. matrix.Naxis[1] + image[0].Y) * expand + image[0].picture.y + 0.5*image[0].picture.dy;33 *x1 = (x2 - 0.5*image[0].image[0].matrix.Naxis[0] + image[0].X) * expand + image[0].picture.x + 0.5*image[0].picture.dx; 34 *y1 = (y2 - 0.5*image[0].image[0].matrix.Naxis[1] + image[0].Y) * expand + image[0].picture.y + 0.5*image[0].picture.dy; 35 35 36 36 } -
branches/eam_branch_20071222/Ohana/src/kapa2/src/DragColorbar.c
r13320 r15925 15 15 Y = mouse_event[0].y; 16 16 Npix = graphic[0].Npixels; 17 slope = image[0]. slope;18 start = image[0]. start;17 slope = image[0].image[0].slope; 18 start = image[0].image[0].start; 19 19 oldfrac_x = oldfrac_y = 10; 20 20 … … 63 63 case ButtonPress: 64 64 case ButtonRelease: 65 image[0]. start = start;66 image[0]. slope = slope;65 image[0].image[0].start = start; 66 image[0].image[0].slope = slope; 67 67 return; 68 68 break; -
branches/eam_branch_20071222/Ohana/src/kapa2/src/Image.c
r13479 r15925 2 2 # include "buttons.h" 3 3 4 int InitImageChannel (KapaImageChannel *channel) { 5 6 /** set up a bunch of default things **/ 7 channel->zero = 0; 8 channel->range = 1; 9 channel->start = 0; 10 channel->slope = 1; 11 12 channel->coords.Npolyterms = 0; 13 channel->matrix.size = 0; /* a flag to show there is no data in the matrix */ 14 ALLOCATE (channel->matrix.buffer, char, 1); /* allocate so later free will not crash! */ 15 16 return (TRUE); 17 } 18 4 19 /* initialization for things not specific to X */ 5 KapaImageWidget *InitImage () {20 KapaImageWidget *InitImageWidget () { 6 21 7 22 int i; … … 14 29 memset (image, 0, sizeof(KapaImageWidget)); 15 30 16 /** set up a bunch of default things **/ 17 image[0].X = image[0].Y = 0; 18 image[0].expand = 1; 19 image[0].zero = 0; 20 image[0].range = 1; 21 image[0].start = 0; 22 image[0].slope = 1; 23 image[0].location = 4; 31 for (i = 0; i < NCHANNELS; i++) { 32 InitImageChannel (&image[0].channel[i]); 33 } 34 image[0].image = &image[0].channel[0]; 24 35 25 image[0].coords.Npolyterms = 0;26 36 for (i = 0; i < NOVERLAYS; i++) { 27 37 image[0].overlay[i].Nobjects = 0; … … 30 40 image[0].overlay[i].color = graphic[0].overlay_color[i]; 31 41 } 32 image[0].matrix.size = 0; /* a flag to show there is no data in the matrix */ 42 43 image[0].X = 0.0; 44 image[0].Y = 0.0; 45 image[0].expand = 1; 46 image[0].location = 4; 33 47 34 48 image[0].MovePointer = TRUE; 35 49 image[0].DecimalDegrees = TRUE; 36 ALLOCATE (image[0].matrix.buffer, char, 1); /* allocate so later free will not crash! */37 50 ALLOCATE (image[0].picture.data, char, 1); /* allocate so later free will not crash! */ 38 51 ALLOCATE (image[0].cmapbar.data, char, 1); /* allocate so later free will not crash! */ … … 48 61 InitButtonFunc (&image[0].rainbow_button, rainbow); 49 62 50 InitButtonSize (&image[0]. puns_button, puns_width, puns_height, puns_bits);51 InitButtonFunc (&image[0]. puns_button, puns);63 InitButtonSize (&image[0].heat_button, heat_width, heat_height, heat_bits); 64 InitButtonFunc (&image[0].heat_button, heat); 52 65 53 66 InitButtonSize (&image[0].recenter_button, recenter_width, recenter_height, recenter_bits); … … 131 144 DrawButton (graphic, &image[0].grey_button); 132 145 DrawButton (graphic, &image[0].rainbow_button); 133 DrawButton (graphic, &image[0]. puns_button);146 DrawButton (graphic, &image[0].heat_button); 134 147 DrawButton (graphic, &image[0].hms_button); 135 148 … … 152 165 free (image[0].overlay[i].objects); 153 166 } 154 free (image[0]. matrix.buffer);167 free (image[0].image[0].matrix.buffer); 155 168 free (image[0].picture.data); 156 169 free (image[0].cmapbar.data); -
branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretKeys.c
r15906 r15925 61 61 if (event[0].y > image[0].picture.y + image[0].picture.dy) goto skip_cursor; 62 62 Screen_to_Image (&X, &Y, (double)event[0].x, (double)event[0].y, image); 63 XY_to_RD (&R, &D, X, Y, &image[0]. coords);63 XY_to_RD (&R, &D, X, Y, &image[0].image[0].coords); 64 64 65 DX = image[0]. matrix.Naxis[0];66 DY = image[0]. matrix.Naxis[1];65 DX = image[0].image[0].matrix.Naxis[0]; 66 DY = image[0].image[0].matrix.Naxis[1]; 67 67 68 68 if (X < 0) goto off_image; … … 70 70 if (X >= DX) goto off_image; 71 71 if (Y >= DY) goto off_image; 72 imdata = (float *) image[0]. matrix.buffer;72 imdata = (float *) image[0].image[0].matrix.buffer; 73 73 Z = imdata[DX*(int)(Y) + (int)(X)]; 74 74 } … … 89 89 switch (keysym) { 90 90 91 case XK_F1: 92 image[0].image = &image[0].channel[0]; 93 Reorient (graphic, image, image[0].X, image[0].Y, 0); 94 break; 95 96 case XK_F2: 97 image[0].image = &image[0].channel[1]; 98 Reorient (graphic, image, image[0].X, image[0].Y, 0); 99 break; 100 101 case XK_F3: 102 image[0].image = &image[0].channel[2]; 103 Reorient (graphic, image, image[0].X, image[0].Y, 0); 104 break; 105 91 106 case XK_KP_Home: 92 107 case XK_Home: … … 103 118 case XK_Return: 104 119 Screen_to_Image (&X, &Y, (double)event[0].x, (double)event[0].y, image); 105 X = 0.5*image[0]. matrix.Naxis[0] - X;106 Y = 0.5*image[0]. matrix.Naxis[1] - Y;120 X = 0.5*image[0].image[0].matrix.Naxis[0] - X; 121 Y = 0.5*image[0].image[0].matrix.Naxis[1] - Y; 107 122 Reorient (graphic, image, X, Y, 0); 108 123 break; … … 133 148 134 149 case XK_KP_Add: 135 image[0]. zero += 0.1*image[0].range;150 image[0].image[0].zero += 0.1*image[0].image[0].range; 136 151 Reorient (graphic, image, image[0].X, image[0].Y, 0); 137 152 break; 138 153 case XK_KP_Subtract: 139 image[0]. zero -= 0.1*image[0].range;154 image[0].image[0].zero -= 0.1*image[0].image[0].range; 140 155 Reorient (graphic, image, image[0].X, image[0].Y, 0); 141 156 break; -
branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretPresses.c
r14590 r15925 36 36 Screen_to_Image (&X, &Y, (double)event[0].x, (double)event[0].y, image); 37 37 38 XY_to_RD (&R, &D, X, Y, &image[0]. coords);38 XY_to_RD (&R, &D, X, Y, &image[0].image[0].coords); 39 39 40 DX = image[0]. matrix.Naxis[0];41 DY = image[0]. matrix.Naxis[1];40 DX = image[0].image[0].matrix.Naxis[0]; 41 DY = image[0].image[0].matrix.Naxis[1]; 42 42 43 43 if (X < 0) goto off_image; … … 45 45 if (X >= DX) goto off_image; 46 46 if (Y >= DY) goto off_image; 47 imdata = (float *) image[0]. matrix.buffer;47 imdata = (float *) image[0].image[0].matrix.buffer; 48 48 Z = imdata[DX*(int)(Y) + (int)(X)]; 49 49 } … … 102 102 103 103 Screen_to_Image (&X, &Y, (double)mouse_event[0].x, (double)mouse_event[0].y, image); 104 X = 0.5*image[0]. matrix.Naxis[0] - X;105 Y = 0.5*image[0]. matrix.Naxis[1] - Y;104 X = 0.5*image[0].image[0].matrix.Naxis[0] - X; 105 Y = 0.5*image[0].image[0].matrix.Naxis[1] - Y; 106 106 107 107 switch (mouse_event[0].button) { -
branches/eam_branch_20071222/Ohana/src/kapa2/src/JPEGit24.c
r14590 r15925 84 84 // define the color transform parameters 85 85 MaxValue = graphic[0].Npixels - 1; 86 if (image[0]. range != 0.0) {87 slope = graphic[0].Npixels / image[0]. range;88 start = graphic[0].Npixels * image[0]. zero /image[0].range;86 if (image[0].image[0].range != 0.0) { 87 slope = graphic[0].Npixels / image[0].image[0].range; 88 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 89 89 } else { 90 90 slope = 1.0; 91 start = image[0]. zero;91 start = image[0].image[0].zero; 92 92 } 93 93 … … 108 108 dx = image[0].picture.dx; 109 109 dy = image[0].picture.dy; 110 DX = image[0]. matrix.Naxis[0];111 DY = image[0]. matrix.Naxis[1];110 DX = image[0].image[0].matrix.Naxis[0]; 111 DY = image[0].image[0].matrix.Naxis[1]; 112 112 113 113 /* X,Y are the image coordinates of the first image pixel */ … … 145 145 ALLOCATE (line_buffer, JSAMPLE, 3*dx); 146 146 147 imdata = (float *) image[0]. matrix.buffer;147 imdata = (float *) image[0].image[0].matrix.buffer; 148 148 in_pix_ref = &imdata[DX*(int)MAX(Y,0) + (int)MAX(X,0)]; 149 149 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadOverlay.c
r15620 r15925 14 14 section = GetActiveSection(); 15 15 if (section->image == NULL) { 16 section->image = InitImage ();16 section->image = InitImageWidget (); 17 17 SetSectionSizes (section); 18 18 } -
branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadPicture.c
r15589 r15925 13 13 section = GetActiveSection(); 14 14 if (section->image == NULL) { 15 section->image = InitImage ();15 section->image = InitImageWidget (); 16 16 SetSectionSizes (section); 17 17 } … … 24 24 KiiScanMessage (sock, "%d %d %d %d %lf %lf", &header.Naxis[0], &header.Naxis[1]); 25 25 KiiScanMessage (sock, "%d %d %d %d %lf %lf", &header.bitpix, &header.unsign, &header.bzero, &header.bscale); 26 KiiScanMessage (sock, "%lf %lf %s %s", &image[0]. zero, &image[0].range, image[0].name,image[0].file);27 KiiScanMessage (sock, "%lf %lf %d", &image[0]. min, &image[0].max, &header.size);28 KiiScanMessage (sock, "%lf %f %f %f %f", &image[0]. coords.crval1, &image[0].coords.crpix1, &image[0].coords.cdelt1, &image[0].coords.pc1_1, &image[0].coords.pc1_2);29 KiiScanMessage (sock, "%lf %f %f %f %f", &image[0]. coords.crval2, &image[0].coords.crpix2, &image[0].coords.cdelt2, &image[0].coords.pc2_1, &image[0].coords.pc2_2);30 KiiScanMessage (sock, "%s", image[0]. coords.ctype);26 KiiScanMessage (sock, "%lf %lf %s %s", &image[0].image[0].zero, &image[0].image[0].range, image[0].image[0].name, image[0].image[0].file); 27 KiiScanMessage (sock, "%lf %lf %d", &image[0].image[0].min, &image[0].image[0].max, &header.size); 28 KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].image[0].coords.crval1, &image[0].image[0].coords.crpix1, &image[0].image[0].coords.cdelt1, &image[0].image[0].coords.pc1_1, &image[0].image[0].coords.pc1_2); 29 KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].image[0].coords.crval2, &image[0].image[0].coords.crpix2, &image[0].image[0].coords.cdelt2, &image[0].image[0].coords.pc2_1, &image[0].image[0].coords.pc2_2); 30 KiiScanMessage (sock, "%s", image[0].image[0].coords.ctype); 31 31 32 gfits_free_matrix (&image[0]. matrix);33 gfits_create_matrix (&header, &image[0]. matrix);32 gfits_free_matrix (&image[0].image[0].matrix); 33 gfits_create_matrix (&header, &image[0].image[0].matrix); 34 34 35 35 fcntl (sock, F_SETFL, O_NONBLOCK); 36 36 37 37 status = 1; 38 buff = image[0]. matrix.buffer;38 buff = image[0].image[0].matrix.buffer; 39 39 bytes_left = header.size; 40 image[0]. matrix.size = 0;40 image[0].image[0].matrix.size = 0; 41 41 while (bytes_left > 0) { 42 42 status = read (sock, buff, bytes_left); … … 46 46 } 47 47 if (status != -1) { /* pipe has data */ 48 image[0]. matrix.size += status;48 image[0].image[0].matrix.size += status; 49 49 bytes_left -= status; 50 50 buff = (char *)(buff + status); … … 54 54 fcntl (sock, F_SETFL, !O_NONBLOCK); 55 55 56 if (DEBUG) fprintf (stderr, "read %d bytes\n", image[0]. matrix.size);56 if (DEBUG) fprintf (stderr, "read %d bytes\n", image[0].image[0].matrix.size); 57 57 /* it it not obvious this condition should kill kii, but ... */ 58 if (image[0]. matrix.size != header.size) {59 fprintf (stderr, "error: expected %d bytes, but got only %d\n", header.size, image[0]. matrix.size);58 if (image[0].image[0].matrix.size != header.size) { 59 fprintf (stderr, "error: expected %d bytes, but got only %d\n", header.size, image[0].image[0].matrix.size); 60 60 return (FALSE); 61 61 } … … 63 63 if (!USE_XWINDOW) return (TRUE); 64 64 65 Remap (graphic, image , &image[0].matrix);65 Remap (graphic, image); 66 66 if (DEBUG) fprintf (stderr, "remapped image\n"); 67 67 Refresh (); -
branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadTickmarks.c
r13479 r15925 11 11 section = GetActiveSection(); 12 12 if (section->image == NULL) { 13 section->image = InitImage ();13 section->image = InitImageWidget (); 14 14 SetSectionSizes (section); 15 15 } -
branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeColormap.c
r13320 r15925 1 1 # include "Ximage.h" 2 # define NPIXELS 643 2 4 3 static char default_cmap[] = "grayscale"; -
branches/eam_branch_20071222/Ohana/src/kapa2/src/PSPixmap.c
r13331 r15925 13 13 /* start at the last line, print lines in decending order */ 14 14 buff = (unsigned char *)image[0].picture.data + image[0].picture.dx*(image[0].picture.dy - 1); 15 slope = image[0]. slope;16 start = image[0]. start;15 slope = image[0].image[0].slope; 16 start = image[0].image[0].start; 17 17 back = graphic[0].back; 18 18 … … 46 46 /* start at the last line, print lines in decending order */ 47 47 buff = (unsigned short *)image[0].picture.data + image[0].picture.dx*(image[0].picture.dy - 1); 48 slope = image[0]. slope;49 start = image[0]. start;48 slope = image[0].image[0].slope; 49 start = image[0].image[0].start; 50 50 back = graphic[0].back; 51 51 … … 83 83 /* start at the last line, print lines in decending order */ 84 84 buff = (unsigned char *)&image[0].picture.data[(dy - 1)*(3*dx + extra)]; 85 slope = image[0]. slope;86 start = image[0]. start;85 slope = image[0].image[0].slope; 86 start = image[0].image[0].start; 87 87 back = graphic[0].back; 88 88 … … 123 123 /* start at the last line, print lines in decending order */ 124 124 buff = (unsigned int *)image[0].picture.data + image[0].picture.dx*(image[0].picture.dy - 1); 125 slope = image[0]. slope;126 start = image[0]. start;125 slope = image[0].image[0].slope; 126 start = image[0].image[0].start; 127 127 back = graphic[0].back; 128 128 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap.c
r13320 r15925 1 1 # include "Ximage.h" 2 2 3 void Remap (Graphic *graphic, KapaImageWidget *image , Matrix *matrix) {3 void Remap (Graphic *graphic, KapaImageWidget *image) { 4 4 5 5 switch (graphic[0].Nbits) { 6 6 case 8: 7 Remap8 (graphic, image,matrix);7 Remap8 (graphic, image, &image->image->matrix); 8 8 break; 9 9 case 16: 10 Remap16 (graphic, image, matrix);10 Remap16 (graphic, image, &image->image->matrix); 11 11 break; 12 12 case 24: 13 Remap24 (graphic, image, matrix);13 Remap24 (graphic, image, &image->image->matrix); 14 14 break; 15 15 case 32: 16 Remap32 (graphic, image, matrix);16 Remap32 (graphic, image, &image->image->matrix); 17 17 break; 18 18 } -
branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap16.c
r13479 r15925 38 38 // define the color transform parameters 39 39 MaxValue = graphic[0].Npixels - 1; 40 if (image[0]. range != 0.0) {41 slope = graphic[0].Npixels / image[0]. range;42 start = graphic[0].Npixels * image[0]. zero /image[0].range;40 if (image[0].image[0].range != 0.0) { 41 slope = graphic[0].Npixels / image[0].image[0].range; 42 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 43 43 } else { 44 44 slope = 1.0; 45 start = image[0]. zero;45 start = image[0].image[0].zero; 46 46 } 47 47 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap24.c
r13479 r15925 40 40 // define the color transform parameters 41 41 MaxValue = graphic[0].Npixels - 1; 42 if (image[0]. range != 0.0) {43 slope = graphic[0].Npixels / image[0]. range;44 start = graphic[0].Npixels * image[0]. zero /image[0].range;42 if (image[0].image[0].range != 0.0) { 43 slope = graphic[0].Npixels / image[0].image[0].range; 44 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 45 45 } else { 46 46 slope = 1.0; 47 start = image[0]. zero;47 start = image[0].image[0].zero; 48 48 } 49 49 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap32.c
r15906 r15925 39 39 // define the color transform parameters 40 40 MaxValue = graphic[0].Npixels - 1; 41 if (image[0]. range != 0.0) {42 slope = graphic[0].Npixels / image[0]. range;43 start = graphic[0].Npixels * image[0]. zero /image[0].range;41 if (image[0].image[0].range != 0.0) { 42 slope = graphic[0].Npixels / image[0].image[0].range; 43 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 44 44 } else { 45 45 slope = 1.0; 46 start = image[0]. zero;46 start = image[0].image[0].zero; 47 47 } 48 48 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap8.c
r13479 r15925 33 33 // define the color transform parameters 34 34 MaxValue = graphic[0].Npixels - 1; 35 if (image[0]. range != 0.0) {36 slope = graphic[0].Npixels / image[0]. range;37 start = graphic[0].Npixels * image[0]. zero /image[0].range;35 if (image[0].image[0].range != 0.0) { 36 slope = graphic[0].Npixels / image[0].image[0].range; 37 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range; 38 38 } else { 39 39 slope = 1.0; 40 start = image[0]. zero;40 start = image[0].image[0].zero; 41 41 } 42 42 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/Reorient.c
r13320 r15925 38 38 } 39 39 40 Remap (graphic, image , &image[0].matrix);40 Remap (graphic, image); 41 41 Refresh (); 42 42 -
branches/eam_branch_20071222/Ohana/src/kapa2/src/SetColormap.c
r15906 r15925 1 1 # include "Ximage.h" 2 2 3 /*** this function uses only private colormaps. it should try the standard colormap 4 first to get better control over the smooth greyscales ***/ 5 6 /** red,green,blue are values in range 0x0000 to 0xffff **/ 3 # define SETVALUE(VAR,VALUE,MINVAL,MAXVAL) { \ 4 float tmp = (VALUE); \ 5 if (tmp < MINVAL) { \ 6 VAR = MINVAL; \ 7 } else if (tmp > MAXVAL) { \ 8 VAR = MAXVAL; \ 9 } else { \ 10 VAR = tmp; \ 11 } } 7 12 8 13 int SetColormap (char *name) { 9 14 10 int i ;11 float scale ;15 int i, ref1, ref2; 16 float scale, blueRef, redRef, greenRef; 12 17 Graphic *graphic; 13 18 14 19 graphic = GetGraphic(); 15 20 21 // red,green,blue are values in range 0x0000 to 0xffff 22 scale = 0xffff / (graphic[0].Npixels - 1); 23 16 24 /* greyscale */ 17 if ((!strcmp (name, "grayscale")) || (!strcmp (name, "greyscale"))) { 18 19 scale = 0xffff / graphic[0].Npixels; 20 25 if ((!strcasecmp (name, "grayscale")) || (!strcasecmp (name, "greyscale"))) { 21 26 for (i = 0; i < graphic[0].Npixels; i++) { 22 graphic[0].cmap[i].red = 0xffff - i*scale;23 graphic[0].cmap[i].green = 0xffff - i*scale;24 graphic[0].cmap[i].blue = 0xffff - i*scale;27 SETVALUE (graphic[0].cmap[i].red, 0xffff - i*scale, 0, 0xffff); 28 SETVALUE (graphic[0].cmap[i].green, 0xffff - i*scale, 0, 0xffff); 29 SETVALUE (graphic[0].cmap[i].blue, 0xffff - i*scale, 0, 0xffff); 25 30 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 26 31 } … … 28 33 } 29 34 /* -grayscale */ 30 if ((!strc mp (name, "-grayscale")) || (!strcmp (name, "-greyscale"))) {35 if ((!strcasecmp (name, "-grayscale")) || (!strcasecmp (name, "-greyscale"))) { 31 36 for (i = 0; i < graphic[0].Npixels; i++) { 32 graphic[0].cmap[i].red = 256*(255*i/graphic[0].Npixels);33 graphic[0].cmap[i].green = 256*(255*i/graphic[0].Npixels);34 graphic[0].cmap[i].blue = 256*(255*i/graphic[0].Npixels);37 SETVALUE (graphic[0].cmap[i].red, i*scale, 0, 0xffff); 38 SETVALUE (graphic[0].cmap[i].green, i*scale, 0, 0xffff); 39 SETVALUE (graphic[0].cmap[i].blue, i*scale, 0, 0xffff); 35 40 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 36 41 } … … 38 43 } 39 44 /* heat */ 40 if (!strcmp (name, "Puns")) { 45 if (!strcasecmp (name, "Heat")) { 46 greenRef = 0.25*graphic[0].Npixels*scale*2.0; 47 blueRef = 0.50*graphic[0].Npixels*scale*2.0; 41 48 for (i = 0; i < (int)(0.25*graphic[0].Npixels); i++) { 49 SETVALUE (graphic[0].cmap[i].red, 2*i*scale, 0, 0xffff); 42 50 graphic[0].cmap[i].green = 0; 43 graphic[0].cmap[i].blue = 0; 44 graphic[0].cmap[i].red = MIN (256*255, 256*255*2*i/(1.0*graphic[0].Npixels)); 51 graphic[0].cmap[i].blue = 0; 45 52 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 46 53 } 47 for (i = (int)(0.25*graphic[0].Npixels); i < (int)(0.50*graphic[0].Npixels); i++) {48 graphic[0].cmap[i].red = MIN (256*255, 256*255*2*i/(1.0*graphic[0].Npixels));49 graphic[0].cmap[i].green = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.25));54 for (i = 0.25*graphic[0].Npixels; i < 0.50*graphic[0].Npixels; i++) { 55 SETVALUE (graphic[0].cmap[i].red, 2*i*scale, 0, 0xffff); 56 SETVALUE (graphic[0].cmap[i].green, 2*i*scale - greenRef, 0, 0xffff); 50 57 graphic[0].cmap[i].blue = 0; 51 58 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 52 59 } 53 60 for (i = (int)(0.50*graphic[0].Npixels); i < (int)(0.75*graphic[0].Npixels); i++) { 54 graphic[0].cmap[i].red = 256*255;55 graphic[0].cmap[i].green = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.25));56 graphic[0].cmap[i].blue = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.50));61 graphic[0].cmap[i].red = 0xffff; 62 SETVALUE (graphic[0].cmap[i].green, 2*i*scale - greenRef, 0, 0xffff); 63 SETVALUE (graphic[0].cmap[i].blue, 2*i*scale - blueRef, 0, 0xffff); 57 64 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 58 65 } 59 66 for (i = (int)(0.75*graphic[0].Npixels); i < graphic[0].Npixels; i++) { 60 graphic[0].cmap[i].red = 256*255;61 graphic[0].cmap[i].green = 256*255;62 graphic[0].cmap[i].blue = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.50));67 graphic[0].cmap[i].red = 0xffff; 68 graphic[0].cmap[i].green = 0xffff; 69 SETVALUE (graphic[0].cmap[i].blue, 2*i*scale - blueRef, 0, 0xffff); 63 70 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 64 71 } … … 66 73 } 67 74 /* rainbow */ 68 if (!strcmp (name, "Rainbow")) { 75 if (!strcasecmp (name, "Rainbow")) { 76 redRef = 0.25*graphic[0].Npixels*scale*4.0; 77 greenRef = 0.50*graphic[0].Npixels*scale*4.0; 78 blueRef = 0.50*graphic[0].Npixels*scale*4.0; 69 79 for (i = 0; i < (int)(0.25*graphic[0].Npixels); i++) { 70 graphic[0].cmap[i].red = 0;80 graphic[0].cmap[i].red = 0; 71 81 graphic[0].cmap[i].green = 0; 72 graphic[0].cmap[i].blue = 256*(255*4*(i/(1.0*graphic[0].Npixels)));82 SETVALUE (graphic[0].cmap[i].blue, 4*i*scale, 0, 0xffff); 73 83 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 74 84 } 75 85 for (i = (int)(0.25*graphic[0].Npixels); i < (int)(0.50*graphic[0].Npixels); i++) { 76 graphic[0].cmap[i].red = 256*(255*4*((i/(1.0*graphic[0].Npixels)) - 0.25));86 SETVALUE (graphic[0].cmap[i].red, 4*i*scale - redRef, 0, 0xffff); 77 87 graphic[0].cmap[i].green = 0; 78 graphic[0].cmap[i].blue = 256*(255*4*(0.50 - (i/(1.0*graphic[0].Npixels))));88 SETVALUE (graphic[0].cmap[i].blue, blueRef - 4*i*scale, 0, 0xffff); 79 89 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 80 90 } 81 91 for (i = (int)(0.50*graphic[0].Npixels); i < (int)(0.75*graphic[0].Npixels); i++) { 82 graphic[0].cmap[i].red = 256*255;83 graphic[0].cmap[i].green = 256*(255*4*((i/(1.0*graphic[0].Npixels)) - 0.50));92 graphic[0].cmap[i].red = 0xffff; 93 SETVALUE (graphic[0].cmap[i].green, 4*i*scale - greenRef, 0, 0xffff); 84 94 graphic[0].cmap[i].blue = 0; 85 95 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 86 96 } 97 blueRef = 0.75*graphic[0].Npixels*scale*4.0; 87 98 for (i = (int)(0.75*graphic[0].Npixels); i < graphic[0].Npixels; i++) { 88 graphic[0].cmap[i].red = 256*255;89 graphic[0].cmap[i].green = 256*255;90 graphic[0].cmap[i].blue = 256*(255*4*((i/(1.0*graphic[0].Npixels)) - 0.75));99 graphic[0].cmap[i].red = 0xffff; 100 graphic[0].cmap[i].green = 0xffff; 101 SETVALUE (graphic[0].cmap[i].blue, 4*i*scale - blueRef, 0, 0xffff); 91 102 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 92 103 } -
branches/eam_branch_20071222/Ohana/src/kapa2/src/SetImageData.c
r14590 r15925 11 11 section = GetActiveSection(); 12 12 if (section->image == NULL) { 13 section->image = InitImage ();13 section->image = InitImageWidget (); 14 14 SetSectionSizes (section); 15 15 } … … 18 18 // get image data from client 19 19 KiiScanMessage (sock, "%lf %lf %s", 20 &image[0]. zero,21 &image[0]. range,22 image[0]. name,23 image[0]. file);20 &image[0].image[0].zero, 21 &image[0].image[0].range, 22 image[0].image[0].name, 23 image[0].image[0].file); 24 24 25 25 // XXX when we go to 32bit, this should remap the image … … 37 37 section = GetActiveSection(); 38 38 if (section->image == NULL) { 39 section->image = InitImage ();39 section->image = InitImageWidget (); 40 40 SetSectionSizes (section); 41 41 } … … 43 43 44 44 KiiSendMessage (sock, "%g %g %s %s", 45 image[0]. zero,46 image[0]. range,47 image[0]. name,48 image[0]. file);45 image[0].image[0].zero, 46 image[0].image[0].range, 47 image[0].image[0].name, 48 image[0].image[0].file); 49 49 50 50 return (TRUE); … … 61 61 section = GetActiveSection(); 62 62 if (section->image == NULL) { 63 section->image = InitImage ();63 section->image = InitImageWidget (); 64 64 SetSectionSizes (section); 65 65 } … … 67 67 68 68 KiiScanMessage (sock, "%f %f %f %f", 69 &image[0]. coords.pc1_1, &image[0].coords.pc2_2,70 &image[0]. coords.pc1_2, &image[0].coords.pc2_1);69 &image[0].image[0].coords.pc1_1, &image[0].image[0].coords.pc2_2, 70 &image[0].image[0].coords.pc1_2, &image[0].image[0].coords.pc2_1); 71 71 72 KiiScanMessage (sock, "%s", image[0]. coords.ctype);72 KiiScanMessage (sock, "%s", image[0].image[0].coords.ctype); 73 73 74 74 KiiScanMessage (sock, "%lf %lf %f %f %f %f", 75 &image[0]. coords.crval1,76 &image[0]. coords.crval2,77 &image[0]. coords.crpix1,78 &image[0]. coords.crpix2,79 &image[0]. coords.cdelt1,80 &image[0]. coords.cdelt2);75 &image[0].image[0].coords.crval1, 76 &image[0].image[0].coords.crval2, 77 &image[0].image[0].coords.crpix1, 78 &image[0].image[0].coords.crpix2, 79 &image[0].image[0].coords.cdelt1, 80 &image[0].image[0].coords.cdelt2); 81 81 82 82 return (TRUE); … … 90 90 section = GetActiveSection(); 91 91 if (section->image == NULL) { 92 section->image = InitImage ();92 section->image = InitImageWidget (); 93 93 SetSectionSizes (section); 94 94 } … … 96 96 97 97 KiiSendMessage (sock, "%g %g %g %g", 98 image[0]. coords.pc1_1,image[0].coords.pc2_2,99 image[0]. coords.pc1_2,image[0].coords.pc2_1);98 image[0].image[0].coords.pc1_1, image[0].image[0].coords.pc2_2, 99 image[0].image[0].coords.pc1_2, image[0].image[0].coords.pc2_1); 100 100 101 KiiSendMessage (sock, "%s", image[0]. coords.ctype);101 KiiSendMessage (sock, "%s", image[0].image[0].coords.ctype); 102 102 103 103 KiiSendMessage (sock, "%g %g %g %g %g %g", 104 image[0]. coords.crval1,105 image[0]. coords.crval2,106 image[0]. coords.crpix1,107 image[0]. coords.crpix2,108 image[0]. coords.cdelt1,109 image[0]. coords.cdelt2);104 image[0].image[0].coords.crval1, 105 image[0].image[0].coords.crval2, 106 image[0].image[0].coords.crpix1, 107 image[0].image[0].coords.crpix2, 108 image[0].image[0].coords.cdelt1, 109 image[0].image[0].coords.cdelt2); 110 110 111 111 return (TRUE); … … 120 120 section = GetActiveSection(); 121 121 if (section->image == NULL) { 122 section->image = InitImage ();122 section->image = InitImageWidget (); 123 123 SetSectionSizes (section); 124 124 } -
branches/eam_branch_20071222/Ohana/src/kapa2/src/SetImageSize.c
r14590 r15925 40 40 } 41 41 if (USE_XWINDOW) CreatePicture (image, graphic); 42 Remap (graphic, image , &image[0].matrix);42 Remap (graphic, image); 43 43 return; 44 44 … … 104 104 image[0].rainbow_button.y = image[0].PS_button.y; 105 105 106 image[0]. puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;107 image[0]. puns_button.y = image[0].PS_button.y;108 109 image[0].recenter_button.x = image[0]. puns_button.x + image[0].puns_button.dx + PAD1;106 image[0].heat_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1; 107 image[0].heat_button.y = image[0].PS_button.y; 108 109 image[0].recenter_button.x = image[0].heat_button.x + image[0].heat_button.dx + PAD1; 110 110 image[0].recenter_button.y = image[0].PS_button.y; 111 111 break; … … 172 172 image[0].rainbow_button.y = image[0].PS_button.y; 173 173 174 image[0]. puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;175 image[0]. puns_button.y = image[0].PS_button.y;176 177 image[0].recenter_button.x = image[0]. puns_button.x + image[0].puns_button.dx + PAD1;174 image[0].heat_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1; 175 image[0].heat_button.y = image[0].PS_button.y; 176 177 image[0].recenter_button.x = image[0].heat_button.x + image[0].heat_button.dx + PAD1; 178 178 image[0].recenter_button.y = image[0].PS_button.y; 179 179 break; … … 238 238 image[0].rainbow_button.y = image[0].PS_button.y; 239 239 240 image[0]. puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;241 image[0]. puns_button.y = image[0].PS_button.y;242 243 image[0].recenter_button.x = image[0]. puns_button.x + image[0].puns_button.dx + PAD1;240 image[0].heat_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1; 241 image[0].heat_button.y = image[0].PS_button.y; 242 243 image[0].recenter_button.x = image[0].heat_button.x + image[0].heat_button.dx + PAD1; 244 244 image[0].recenter_button.y = image[0].PS_button.y; 245 245 break; … … 304 304 image[0].rainbow_button.y = image[0].PS_button.y; 305 305 306 image[0]. puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;307 image[0]. puns_button.y = image[0].PS_button.y;308 309 image[0].recenter_button.x = image[0]. puns_button.x + image[0].puns_button.dx + PAD1;306 image[0].heat_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1; 307 image[0].heat_button.y = image[0].PS_button.y; 308 309 image[0].recenter_button.x = image[0].heat_button.x + image[0].heat_button.dx + PAD1; 310 310 image[0].recenter_button.y = image[0].PS_button.y; 311 311 break; … … 321 321 CreateZoom (image, graphic, 0, 0); 322 322 } 323 Remap (graphic, image , &image[0].matrix);323 Remap (graphic, image); 324 324 325 325 return; -
branches/eam_branch_20071222/Ohana/src/kapa2/src/SetToolbox.c
r13479 r15925 17 17 section = GetActiveSection(); 18 18 if (section->image == NULL) { 19 section->image = InitImage ();19 section->image = InitImageWidget (); 20 20 } 21 21 section->image->location = location; … … 24 24 if (!USE_XWINDOW) return; 25 25 26 Remap (graphic, section->image , §ion->image->matrix);26 Remap (graphic, section->image); 27 27 if (DEBUG) fprintf (stderr, "remapped image\n"); 28 28 Refresh (); -
branches/eam_branch_20071222/Ohana/src/kapa2/src/StatusBox.c
r13320 r15925 6 6 7 7 if (image[0].MovePointer) { 8 x = 0.5*image[0]. matrix.Naxis[0];9 y = 0.5*image[0]. matrix.Naxis[1];8 x = 0.5*image[0].image[0].matrix.Naxis[0]; 9 y = 0.5*image[0].image[0].matrix.Naxis[1]; 10 10 z = -1; 11 11 image[0].x = x; -
branches/eam_branch_20071222/Ohana/src/kapa2/src/UpdatePointer.c
r13479 r15925 19 19 if (image[0].MovePointer && InPicture ((XButtonEvent *)event, &image[0].picture)) { 20 20 21 data = (float *) image[0]. matrix.buffer;21 data = (float *) image[0].image[0].matrix.buffer; 22 22 Screen_to_Image (&x, &y, (double)event[0].x, (double)event[0].y, image); 23 23 24 24 z = -1; 25 25 if (x < 0) goto skip; 26 if (x >= image[0]. matrix.Naxis[0]) goto skip;26 if (x >= image[0].image[0].matrix.Naxis[0]) goto skip; 27 27 if (y < 0) goto skip; 28 if (y >= image[0]. matrix.Naxis[1]) goto skip;29 z = data[(int)(y)*image[0]. matrix.Naxis[0] + (int)(x)];28 if (y >= image[0].image[0].matrix.Naxis[1]) goto skip; 29 z = data[(int)(y)*image[0].image[0].matrix.Naxis[0] + (int)(x)]; 30 30 31 31 skip: … … 47 47 48 48 if (InPicture ((XButtonEvent *)event, &image[0].cmapbar)) { 49 z = image[0]. zero +image[0].range * (event[0].x - image[0].cmapbar.x) / image[0].cmapbar.dx;49 z = image[0].image[0].zero + image[0].image[0].range * (event[0].x - image[0].cmapbar.x) / image[0].cmapbar.dx; 50 50 textpad = graphic[0].font[0].ascent; 51 51 XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back); -
branches/eam_branch_20071222/Ohana/src/kapa2/src/UpdateStatusBox.c
r14498 r15925 7 7 char line[100]; 8 8 9 XY_to_RD (&ra, &dec, x, y, &image[0]. coords);9 XY_to_RD (&ra, &dec, x, y, &image[0].image[0].coords); 10 10 11 11 textpad = graphic[0].font[0].ascent; … … 26 26 27 27 bzero (line, 100); 28 sprintf (line, "%-25s", image[0]. file);28 sprintf (line, "%-25s", image[0].image[0].file); 29 29 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 30 30 image[0].text_x + PAD1, image[0].text_y + 5*textpad + 5*PAD1, line, strlen(line)); 31 31 32 32 bzero (line, 100); 33 sprintf (line, "(%s) ", image[0]. name);33 sprintf (line, "(%s) ", image[0].image[0].name); 34 34 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 35 35 image[0].text_x + PAD1, image[0].text_y + 6*textpad + 6*PAD1, line, 25);
Note:
See TracChangeset
for help on using the changeset viewer.
