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 | int
|
---|
75 | miChangePictureTransform (PicturePtr pPicture,
|
---|
76 | PictTransform *transform);
|
---|
77 |
|
---|
78 | int
|
---|
79 | miChangePictureFilter (PicturePtr pPicture,
|
---|
80 | int filter,
|
---|
81 | xFixed *params,
|
---|
82 | int nparams);
|
---|
83 |
|
---|
84 | Bool
|
---|
85 | miClipPicture (RegionPtr pRegion,
|
---|
86 | PicturePtr pPicture,
|
---|
87 | INT16 xReg,
|
---|
88 | INT16 yReg,
|
---|
89 | INT16 xPict,
|
---|
90 | INT16 yPict);
|
---|
91 |
|
---|
92 | Bool
|
---|
93 | miComputeCompositeRegion (RegionPtr pRegion,
|
---|
94 | PicturePtr pSrc,
|
---|
95 | PicturePtr pMask,
|
---|
96 | PicturePtr pDst,
|
---|
97 | INT16 xSrc,
|
---|
98 | INT16 ySrc,
|
---|
99 | INT16 xMask,
|
---|
100 | INT16 yMask,
|
---|
101 | INT16 xDst,
|
---|
102 | INT16 yDst,
|
---|
103 | CARD16 width,
|
---|
104 | CARD16 height);
|
---|
105 |
|
---|
106 | Bool
|
---|
107 | miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
---|
108 |
|
---|
109 | Bool
|
---|
110 | miRealizeGlyph (ScreenPtr pScreen,
|
---|
111 | GlyphPtr glyph);
|
---|
112 |
|
---|
113 | void
|
---|
114 | miUnrealizeGlyph (ScreenPtr pScreen,
|
---|
115 | GlyphPtr glyph);
|
---|
116 |
|
---|
117 | void
|
---|
118 | miGlyphExtents (int nlist,
|
---|
119 | GlyphListPtr list,
|
---|
120 | GlyphPtr *glyphs,
|
---|
121 | BoxPtr extents);
|
---|
122 |
|
---|
123 | void
|
---|
124 | miGlyphs (CARD8 op,
|
---|
125 | PicturePtr pSrc,
|
---|
126 | PicturePtr pDst,
|
---|
127 | PictFormatPtr maskFormat,
|
---|
128 | INT16 xSrc,
|
---|
129 | INT16 ySrc,
|
---|
130 | int nlist,
|
---|
131 | GlyphListPtr list,
|
---|
132 | GlyphPtr *glyphs);
|
---|
133 |
|
---|
134 | void
|
---|
135 | miRenderColorToPixel (PictFormatPtr pPict,
|
---|
136 | xRenderColor *color,
|
---|
137 | CARD32 *pixel);
|
---|
138 |
|
---|
139 | void
|
---|
140 | miRenderPixelToColor (PictFormatPtr pPict,
|
---|
141 | CARD32 pixel,
|
---|
142 | xRenderColor *color);
|
---|
143 |
|
---|
144 | Bool
|
---|
145 | miIsSolidAlpha (PicturePtr pSrc);
|
---|
146 |
|
---|
147 | void
|
---|
148 | miCompositeRects (CARD8 op,
|
---|
149 | PicturePtr pDst,
|
---|
150 | xRenderColor *color,
|
---|
151 | int nRect,
|
---|
152 | xRectangle *rects);
|
---|
153 |
|
---|
154 | void
|
---|
155 | miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
|
---|
156 |
|
---|
157 | void
|
---|
158 | miTrapezoids (CARD8 op,
|
---|
159 | PicturePtr pSrc,
|
---|
160 | PicturePtr pDst,
|
---|
161 | PictFormatPtr maskFormat,
|
---|
162 | INT16 xSrc,
|
---|
163 | INT16 ySrc,
|
---|
164 | int ntrap,
|
---|
165 | xTrapezoid *traps);
|
---|
166 |
|
---|
167 | void
|
---|
168 | miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds);
|
---|
169 |
|
---|
170 | void
|
---|
171 | miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
|
---|
172 |
|
---|
173 | void
|
---|
174 | miRasterizeTriangle (PicturePtr pMask,
|
---|
175 | xTriangle *tri,
|
---|
176 | int x_off,
|
---|
177 | int y_off);
|
---|
178 |
|
---|
179 | void
|
---|
180 | miTriangles (CARD8 op,
|
---|
181 | PicturePtr pSrc,
|
---|
182 | PicturePtr pDst,
|
---|
183 | PictFormatPtr maskFormat,
|
---|
184 | INT16 xSrc,
|
---|
185 | INT16 ySrc,
|
---|
186 | int ntri,
|
---|
187 | xTriangle *tris);
|
---|
188 |
|
---|
189 | void
|
---|
190 | miTriStrip (CARD8 op,
|
---|
191 | PicturePtr pSrc,
|
---|
192 | PicturePtr pDst,
|
---|
193 | PictFormatPtr maskFormat,
|
---|
194 | INT16 xSrc,
|
---|
195 | INT16 ySrc,
|
---|
196 | int npoint,
|
---|
197 | xPointFixed *points);
|
---|
198 |
|
---|
199 | void
|
---|
200 | miTriFan (CARD8 op,
|
---|
201 | PicturePtr pSrc,
|
---|
202 | PicturePtr pDst,
|
---|
203 | PictFormatPtr maskFormat,
|
---|
204 | INT16 xSrc,
|
---|
205 | INT16 ySrc,
|
---|
206 | int npoint,
|
---|
207 | xPointFixed *points);
|
---|
208 |
|
---|
209 | PicturePtr
|
---|
210 | miCreateAlphaPicture (ScreenPtr pScreen,
|
---|
211 | PicturePtr pDst,
|
---|
212 | PictFormatPtr pPictFormat,
|
---|
213 | CARD16 width,
|
---|
214 | CARD16 height);
|
---|
215 |
|
---|
216 | Bool
|
---|
217 | miInitIndexed (ScreenPtr pScreen,
|
---|
218 | PictFormatPtr pFormat);
|
---|
219 |
|
---|
220 | void
|
---|
221 | miCloseIndexed (ScreenPtr pScreen,
|
---|
222 | PictFormatPtr pFormat);
|
---|
223 |
|
---|
224 | void
|
---|
225 | miUpdateIndexed (ScreenPtr pScreen,
|
---|
226 | PictFormatPtr pFormat,
|
---|
227 | int ndef,
|
---|
228 | xColorItem *pdef);
|
---|
229 |
|
---|
230 | #endif /* _MIPICT_H_ */
|
---|