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