|
|
1.1 ! root 1: ! 2: /* ! 3: * ! 4: * A few definitions and macros used by routines that rotate glyphs. ! 5: * ! 6: * Although the Imprint-10 System Manual seems to imply that downloaded ! 7: * glyphs can be rotated if desired, version 1.8 only appears to use the ! 8: * rotation bits to locate glyphs that the user claims can be used in a ! 9: * rotated coordinate system. In otherwords it appears that we're either ! 10: * going to have to use raster tables that have already been rotated or ! 11: * do all the required rotations and coordinate mappings at run time. ! 12: * ! 13: */ ! 14: ! 15: ! 16: #include "impcodes.h" /* just needed for ROT_COUNT */ ! 17: ! 18: ! 19: /* ! 20: * ! 21: * The obvious functions, for the defined rotation angles, used in the ! 22: * in the coordinate transformation macros given below. Arrays are defined ! 23: * in rotate.c. ! 24: * ! 25: */ ! 26: ! 27: ! 28: #define COSINE(A) cosine[A] ! 29: #define SINE(A) sine[A] ! 30: #define DELTA(A) delta[A] ! 31: ! 32: ! 33: /* ! 34: * ! 35: * A few macros used to do the rotation and translation of the bitmaps and ! 36: * the other important glyph parameters. ! 37: * ! 38: */ ! 39: ! 40: ! 41: #define ROTX(X, Y, A) /* x in rotated coordinate system */ \ ! 42: \ ! 43: (X) * COSINE((A) % ROT_COUNT) - (Y) * SINE((A) % ROT_COUNT) ! 44: ! 45: ! 46: #define ROTY(X, Y, A) /* y in rotated coordinate system */ \ ! 47: \ ! 48: (X) * SINE((A) % ROT_COUNT) + (Y) * COSINE((A) % ROT_COUNT) ! 49: ! 50: ! 51: #define TRANSX(H, W, A) /* new x after bitmap translation */ \ ! 52: \ ! 53: (H-1) * DELTA(((A)-ROT_90)%ROT_COUNT) + (W-1) * DELTA(((A)-ROT_180)%ROT_COUNT) ! 54: ! 55: ! 56: #define TRANSY(H, W, A) /* y after bitmap translation */ \ ! 57: \ ! 58: (H-1) * DELTA(((A)-ROT_180)%ROT_COUNT) + (W-1) * DELTA(((A)-ROT_270)%ROT_COUNT) ! 59: ! 60: ! 61: #define NEWX(X, Y, H, W, A) /* x after rotation and translation */ \ ! 62: \ ! 63: ROTX(X, Y, A) + TRANSX(H, W, A) ! 64: ! 65: ! 66: #define NEWY(X, Y, H, W, A) /* y after rotation and translation */ \ ! 67: \ ! 68: ROTY(X, Y, A) + TRANSY(H, W, A) ! 69: ! 70: ! 71: ! 72: /* ! 73: * ! 74: * sine, cosine, and delta are integer arrays declared in rotate.c. Anyone ! 75: * trying to use to coordinate transformation macros will need to know about ! 76: * them and include rotate.c in their program. ! 77: * ! 78: */ ! 79: ! 80: ! 81: extern int cosine[]; ! 82: extern int sine[]; ! 83: extern int delta[]; ! 84:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.