.TH BITBLT 9.3 .CT 2 graphics .SH NAME Code, addr, bitblt, point, rectf, screenswap, segment, texture \- graphics functions .SH SYNOPSIS .B #include .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)