Changeset 32660
- Timestamp:
- Nov 12, 2011, 1:55:19 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20111110/Ohana/src/kapa2
- Files:
-
- 5 edited
-
include/structures.h (modified) (1 diff)
-
src/Sections.c (modified) (1 diff)
-
src/SetUpGraphic.c (modified) (1 diff)
-
src/bDrawImage.c (modified) (2 diffs)
-
src/bDrawIt.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111110/Ohana/src/kapa2/include/structures.h
r29938 r32660 26 26 XFontStruct *font; 27 27 Cursor cursor; 28 int x, y; 29 unsigned int dx, dy; 28 int x, y; // corner coord in X world coords 29 unsigned int dx, dy; // size of window in X coords 30 int xwin, ywin; // corner coord of display subregion (eg, png, ps plot) 31 int dxwin, dywin; // corner coord of display subregion (eg, png, ps plot) 30 32 CCNode *cube; 31 33 XColor *cmap; -
branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/Sections.c
r27790 r32660 237 237 return (TRUE); 238 238 } 239 240 int SectionMinBoundary (Graphic *graphic) { 241 242 int Xs = graphic->dx; 243 int Ys = graphic->dy; 244 int Xe = 0; 245 int Ye = 0; 246 247 // the boundary for a single section should probably be adjusted depending on the 248 // image status (should not include the imtool portion) 249 for (i = 0; i < Nsections; i++) { 250 Xs = PS_MIN (Xs, sections[i][0].x); 251 Ys = PS_MIN (Ys, sections[i][0].y); 252 Xe = PS_MAX (Xe, sections[i][0].x + sections[i][0].dx); 253 Ye = PS_MAX (Ye, sections[i][0].y + sections[i][0].dy); 254 } 255 256 if ((Xs >= Xe) || (Ys >- Ye)) { 257 // default values for the region window 258 graphic->xwin = 0; 259 graphic->ywin = 0; 260 graphic->dxwin = graphic->dx; 261 graphic->dywin = graphic->dy; 262 } 263 264 // set min/max boundary (min window containing max range of sections) 265 graphic->xwin = Xs; 266 graphic->ywin = Ys; 267 graphic->dxwin = Xe - Xs; 268 graphic->dywin = Ye - Ys; 269 return TRUE; 270 } -
branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/SetUpGraphic.c
r25757 r32660 16 16 graphic->dx = 512; 17 17 graphic->dy = 512; 18 19 // default values for the region window 20 graphic->xwin = 0; 21 graphic->ywin = 0; 22 graphic->dxwin = graphic->dx; 23 graphic->dywin = graphic->dy; 18 24 19 25 if (!USE_XWINDOW) { -
branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/bDrawImage.c
r29938 r32660 47 47 } 48 48 49 Xs = image[0].picture.x; 50 Ys = image[0].picture.y; 49 // Xs,Ys are in full-frame coords. can we trim here? 50 Xs = image[0].picture.x - graphic[0].xwin; 51 Ys = image[0].picture.y - graphic[0].ywin; 51 52 dx = image[0].picture.dx; 52 53 dy = image[0].picture.dy; … … 54 55 DY = image[0].image[0].matrix.Naxis[1]; 55 56 57 // the created buffer is supposed to contain the output windows 56 58 if (buffer[0].Nx < Xs + dx) { 57 59 fprintf (stderr, "invalid condition\n"); -
branches/eam_branches/ipp-20111110/Ohana/src/kapa2/src/bDrawIt.c
r29938 r32660 13 13 black = KapaColorByName ("black"); 14 14 15 buffer = bDrawBufferCreate (graphic->dx, graphic->dy, Nbyte, palette, Npalette); 15 SectionMinBoundary (graphic); 16 17 // if we want to trim, we'll need to carry about the start in graphic coords and 18 // the dx,dy size. 19 buffer = bDrawBufferCreate (graphic->dxwin, graphic->dywin, Nbyte, palette, Npalette); 16 20 bDrawSetStyle (buffer, black, 0, 0); 17 21
Note:
See TracChangeset
for help on using the changeset viewer.
