2 * $Source: x:/prj/tech/libsrc/dev2d/RCS/genmono.c $
5 * $Date: 1996/07/03 13:58:47 $
7 * Routines for clipping monochrome bitmaps to a rectangle.
9 * This file is part of the dev2d library.
17 void gen_mono_bitmap (grs_bitmap
*bm
, int x
, int y
, int code
, gdubm_func
*ubm_func
)
20 grs_bitmap bm_save
= *bm
;
22 if (code
& CLIP_LEFT
) { /* off left edge */
23 extra
= grd_clip
.left
- x
;
30 if (code
& CLIP_RIGHT
) { /* off right edge */
31 bm
->w
= grd_clip
.right
- x
;
33 if (bm
->w
<=0) goto punt
;
35 if (code
& CLIP_TOP
) { /* off top */
36 extra
= grd_clip
.top
- y
;
38 bm
->bits
+= bm
->row
*extra
;
41 if (code
& CLIP_BOT
) { /* off bottom */
42 bm
->h
= grd_clip
.bot
- y
;