bitblt.h

Wed, 02 Jan 2002 16:39:39 +0000

author
eric
date
Wed, 02 Jan 2002 16:39:39 +0000
changeset 42
9c85a4cd88a3
parent 35
41804cc569ab
child 43
b80cb5a4282a
permissions
-rw-r--r--

started work on bitblt optimization - split rotate functions from bitblt.

     1 typedef struct Point
     2 {
     3   s32 x;
     4   s32 y;
     5 } Point;
     7 typedef struct Rect
     8 {
     9   Point min;
    10   Point max;
    11 } Rect;
    13 static inline s32 rect_width (Rect *r)
    14 {
    15   return (r->max.x - r->min.x);
    16 }
    18 static inline s32 rect_height (Rect *r)
    19 {
    20   return (r->max.y - r->min.y);
    21 }
    23 typedef struct Bitmap
    24 {
    25   u8 *bits;
    26   Rect rect;
    27   u32 rowbytes;
    28 } Bitmap;
    31 #define TF_SRC 0xc
    32 #define TF_AND 0x8
    33 #define TF_OR  0xe
    34 #define TF_XOR 0x6
    37 Bitmap *create_bitmap (Rect *rect);
    38 void free_bitmap (Bitmap *bitmap);
    40 boolean get_pixel (Bitmap *bitmap, Point coord);
    41 void set_pixel (Bitmap *bitmap, Point coord, boolean value);
    44 Bitmap *bitblt (Bitmap *src_bitmap,
    45 		Rect   *src_rect,
    46 		Bitmap *dest_bitmap,
    47 		Point  *dest_min,
    48 		int tfn);
    51 /* in-place transformations */
    52 void flip_h (Bitmap *src);
    53 void flip_v (Bitmap *src);
    55 void rot_180 (Bitmap *src);  /* combination of flip_h and flip_v */
    57 /* "in-place" transformations - will allocate new memory and free old */
    58 void transpose (Bitmap *src);
    60 void rot_90 (Bitmap *src);   /* transpose + flip_h */
    61 void rot_270 (Bitmap *src);  /* transpose + flip_v */