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