bitblt.h

Mon, 26 Aug 2002 05:43:49 +0000

author
eric
date
Mon, 26 Aug 2002 05:43:49 +0000
changeset 47
bfc6aaa089b0
parent 43
b80cb5a4282a
child 48
3d0be1c1c1b2
permissions
-rw-r--r--

fixed 'middle-endian' output from TIFFReadScanline

     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 }
    24 typedef u32 word_type;
    25 #define BITS_PER_WORD (8 * sizeof (word_type))
    26 #define ALL_ONES (~ 0U)
    29 typedef struct Bitmap
    30 {
    31   word_type *bits;
    32   Rect rect;
    33   u32 row_words;
    34 } Bitmap;
    37 #define TF_SRC 0xc
    38 #define TF_AND 0x8
    39 #define TF_OR  0xe
    40 #define TF_XOR 0x6
    43 Bitmap *create_bitmap (Rect *rect);
    44 void free_bitmap (Bitmap *bitmap);
    46 boolean get_pixel (Bitmap *bitmap, Point coord);
    47 void set_pixel (Bitmap *bitmap, Point coord, boolean value);
    50 Bitmap *bitblt (Bitmap *src_bitmap,
    51 		Rect   *src_rect,
    52 		Bitmap *dest_bitmap,
    53 		Point  *dest_min,
    54 		int tfn,
    55 		int background);
    58 /* in-place transformations */
    59 void flip_h (Bitmap *src);
    60 void flip_v (Bitmap *src);
    62 void rot_180 (Bitmap *src);  /* combination of flip_h and flip_v */
    64 /* "in-place" transformations - will allocate new memory and free old */
    65 void transpose (Bitmap *src);
    67 void rot_90 (Bitmap *src);   /* transpose + flip_h */
    68 void rot_270 (Bitmap *src);  /* transpose + flip_v */
    71 void reverse_bits (u8 *p, int byte_count);