Changeset 34088 for trunk/Ohana/src/kapa2
- Timestamp:
- Jun 26, 2012, 11:46:01 AM (14 years ago)
- Location:
- trunk/Ohana/src/kapa2/src
- Files:
-
- 17 edited
-
CheckVisual.c (modified) (4 diffs)
-
DrawFrame.c (modified) (5 diffs)
-
EraseOverlay.c (modified) (2 diffs)
-
JPEGit24.c (modified) (4 diffs)
-
Layout.c (modified) (2 diffs)
-
PSFrame.c (modified) (2 diffs)
-
PSPixmap.c (modified) (3 diffs)
-
PaintOverlay.c (modified) (2 diffs)
-
Remap16.c (modified) (3 diffs)
-
Remap24.c (modified) (3 diffs)
-
Remap32.c (modified) (3 diffs)
-
Remap8.c (modified) (3 diffs)
-
SetGraphSize.c (modified) (2 diffs)
-
SetImageData.c (modified) (2 diffs)
-
bDrawFrame.c (modified) (2 diffs)
-
bDrawImage.c (modified) (4 diffs)
-
bDrawOverlay.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa2/src/CheckVisual.c
r25757 r34088 10 10 11 11 int i, Nfound, N; 12 int is Color, isDefault;12 int isDefault; 13 13 XVisualInfo *visual_list, visual_temp; 14 14 unsigned long planes[3]; … … 35 35 36 36 // set these based on selected visual 37 is Color = isDefault = FALSE;37 isDefault = FALSE; 38 38 39 39 // attempt to select the most desirable type of visual: TrueColor 40 40 for (i = 0; (i < Nfound) && (visual_list[i].class != TrueColor); i++); 41 41 if (i != Nfound) { 42 isColor = TRUE;42 // isColor = TRUE; 43 43 if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class); 44 44 isDefault = (graphic[0].visual == visual_list[i].visual); … … 52 52 for (i = 0; (i < Nfound) && (visual_list[i].class != DirectColor); i++); 53 53 if (i != Nfound) { 54 isColor = TRUE;54 // isColor = TRUE; 55 55 if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class); 56 56 isDefault = (graphic[0].visual == visual_list[i].visual); … … 64 64 for (i = 0; (i < Nfound) && (visual_list[i].class != PseudoColor); i++); 65 65 if (i != Nfound) { 66 isColor = TRUE;66 // isColor = TRUE; 67 67 if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class); 68 68 isDefault = (graphic[0].visual == visual_list[i].visual); -
trunk/Ohana/src/kapa2/src/DrawFrame.c
r32632 r34088 91 91 int pos, dir, fontsize; 92 92 double size, n, pad; 93 char string[64] , *fontname;93 char string[64]; 94 94 95 95 double fx = axis->fx; … … 130 130 int xt, yt; 131 131 132 fontname = GetRotFont (&fontsize); 132 // char *fontname is returned by GetRotFont, but not used here 133 GetRotFont (&fontsize); 133 134 134 135 pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : fontsize + 4.0; … … 231 232 232 233 TickMarkData *ticks; 233 double range, major, minor, first, value , dPixels, overshoot;234 int i, NTICKS, nPixels,done, ifirst, nsignif;234 double range, major, minor, first, value; 235 int i, NTICKS, done, ifirst, nsignif; 235 236 236 237 *nticks = 0; … … 249 250 250 251 // length of the axis in pixels 251 nPixels = hypot(axis->dfx, axis->dfy);252 dPixels = nPixels / range; // axis pixel-scale252 // int nPixels = hypot(axis->dfx, axis->dfy); 253 // double dPixels = nPixels / range; // axis pixel-scale 253 254 254 255 AxisTickScale (axis, &major, &minor, &nsignif); … … 263 264 264 265 // allow undershoot by 1 pixel 265 overshoot = (axis->min - first) * dPixels;266 // double overshoot = (axis->min - first) * dPixels; 266 267 // if (overshoot > 0.5) { 267 268 // if (range > 0) { -
trunk/Ohana/src/kapa2/src/EraseOverlay.c
r26891 r34088 4 4 5 5 int i, N; 6 Graphic *graphic;7 6 Section *section; 8 7 KapaImageWidget *image; … … 11 10 KiiScanCommand (sock, 16, "%*s %d", &N); 12 11 13 graphic = GetGraphic();14 12 section = GetActiveSection(); 15 13 image = section->image; -
trunk/Ohana/src/kapa2/src/JPEGit24.c
r29938 r34088 33 33 int i_start, i_end, j_start, j_end; 34 34 int I_start, J_start; 35 int dropback; /* this is a bit of a kludge... */ 36 int dx, dy, DX, DY, inDX, inDY; 35 int dx, dy, DX, inDX, inDY; 37 36 int quality; 38 37 int expand_in, expand_out; 39 double expand,Ix, Iy;38 double Ix, Iy; 40 39 unsigned char *out_pix; 41 40 unsigned short *in_pix, *in_pix_ref; … … 85 84 86 85 assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2)); 87 expand = expand_in = expand_out = 1.0;86 expand_in = expand_out = 1.0; 88 87 if (image[0].picture.expand > 0) { 89 expand = 1 / (1.0*image[0].picture.expand);90 88 expand_out = image[0].picture.expand; 91 89 expand_in = 1; 92 90 } 93 91 if (image[0].picture.expand < 0) { 94 expand = fabs((double)image[0].picture.expand);95 92 expand_out = 1; 96 93 expand_in = -image[0].picture.expand; … … 100 97 dy = image[0].picture.dy; 101 98 DX = image[0].image[0].matrix.Naxis[0]; 102 DY = image[0].image[0].matrix.Naxis[1];99 // DY = image[0].image[0].matrix.Naxis[1]; 103 100 104 101 // i_start, j_start are the closest lit screen pixel to 0,0 … … 118 115 inDX = image[0].picture.flipx ? -1 : +1; 119 116 inDY = image[0].picture.flipy ? -1 : +1; 120 121 dropback = expand_out - (i_end - i_start) % expand_out;122 if ((i_end - i_start) % expand_out == 0) dropback = 0;123 117 124 118 /* output line buffer */ -
trunk/Ohana/src/kapa2/src/Layout.c
r27790 r34088 5 5 6 6 int N; 7 Section *section;8 7 char *namedSocket = NULL; 9 8 … … 43 42 44 43 /* create basic section, empty of image or graph */ 45 section = AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1); 44 // Section *section is returned by not used 45 AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1); 46 46 } -
trunk/Ohana/src/kapa2/src/PSFrame.c
r29955 r34088 57 57 int pos, dir, fontsize; 58 58 double size, n, pad; 59 char string[64] , *fontname;59 char string[64]; 60 60 61 61 double fx = axis->fx; … … 90 90 int xt, yt; 91 91 92 fontname = GetRotFont (&fontsize); 92 // char *fontname is returned by not needed 93 GetRotFont (&fontsize); 93 94 94 95 pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : 0.8*fontsize + 1.0; -
trunk/Ohana/src/kapa2/src/PSPixmap.c
r32695 r34088 153 153 int i_start, i_end, j_start, j_end; 154 154 int I_start, J_start; 155 int dropback; /* this is a bit of a kludge... */ 156 int dx, dy, DX, DY, inDX, inDY, Xs, Ys; 155 int dx, dy, DX, inDX, inDY; 157 156 int expand_in, expand_out; 158 double expand,Ix, Iy;157 double Ix, Iy; 159 158 unsigned short *in_pix, *in_pix_ref; 160 159 unsigned char *pixel1, *pixel2, *pixel3; … … 174 173 175 174 assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2)); 176 expand = expand_in = expand_out = 1.0;175 expand_in = expand_out = 1.0; 177 176 if (image[0].picture.expand > 0) { 178 expand = 1 / (1.0*image[0].picture.expand);179 177 expand_out = image[0].picture.expand; 180 178 expand_in = 1; 181 179 } 182 180 if (image[0].picture.expand < 0) { 183 expand = fabs((double)image[0].picture.expand);184 181 expand_out = 1; 185 182 expand_in = -image[0].picture.expand; 186 183 } 187 184 188 Xs = image[0].picture.x;189 Ys = image[0].picture.y;190 185 dx = image[0].picture.dx; 191 186 dy = image[0].picture.dy; 192 187 DX = image[0].image[0].matrix.Naxis[0]; 193 DY = image[0].image[0].matrix.Naxis[1];194 188 195 189 // i_start, j_start are the closest lit screen pixel to 0,0 … … 209 203 inDX = image[0].picture.flipx ? -1 : +1; 210 204 inDY = image[0].picture.flipy ? -1 : +1; 211 212 dropback = expand_out - (i_end - i_start) % expand_out;213 if ((i_end - i_start) % expand_out == 0) dropback = 0;214 205 215 206 in_pix_ref = &image[0].pixmap[DX*(int)MAX(Iy,0) + (int)MAX(Ix,0)]; -
trunk/Ohana/src/kapa2/src/PaintOverlay.c
r25757 r34088 5 5 int i; 6 6 int dX, dY, dx, dy; 7 int Xmin, Ymin, Xmax, Ymax , Xrange, Yrange;7 int Xmin, Ymin, Xmax, Ymax; 8 8 double t, expand, X, Y, pX, pY; 9 9 … … 23 23 Xmax = image[0].picture.x + image[0].picture.dx; 24 24 Ymax = image[0].picture.y + image[0].picture.dy; 25 Xrange = image[0].picture.dx;26 Yrange = image[0].picture.dy;27 25 28 26 for (i = 0; i < image[0].overlay[N].Nobjects; i++) { -
trunk/Ohana/src/kapa2/src/Remap16.c
r25978 r34088 13 13 int I_start, J_start; 14 14 int dropback, inDX, inDY; 15 int dx, dy, DX , DY;16 double expand,Ix, Iy;15 int dx, dy, DX; 16 double Ix, Iy; 17 17 int expand_in, expand_out; 18 18 OUT_TYPE *out_pix, *out_pix2, *data; … … 49 49 if (picture[0].expand == -1) picture[0].expand = 1; 50 50 assert ((picture[0].expand >= 1) || (picture[0].expand <= -2)); 51 expand = expand_in = expand_out = 1.0;51 expand_in = expand_out = 1.0; 52 52 if (picture[0].expand > 0) { 53 expand = 1 / (1.0*picture[0].expand);54 53 expand_out = picture[0].expand; 55 54 expand_in = 1; 56 55 } 57 56 if (picture[0].expand < 0) { 58 expand = fabs((double)picture[0].expand);59 57 expand_out = 1; 60 58 expand_in = -picture[0].expand; … … 65 63 dy = picture[0].dy; 66 64 DX = matrix[0].Naxis[0]; 67 DY = matrix[0].Naxis[1];65 // int DY = matrix[0].Naxis[1]; 68 66 69 67 // i_start, j_start are the closest lit screen pixel to 0,0 -
trunk/Ohana/src/kapa2/src/Remap24.c
r25978 r34088 7 7 int I_start, J_start; 8 8 int dropback, extra, inDX, inDY; 9 int dx, dy, DX , DY;10 double expand,Ix, Iy;9 int dx, dy, DX; 10 double Ix, Iy; 11 11 int expand_in, expand_out; 12 12 unsigned char *out_pix, *out_pix2, *data; … … 33 33 if (picture[0].expand == -1) picture[0].expand = 1; 34 34 assert ((picture[0].expand >= 1) || (picture[0].expand <= -2)); 35 expand = expand_in = expand_out = 1.0;35 expand_in = expand_out = 1.0; 36 36 if (picture[0].expand == 0) /* set up expansions */ 37 37 picture[0].expand = 1; 38 38 if (picture[0].expand > 0) { 39 expand = 1 / (1.0*picture[0].expand);40 39 expand_out = picture[0].expand; 41 40 expand_in = 1; 42 41 } 43 42 if (picture[0].expand < 0) { 44 expand = fabs((double)picture[0].expand);45 43 expand_out = 1; 46 44 expand_in = -picture[0].expand; … … 50 48 dy = picture[0].dy; 51 49 DX = matrix[0].Naxis[0]; 52 DY = matrix[0].Naxis[1];50 // int DY = matrix[0].Naxis[1]; 53 51 54 52 // each row is padded to a 4-byte word -
trunk/Ohana/src/kapa2/src/Remap32.c
r25978 r34088 16 16 int I_start, J_start; 17 17 int dropback, inDX, inDY; 18 int dx, dy, DX , DY;19 double expand,Ix, Iy;18 int dx, dy, DX; 19 double Ix, Iy; 20 20 int expand_in, expand_out; 21 21 OUT_TYPE *out_pix, *out_pix2, *data; … … 52 52 if (picture[0].expand == -1) picture[0].expand = 1; 53 53 assert ((picture[0].expand >= 1) || (picture[0].expand <= -2)); 54 expand = expand_in = expand_out = 1.0;54 expand_in = expand_out = 1.0; 55 55 if (picture[0].expand > 0) { 56 expand = 1 / (1.0*picture[0].expand);57 56 expand_out = picture[0].expand; 58 57 expand_in = 1; 59 58 } 60 59 if (picture[0].expand < 0) { 61 expand = fabs((double)picture[0].expand);62 60 expand_out = 1; 63 61 expand_in = -picture[0].expand; … … 68 66 dy = picture[0].dy; 69 67 DX = matrix[0].Naxis[0]; 70 DY = matrix[0].Naxis[1];68 // int DY = matrix[0].Naxis[1]; 71 69 72 70 // i_start, j_start are the closest lit screen pixel to 0,0 -
trunk/Ohana/src/kapa2/src/Remap8.c
r25978 r34088 8 8 int I_start, J_start; 9 9 int dropback, inDX, inDY; 10 int dx, dy, DX , DY;11 double expand,Ix, Iy;10 int dx, dy, DX; 11 double Ix, Iy; 12 12 int expand_in, expand_out; 13 13 OUT_TYPE *out_pix, *out_pix2, *data; … … 32 32 if (picture[0].expand == -1) picture[0].expand = 1; 33 33 assert ((picture[0].expand >= 1) || (picture[0].expand <= -2)); 34 expand = expand_in = expand_out = 1.0;34 expand_in = expand_out = 1.0; 35 35 if (picture[0].expand == 0) /* set up expansions */ 36 36 picture[0].expand = 1; 37 37 if (picture[0].expand > 0) { 38 expand = 1 / (1.0*picture[0].expand);39 38 expand_out = picture[0].expand; 40 39 expand_in = 1; 41 40 } 42 41 if (picture[0].expand < 0) { 43 expand = fabs((double)picture[0].expand);44 42 expand_out = 1; 45 43 expand_in = -picture[0].expand; … … 50 48 dy = picture[0].dy; 51 49 DX = matrix[0].Naxis[0]; 52 DY = matrix[0].Naxis[1];50 // int DY = matrix[0].Naxis[1]; 53 51 54 52 // i_start, j_start are the closest lit screen pixel to 0,0 -
trunk/Ohana/src/kapa2/src/SetGraphSize.c
r29938 r34088 77 77 double minPADx, maxPADx, minPADy; 78 78 double minPAD, maxPAD; 79 char string[64] , *fontname;79 char string[64]; 80 80 KapaGraphWidget *graph; 81 81 Graphic *graphic; … … 97 97 98 98 graphic = GetGraphic (); 99 fontname = GetRotFont (&fontsize); 99 // char *fontname; 100 GetRotFont (&fontsize); 100 101 101 102 minPAD = 1.0*fontsize + 0; -
trunk/Ohana/src/kapa2/src/SetImageData.c
r31160 r34088 3 3 int SetImageData (int sock) { 4 4 5 Graphic *graphic;6 5 Section *section; 7 6 KapaImageWidget *image; 8 7 9 graphic = GetGraphic(); 8 // XXX needed for XClearWindow below 9 // Graphic *graphic = GetGraphic(); 10 10 11 11 section = GetActiveSection(); … … 53 53 int SetImageCoords (int sock) { 54 54 55 Graphic *graphic;56 55 Section *section; 57 56 KapaImageWidget *image; 58 59 graphic = GetGraphic();60 57 61 58 section = GetActiveSection(); -
trunk/Ohana/src/kapa2/src/bDrawFrame.c
r29955 r34088 60 60 int pos, dir, fontsize; 61 61 double size, n, pad; 62 char string[64] , *fontname;62 char string[64]; 63 63 64 64 double fx = axis->fx; … … 93 93 int xt, yt; 94 94 95 fontname = GetRotFont (&fontsize); 95 // char *fontname is returned but ignored 96 GetRotFont (&fontsize); 96 97 97 98 pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : 0.8*fontsize + 1.0; -
trunk/Ohana/src/kapa2/src/bDrawImage.c
r32695 r34088 11 11 int i_start, i_end, j_start, j_end; 12 12 int I_start, J_start; 13 int dropback; /* this is a bit of a kludge... */14 int dx, dy, DX, DY,inDX, inDY, Xs, Ys;13 // int dropback; /* this is a bit of a kludge... */ 14 int dx, dy, DX, inDX, inDY, Xs, Ys; 15 15 int expand_in, expand_out; 16 double expand,Ix, Iy;16 double Ix, Iy; 17 17 unsigned char *out_pix; 18 18 unsigned short *in_pix, *in_pix_ref; … … 35 35 36 36 assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2)); 37 expand = expand_in = expand_out = 1.0;37 expand_in = expand_out = 1.0; 38 38 if (image[0].picture.expand > 0) { 39 expand = 1 / (1.0*image[0].picture.expand);40 39 expand_out = image[0].picture.expand; 41 40 expand_in = 1; 42 41 } 43 42 if (image[0].picture.expand < 0) { 44 expand = fabs((double)image[0].picture.expand);45 43 expand_out = 1; 46 44 expand_in = -image[0].picture.expand; … … 53 51 dy = image[0].picture.dy; 54 52 DX = image[0].image[0].matrix.Naxis[0]; 55 DY = image[0].image[0].matrix.Naxis[1];53 // int DY = image[0].image[0].matrix.Naxis[1]; 56 54 57 55 // the created buffer is supposed to contain the output windows … … 82 80 inDY = image[0].picture.flipy ? -1 : +1; 83 81 84 dropback = expand_out - (i_end - i_start) % expand_out;85 if ((i_end - i_start) % expand_out == 0) dropback = 0;82 // dropback = expand_out - (i_end - i_start) % expand_out; 83 // if ((i_end - i_start) % expand_out == 0) dropback = 0; 86 84 87 85 ALLOCATE (line_buffer, bDrawColor, 3*dx); -
trunk/Ohana/src/kapa2/src/bDrawOverlay.c
r29938 r34088 8 8 int i; 9 9 int dx, dy; 10 int Xmin, Ymin, Xmax, Ymax , Xrange, Yrange;10 int Xmin, Ymin, Xmax, Ymax; 11 11 double expand, X, Y, dX, dY, pX, pY; 12 12 bDrawColor color; … … 28 28 Xmax = image[0].picture.dx; 29 29 Ymax = image[0].picture.dy; 30 Xrange = image[0].picture.dx;31 Yrange = image[0].picture.dy;32 30 33 31 if (N == INFRONT) {
Note:
See TracChangeset
for help on using the changeset viewer.
