|
|
1.1 root 1: .EQ
2: delim $$
3: .EN
4: .NH
5: Data Representation
6: .XS
7: Data Representation
8: .XE
9: .PP
10: .IN "Definitions" "Bitmap"
11: .IN "Definitions" "Pixmap"
12: A Bitmap is a single plane (bit) rectangle.
13: A Pixmap is a rectangle of pixels, and is therefore as ``deep'' as the
14: display.
15: For example, if your color display has four bits/pixel,
16: a Pixmap is a rectangle of four bit pixels.
17: In this implementation of the underlying protocol,
18: the depth of the display is limited to 16 bit planes.
19: .IN "Limitations" "Bits per Pixel"
20: The subroutine interface, however, is designed to support display hardware of
21: up to 32 bits per pixel.
22: The ``pixel value'' can range from 0 to $2 sup n$,
23: where \fIn\fP is the number of
24: bits per pixel.
25: .IN "Definitions" "Pixel values"
26: .IN "Definitions" "Cursors"
27: Cursors are used as mouse pointers and typically track the mouse; a
28: cursor is an arbitrary two-color shape with an arbitrary ``hot spot''.
29: .PP
30: .IN "Definitions" "Locator"
31: A Locator is
32: an absolute point on the screen, represented as <x,y> with the X-coordinate
33: in the most significant 16 bits and the Y-coordinate in the least significant
34: 16 bits.
35: .EQ
36: delim off
37: .EN
38: .PP
39: .IN "Definitions" "Bitmap"
40: A Bitmap is represented by ((width + 15) / 16) * height * 2 bytes of data.
41: Each row is stored starting on a word (16 bit) boundary, and is padded to
42: the right to a 16 bit boundary.
43: It is stored top line to bottom line in memory.
44: It has a size of (width x height) pixels.
45: .IN "Macro" "BitmapSize()"
46: The macro \fIBitmapSize(width,height)\fP can be used to compute the size in
47: bytes of the Bitmap.
48: .IN "Definitions" "Bit Order"
49: The
50: bits are in scanline order, with each scanline padded if necessary to a
51: multiple of 16 bits.
52: Within a scanline, the bits are represented left to
53: right, stored in 16-bit words.
54: The least significant bit of a word is the leftmost visible pixel on the
55: display.
56: Analysis showed that the bit reversal cpu time incurred on some
57: machine architectures was small relative to the
58: data transmission time,
59: so a fixed client bitmap representation was selected for portability's sake.
60: .PP
61: .IN "Definitions" "Pixmap"
62: .IN "Definitions" "XY-format"
63: .IN "Definitions" "Z-format"
64: A Pixmap can be represented in either `XY format' or `Z format'.
65: In XY format,
66: each plane is represented as a Bitmap, and the planes appear from most to least
67: significant bit order.
68: The total number of bytes is thus
69: ((width + 15) / 16) * height * 2 * depth.
70: .IN "Macro" "XYPixmapSize()"
71: The macro \fIXYPixmapSize(width, height, planes)\fP can be used to
72: compute the size in bytes of a Pixmap in XY format.
73: In Z format, the pixels are in
74: scanline order, left to right within a scanline.
75: For hardware with 2 to 8
76: planes, each pixel value is represented by a single byte;
77: the total number of bytes
78: is thus width * height.
79: For hardware with 9 to 16 planes, each pixel value is
80: represented by a 16-bit word; the total number of bytes is thus
81: 2 * width * height.
82: .IN "Macro" "BZPixmapSize()"
83: .IN "Macro" "WZPixmapSize()"
84: The macros \fIBZPixmapSize(width, height)\fP and
85: \fIWZPixmapSize(width, height)\fP
86: can be used to compute the size in bytes of a pixmap in Z format for
87: 2 to 8 bit planes and 9 to 16 bitplanes respectively.
88: .IN "Restrictions" "Z-format"
89: Z-format cannot be used on monochrome display hardware.
90: .PP
91: Background tiling uses Pixmaps to specify the
92: pattern.
93: Since you may want such patterns either relative to
94: .IN "Definitions" "Tile Mode"
95: the window or absolute, there is a concept of `tile mode' associated
96: with a window, allowing the pattern to be absolutely positioned to the window,
97: or relative to the parent window (often the root window).
98: This allows alignment of patterns either to the window you are working
99: in, or to the parent window.
100: Both are useful; icon windows often want relative alignment, while
101: normal windows usually want absolute alignment.
102: .PP
103: .IN "Macro" "BlackPixel"
104: .IN "Macro" "WhitePixel"
105: The pixel values \fIBlackPixel\fP and \fIWhitePixel\fP (0 and 1) are
106: .IN "File" "<X/X.h>
107: always defined on every display server, as defined in \fI<X/X.h>\fP.
108: These constants are intended for use in monochrome applications.
109: On color hardware, the colors of black and white may
110: be redefined by the user.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.