bitblt.h

Sun, 25 Aug 2002 13:21:28 +0000

author
eric
date
Sun, 25 Aug 2002 13:21:28 +0000
changeset 45
23ef95d6ff07
parent 43
b80cb5a4282a
child 47
bfc6aaa089b0
permissions
-rw-r--r--

cloning an input context wasn't updating last_input_context

     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 /*
    24  * Despite the following two definitions, there are still some places
    25  * in the code that depend on words having 32 bits.
    26  */ 
    27 #define BITS_PER_WORD 32
    28 typedef u32 word_type;
    30 typedef struct Bitmap
    31 {
    32   word_type *bits;
    33   Rect rect;
    34   u32 row_words;
    35 } Bitmap;
    38 #define TF_SRC 0xc
    39 #define TF_AND 0x8
    40 #define TF_OR  0xe
    41 #define TF_XOR 0x6
    44 Bitmap *create_bitmap (Rect *rect);
    45 void free_bitmap (Bitmap *bitmap);
    47 boolean get_pixel (Bitmap *bitmap, Point coord);
    48 void set_pixel (Bitmap *bitmap, Point coord, boolean value);
    51 Bitmap *bitblt (Bitmap *src_bitmap,
    52 		Rect   *src_rect,
    53 		Bitmap *dest_bitmap,
    54 		Point  *dest_min,
    55 		int tfn,
    56 		int background);
    59 /* in-place transformations */
    60 void flip_h (Bitmap *src);
    61 void flip_v (Bitmap *src);
    63 void rot_180 (Bitmap *src);  /* combination of flip_h and flip_v */
    65 /* "in-place" transformations - will allocate new memory and free old */
    66 void transpose (Bitmap *src);
    68 void rot_90 (Bitmap *src);   /* transpose + flip_h */
    69 void rot_270 (Bitmap *src);  /* transpose + flip_v */