Imagemask – AMT Datasouth PAL User Manual
Page 123

117
imagemask
The PAL raster format requires the programmer to group the bits for the above image into bytes, as
follows.
Bit 7
6
5
4
3
2
1
0
Byte 0
00 01 02 03 04 05 06 07
Byte 1
08 09 10 11 12 13 14 15
Byte 2
16 17 18 19 20 21 22 23
Byte 3
24 25 26 27 28 29 30 31
Byte 4
32 33 34 35 36 37 38 39
Byte 5
40 41 42 43 44 45 46 47
Byte 6
48 49 50 51 52 53 54 55
Byte 7
56 57 58 59 60 61 62 63
Byte 8
64 65 66 67 68 69 70 71
Byte 9
72 73 74 75 76 77 78 79
Byte 10
80 81 82 83 84 85 86 87
Byte 11
88 89 90 91 92 93 94 95
Byte 12
96 97 98 99 xx xx xx xx
Normally, the procedure specified for the imagemask operator will simply contain a single
hexadecimal string containing the raster image data. In the case of the above image, the entire
imagemask operation would appear as follows.
10 10 true [10 0 0 -10 0 10]
{<0C 0C C4 09 4A 80 64 94 C9 02 33 03 00>}
imagemask
Since a 10 by 10 pixel image only requires 100 bits of data, PAL ignores all bits returns by the
procedure following bit 99. Therefore, as shown by the "xx" bits in the byte table above, PAL will
ignore the last four bits of the last byte.
The imagemask operator always draws the raster image with the lower left corner of the image
positioned at the user coordinate system origin. The current point, as established by moveto and
other operators, has no effect upon the placement of an imagemask raster image. The program-
mer must use the translate operator to position the raster image on the page.
The scaling and rotation of the user coordinate system also affects the image. The interpreter ro-
tates and scales the image so that the image's lower left corner will appear at coordinate 0,0 and the
upper right corner will appear at coordinate 1,1. Therefore, the programmer can use the scale and
rotate operators to influence the final image.
Hints
The programmer should consider applying the desired translate, rotate, and scale operations
immediately before the imagemask operation. Then, immediately following the imagemask
operation, the programmer should reverse any necessary transformations.