1 | /*
|
---|
2 | * $XFree86: xc/programs/Xserver/render/mipict.h,v 1.12 2002/11/05 05:34:40 keithp Exp $
|
---|
3 | *
|
---|
4 | * Copyright © 2000 SuSE, Inc.
|
---|
5 | *
|
---|
6 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
7 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
8 | * the above copyright notice appear in all copies and that both that
|
---|
9 | * copyright notice and this permission notice appear in supporting
|
---|
10 | * documentation, and that the name of SuSE not be used in advertising or
|
---|
11 | * publicity pertaining to distribution of the software without specific,
|
---|
12 | * written prior permission. SuSE makes no representations about the
|
---|
13 | * suitability of this software for any purpose. It is provided "as is"
|
---|
14 | * without express or implied warranty.
|
---|
15 | *
|
---|
16 | * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
---|
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
---|
18 | * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
---|
19 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
---|
20 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
---|
21 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
---|
22 | *
|
---|
23 | * Author: Keith Packard, SuSE, Inc.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef _MIPICT_H_
|
---|
27 | #define _MIPICT_H_
|
---|
28 |
|
---|
29 | #include "picturestr.h"
|
---|
30 |
|
---|
31 | #define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
|
---|
32 |
|
---|
33 | #if MI_MAX_INDEXED <= 256
|
---|
34 | typedef CARD8 miIndexType;
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | typedef struct _miIndexed {
|
---|
38 | Bool color;
|
---|
39 | CARD32 rgba[MI_MAX_INDEXED];
|
---|
40 | miIndexType ent[32768];
|
---|
41 | } miIndexedRec, *miIndexedPtr;
|
---|
42 |
|
---|
43 | #define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
|
---|
44 | (((s) >> 6) & 0x03e0) | \
|
---|
45 | (((s) >> 9) & 0x7c00))
|
---|
46 | #define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15])
|
---|
47 | #define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24))
|
---|
48 |
|
---|
49 | #define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
|
---|
50 |
|
---|
51 | int
|
---|
52 | miCreatePicture (PicturePtr pPicture);
|
---|
53 |
|
---|
54 | void
|
---|
55 | miDestroyPicture (PicturePtr pPicture);
|
---|
56 |
|
---|
57 | void
|
---|
58 | miDestroyPictureClip (PicturePtr pPicture);
|
---|
59 |
|
---|
60 | int
|
---|
61 | miChangePictureClip (PicturePtr pPicture,
|
---|
62 | int type,
|
---|
63 | pointer value,
|
---|
64 | int n);
|
---|
65 |
|
---|
66 | void
|
---|
67 | miChangePicture (PicturePtr pPicture,
|
---|
68 | Mask mask);
|
---|
69 |
|
---|
70 | void
|
---|
71 | miValidatePicture (PicturePtr pPicture,
|
---|
72 | Mask mask);
|
---|
73 |
|
---|
74 |
|
---|
75 | Bool
|
---|
76 | miClipPicture (RegionPtr pRegion,
|
---|
77 | PicturePtr pPicture,
|
---|
78 | INT16 xReg,
|
---|
79 | INT16 yReg,
|
---|
80 | INT16 xPict,
|
---|
81 | INT16 yPict);
|
---|
82 |
|
---|
83 | Bool
|
---|
84 | miComputeCompositeRegion (RegionPtr pRegion,
|
---|
85 | PicturePtr pSrc,
|
---|
86 | PicturePtr pMask,
|
---|
87 | PicturePtr pDst,
|
---|
88 | INT16 xSrc,
|
---|
89 | INT16 ySrc,
|
---|
90 | INT16 xMask,
|
---|
91 | INT16 yMask,
|
---|
92 | INT16 xDst,
|
---|
93 | INT16 yDst,
|
---|
94 | CARD16 width,
|
---|
95 | CARD16 height);
|
---|
96 |
|
---|
97 | Bool
|
---|
98 | miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
---|
99 |
|
---|
100 | void
|
---|
101 | miGlyphExtents (int nlist,
|
---|
102 | GlyphListPtr list,
|
---|
103 | GlyphPtr *glyphs,
|
---|
104 | BoxPtr extents);
|
---|
105 |
|
---|
106 | void
|
---|
107 | miGlyphs (CARD8 op,
|
---|
108 | PicturePtr pSrc,
|
---|
109 | PicturePtr pDst,
|
---|
110 | PictFormatPtr maskFormat,
|
---|
111 | INT16 xSrc,
|
---|
112 | INT16 ySrc,
|
---|
113 | int nlist,
|
---|
114 | GlyphListPtr list,
|
---|
115 | GlyphPtr *glyphs);
|
---|
116 |
|
---|
117 | void
|
---|
118 | miRenderColorToPixel (PictFormatPtr pPict,
|
---|
119 | xRenderColor *color,
|
---|
120 | CARD32 *pixel);
|
---|
121 |
|
---|
122 | void
|
---|
123 | miRenderPixelToColor (PictFormatPtr pPict,
|
---|
124 | CARD32 pixel,
|
---|
125 | xRenderColor *color);
|
---|
126 |
|
---|
127 | Bool
|
---|
128 | miIsSolidAlpha (PicturePtr pSrc);
|
---|
129 |
|
---|
130 | void
|
---|
131 | miCompositeRects (CARD8 op,
|
---|
132 | PicturePtr pDst,
|
---|
133 | xRenderColor *color,
|
---|
134 | int nRect,
|
---|
135 | xRectangle *rects);
|
---|
136 |
|
---|
137 | void
|
---|
138 | miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
|
---|
139 |
|
---|
140 | void
|
---|
141 | miTrapezoids (CARD8 op,
|
---|
142 | PicturePtr pSrc,
|
---|
143 | PicturePtr pDst,
|
---|
144 | PictFormatPtr maskFormat,
|
---|
145 | INT16 xSrc,
|
---|
146 | INT16 ySrc,
|
---|
147 | int ntrap,
|
---|
148 | xTrapezoid *traps);
|
---|
149 |
|
---|
150 | void
|
---|
151 | miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds);
|
---|
152 |
|
---|
153 | void
|
---|
154 | miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
|
---|
155 |
|
---|
156 | void
|
---|
157 | miRasterizeTriangle (PicturePtr pMask,
|
---|
158 | xTriangle *tri,
|
---|
159 | int x_off,
|
---|
160 | int y_off);
|
---|
161 |
|
---|
162 | void
|
---|
163 | miTriangles (CARD8 op,
|
---|
164 | PicturePtr pSrc,
|
---|
165 | PicturePtr pDst,
|
---|
166 | PictFormatPtr maskFormat,
|
---|
167 | INT16 xSrc,
|
---|
168 | INT16 ySrc,
|
---|
169 | int ntri,
|
---|
170 | xTriangle *tris);
|
---|
171 |
|
---|
172 | void
|
---|
173 | miTriStrip (CARD8 op,
|
---|
174 | PicturePtr pSrc,
|
---|
175 | PicturePtr pDst,
|
---|
176 | PictFormatPtr maskFormat,
|
---|
177 | INT16 xSrc,
|
---|
178 | INT16 ySrc,
|
---|
179 | int npoint,
|
---|
180 | xPointFixed *points);
|
---|
181 |
|
---|
182 | void
|
---|
183 | miTriFan (CARD8 op,
|
---|
184 | PicturePtr pSrc,
|
---|
185 | PicturePtr pDst,
|
---|
186 | PictFormatPtr maskFormat,
|
---|
187 | INT16 xSrc,
|
---|
188 | INT16 ySrc,
|
---|
189 | int npoint,
|
---|
190 | xPointFixed *points);
|
---|
191 |
|
---|
192 | PicturePtr
|
---|
193 | miCreateAlphaPicture (ScreenPtr pScreen,
|
---|
194 | PicturePtr pDst,
|
---|
195 | PictFormatPtr pPictFormat,
|
---|
196 | CARD16 width,
|
---|
197 | CARD16 height);
|
---|
198 |
|
---|
199 | Bool
|
---|
200 | miInitIndexed (ScreenPtr pScreen,
|
---|
201 | PictFormatPtr pFormat);
|
---|
202 |
|
---|
203 | void
|
---|
204 | miCloseIndexed (ScreenPtr pScreen,
|
---|
205 | PictFormatPtr pFormat);
|
---|
206 |
|
---|
207 | void
|
---|
208 | miUpdateIndexed (ScreenPtr pScreen,
|
---|
209 | PictFormatPtr pFormat,
|
---|
210 | int ndef,
|
---|
211 | xColorItem *pdef);
|
---|
212 |
|
---|
213 | #endif /* _MIPICT_H_ */
|
---|