|
|
1.1 root 1: /* $Header: bitblt_ext.h,v 10.1 86/11/19 10:51:57 jg Exp $ */
2: /*
3: * Copyright (c) 1986 Brown University
4: *
5: * Permission to use, copy, modify and distribute this software and its
6: * documentation for any purpose and without fee is hereby granted, provided
7: * that the above copyright notice appear in all copies, and that both
8: * that copyright notice and this permission notice appear in supporting
9: * documentation, and that the name of Brown University not be used in
10: * advertising or publicity pertaining to distribution of the software without
11: * specific, written prior permission. Brown University makes no
12: * representations about the suitability of this software for any purpose.
13: * It is provided "as-is" without express or implied warranty.
14: *
15: * Written by Daniel Stone, Brown University/IRIS (des@iris)
16: */
17:
18: /*
19: * Rectangle.
20: */
21: typedef struct Blt_Rectangle {
22: short origin_y; /* top */
23: short origin_x; /* left */
24: short corner_y; /* bottom */
25: short corner_x; /* right */
26: } Blt_Rectangle;
27:
28: /*
29: * Bitmap.
30: */
31: typedef struct Blt_Bitmap {
32: unsigned short *base; /* pointer to the actual bits */
33: Blt_Rectangle rect; /* bounding rectangle */
34: short nshorts; /* number of shorts wide the bitmap is */
35: } Blt_Bitmap;
36:
37: /*
38: * Tile. (Texture,Pattern have your pick.)
39: */
40: #define BLT_TILE_SIZE 16
41: typedef struct Blt_Tile {
42: unsigned short tile[BLT_TILE_SIZE];
43: } Blt_Tile;
44:
45: /*
46: * Bitblt user data structure.
47: *
48: * bitblt() is passed a pointer to a user structure which contains all the
49: * necessary information to do the bit block transfer.
50: *
51: * NOTE: If the "comb_rule" does uses the source then tile_ptr does not have
52: * to be set. Otherwise comb_rule is a tile combination rule and the
53: * src_bitmap and src_rect need not be filled in. If the clip bit in
54: * blt_flags is off (0) then clp_rect need not be filled in. If the mask
55: * bit in blt_flags is off then msk_bitmap need not be filled in.
56: */
57: typedef struct {
58: Blt_Bitmap src_bitmap; /* Bitmap to be copied from */
59: Blt_Rectangle src_rect; /* Specifies the area in the
60: src_bitmap */
61: Blt_Bitmap dst_bitmap; /* Bitmap to be changed */
62: Blt_Rectangle dst_rect; /* Specifies the area in the
63: dst_bitmap */
64: Blt_Rectangle clp_rect; /* Another rectangle to clip against */
65: Blt_Tile *tile_ptr; /* The tile to be used if the
66: combination rule uses a tile */
67: Blt_Bitmap msk_bitmap; /* Masking bitmap */
68: short comb_rule; /* combination rule to be used */
69: short blt_flags; /* A bit on means do a certain
70: operation. For example if the first
71: bit is on then do clipping. */
72: } Blt;
73:
74: /*
75: * Flags blt_flags could be.
76: */
77: #define BLT_CLIPON 0x1
78: #define BLT_MASKON 0x2
79: #define BLT_ECHO 0x4
80:
81: #ifndef BPW
82: /*
83: * Macros for division from words and bytes.
84: */
85: #define BPW 16 /* Bits per Word */
86: #define LOG2_BPW 4
87: #define MOD_BPW(value) ((value) & (BPW-1))
88: #define DIV_BPW(value) ((value) >> LOG2_BPW)
89: #define MUL_BPW(value) ((value) << LOG2_BPW)
90:
91: /*
92: * Bits TO Words.
93: */
94: #define BTOW(bits) (DIV_BPW((bits) + (BPW-1)))
95:
96: /*
97: * Macros for the division and multiplication by 2.
98: */
99: #define DIV_2(n) ((n) >> 1)
100: #define MUL_2(n) ((n) << 1)
101: #define MOD_2(n) ((n) & 0x1)
102: #endif BPW
103:
104: /*
105: * Flags to indicate whether or not current screen is a hardware or
106: * software cursor.
107: */
108: #define SOFT_CURSOR 0x1
109: #define HARD_CURSOR 0x2
110:
111: /*
112: * externs for X access.
113: */
114: extern int xdev;
115: extern XIoAddr *XAddr;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.