term% cat index.txt BITBLT(9.3) BITBLT(9.3)
NAME
Code, addr, bitblt, point, rectf, screenswap, segment, texture - basic
jerq graphics functions
SYNOPSIS
#include <jerq.h>
typedef int Code;
Code F_STORE, F_XOR, F_OR, F_CLR;
Word *addr(b, p) Bitmap *b; Point p;
void bitblt(sb, r, db, p, f) Bitmap *sb, *db; Rectangle r; Point p;
Code f;
void point(b, p, f) Bitmap *b; Point p; Code f;
void rectf(b, r, f) Bitmap *b; Rectangle r; Code f;
void screenswap(b, r, s) Bitmap *b; Rectangle r, s;
void segment(b, p, q, f) Bitmap *b; Point p, q; Code f;
void texture(b, r, t, f) Bitmap *b; Rectangle r; Texture *t; Code f;
DESCRIPTION
The type Code defines the constants passed to the graphics primitives
to indicate the Boolean operation to be performed on the source and
destination. The meanings of a Code are:
F_STORE target = source
F_OR target |= source
F_XOR target ^= source
F_CLR target &= ~source
In other words, if a Rectangle is copied to another place with Code
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
zeroes everywhere except on the object (e.g. line) generated by the op‐
erator, with coordinates aligned with the destination bitmap. F_STORE
is the same as F_OR for non-rectangular operations.
Addr returns the address of the Word containing the bit at Point p in
the Bitmap b.
Bitblt (bit-block transfer) copies the data in Rectangle r in Bitmap sb
to the congruent Rectangle with origin p in Bitmap db. The nature of
the copy is specified by the Code f.
Point draws the pixel at location p in the Bitmap b according to Code
f.
Screenswap does an in-place exchange of the on-screen Rectangle s and
the Rectangle r within the Bitmap b. Its action is undefined if r and
s are not congruent. The Rectangle s is not clipped to the Bitmap b,
only to the screen.
Segment draws a line segment in Bitmap b from Point p to q, with Code
f. The segment is half-open: p is the first point of the segment and q
is the first point beyond the segment, so adjacent segments sharing
endpoints abut. Like all the other graphics operations, segment clips
the line so that only the portion of the line intersecting the bitmap
is displayed.
Texture draws with function specified by f in the Rectangle r, in the
Bitmap b, the Texture specified by t. The texture is replicated to
cover r. Rectf is equivalent to texture with *t set to all one's.
In the above definitions, the type Bitmap may be replaced with Layer
anywhere; see newlayer(9.2).
SEE ALSO
types(9.5)
BITBLT(9.3)