|
|
#include "nfbWinStr.h"xxx is the routine's prefix. Valid values are gen to use the default routine or your driver's prefix if you are rewriting this routine to use the specific capabilities of your hardware.void xxxDrawMonoImage ( BoxPtr pbox, void *image_src, unsigned int startx, unsigned int stride, unsigned long fg, unsigned char alu, unsigned long planemask, DrawablePtr pDraw );
void xxxDrawOpaqueMonoImage ( BoxPtr pbox, void *image_src, unsigned int startx, unsigned int stride, unsigned long fg, unsigned long bg, unsigned char alu, unsigned long planemask, DrawablePtr pDraw );
pbox
,
applying alu
and planemask
to all writes.
The monochrome image is color-expanded
so that all 1 bits in the source
are drawn with the foreground color specified by fg
.
For
DrawMonoImage,
the 0 bits are not drawn.
For
DrawOpaqueMonoImage,
all 0 bits are drawn with the background color
specified by bg
.
The handling of background color is the only difference between
DrawMonoImage
and
DrawOpaqueMonoImage.
Both routines work for 1, 8, 16, and 32 bits-per-pixel hardware.
pbox
image_src
startx
stride
fg
alu
and planemask
values are applied.
bg
startx
can be any value,
but it will never be greater than the width of the image
expressed by (pbox->x2 - pbox->x1
).
As an example, if the image data is 3x3 bytes, or 24x3 bits (each bit position is represented by a letter of the alphabet):
ABCDEFGHIJKLMNOPQRSTUVWX ABCDEFGHIJKLMNOPQRSTUVWX ABCDEFGHIJKLMNOPQRSTUVWXThe BoxRec contains the values:
pbox->x1 = 5; pbox->x2 = 11; pbox->y1 = 1; pbox->y2 = 4;So the width of the rectangle is 6 and the height is 3.
startx
has the value 5
and stride
has the value 4.
The final image on the screen should only affect pixels in the
area shown below:
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 0 . . . . . . . . . . . . . . . . . . . . . . . . . 1 . . . . . E F G H I J . . . . . . . . . . . . . . 2 . . . . . E F G H I J . . . . . . . . . . . . . . 3 . . . . . E F G H I J . . . . . . . . . . . . . . 4 . . . . . . . . . . . . . . . . . . . . . . . . .Where the bitmap contains clear bits, the final corresponding screen pixel must be unmodified.