summaryrefslogtreecommitdiff
path: root/static/v10/man9/bitblt.9
blob: 28b4156c5573400b8cee239e4f04ded6ef03ee1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
.TH BITBLT 9.3
.CT 2 graphics
.SH NAME
Code, addr, bitblt, point, rectf, screenswap, segment, texture \- graphics functions
.SH SYNOPSIS
.B #include <jerq.h>
.PP
.B typedef int Code;
.br
.B "Code F_STORE, F_XOR, F_OR, F_CLR;
.PP
.B Word *addr(b, p)
.B "Bitmap *b; Point p;
.PP
.B void bitblt(sb, r, db, p, f)
.B "Bitmap *sb, *db; Rectangle r; Point p; Code f;
.PP
.B void point(b, p, f)
.B "Bitmap *b; Point p; Code f;
.PP
.B void rectf(b, r, f)
.B "Bitmap *b; Rectangle r; Code f;
.PP
.B void screenswap(b, r, s)
.B "Bitmap *b; Rectangle r, s;
.PP
.B void segment(b, p, q, f)
.B "Bitmap *b; Point p, q; Code f;
.PP
.B void texture(b, r, t, f)
.B "Bitmap *b; Rectangle r; Texture *t; Code f;
.SH DESCRIPTION
The type
.B Code
tells the graphics primitives what
operation perform.
The possible values are:
.nf
.IP
.de fx
\f5\&\\$1	\fI\\$2 \&\f5\\$3\fI \\$4
..
.ta \w'\f5F_STORE\ 'u +\w'\fItarget 'u +\w'\f5&=\fI 'u
.fx F_STORE target = source
.fx F_OR target |= source
.fx F_XOR target ^= source
.fx F_CLR target &= ~source
.fi
.DT
.PP
In other words, if a
Rectangle
is copied to another place with Code
.BR F_OR ,
the result will be the bitwise
OR of the contents of the source
Rectangle
and the target area.
For operations with no explicit source, such as line drawing,
the source is taken to be an infinite bitmap with zeros everywhere
except on the object (e.g. line) generated by the operator,
with coordinates aligned with the destination bitmap.
.B F_STORE
is the same as
.B F_OR
for non-rectangular operations.
.PP
.I Addr
returns the address of the Word containing the bit
at Point
.I p
in the Bitmap
.IR b .
.PP
.I Bitblt
(bit-block transfer)
copies the data in Rectangle
.I r
in Bitmap
.I sb
to the congruent Rectangle with
.I origin
.I p
in Bitmap
.IR db .
The nature of the copy is specified by the Code
.IR f .
.PP
.I Point
draws the pixel at location
.I p
in the Bitmap
.I b
according to
.I Code
.IR f .
.PP
.I Screenswap
does an in-place exchange of the on-screen Rectangle
.I s
and the Rectangle
.I r
within the Bitmap
.IR b .
Its action is undefined if
.I r
and
.I s
are not congruent.
The Rectangle
.I s
is not
clipped to
the Bitmap
.IR b ,
only to the screen.
.PP
.I Segment
draws a line segment in Bitmap
.I b
from Point
.I p
to
.IR q ,
with Code
.IR f .
The segment is half-open:
.I p
is the first point of the segment and
.I q
is the first point beyond the segment,
so adjacent segments sharing endpoints abut.
Like all the other graphics operations,
.I segment
clips the line so that only the portion of the line intersecting the
bitmap is displayed.
.PP
.I Texture
draws, with function
.I f
in the Rectangle
.IR r 
in Bitmap
.IR b ,
the
Texture specified by
.IR t .
The texture is replicated to cover
.IR r .
.I Rectf
is equivalent to
.I texture
with
.I *t
set to all one's.
.PP
In the above definitions, the type Bitmap may
be replaced with Layer anywhere; see
.IR newlayer (9.2).
.SH SEE ALSO
.IR types (9.5)