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 | extern _X_EXPORT int
|
---|
51 | miCreatePicture (PicturePtr pPicture);
|
---|
52 |
|
---|
53 | extern _X_EXPORT void
|
---|
54 | miDestroyPicture (PicturePtr pPicture);
|
---|
55 |
|
---|
56 | extern _X_EXPORT void
|
---|
57 | miDestroyPictureClip (PicturePtr pPicture);
|
---|
58 |
|
---|
59 | extern _X_EXPORT int
|
---|
60 | miChangePictureClip (PicturePtr pPicture,
|
---|
61 | int type,
|
---|
62 | pointer value,
|
---|
63 | int n);
|
---|
64 |
|
---|
65 | extern _X_EXPORT void
|
---|
66 | miChangePicture (PicturePtr pPicture,
|
---|
67 | Mask mask);
|
---|
68 |
|
---|
69 | extern _X_EXPORT void
|
---|
70 | miValidatePicture (PicturePtr pPicture,
|
---|
71 | Mask mask);
|
---|
72 |
|
---|
73 | extern _X_EXPORT int
|
---|
74 | miChangePictureTransform (PicturePtr pPicture,
|
---|
75 | PictTransform *transform);
|
---|
76 |
|
---|
77 | extern _X_EXPORT int
|
---|
78 | miChangePictureFilter (PicturePtr pPicture,
|
---|
79 | int filter,
|
---|
80 | xFixed *params,
|
---|
81 | int nparams);
|
---|
82 |
|
---|
83 | extern _X_EXPORT void
|
---|
84 | miCompositeSourceValidate (PicturePtr pPicture,
|
---|
85 | INT16 x,
|
---|
86 | INT16 y,
|
---|
87 | CARD16 width,
|
---|
88 | CARD16 height);
|
---|
89 | extern _X_EXPORT Bool
|
---|
90 | miComputeCompositeRegion (RegionPtr pRegion,
|
---|
91 | PicturePtr pSrc,
|
---|
92 | PicturePtr pMask,
|
---|
93 | PicturePtr pDst,
|
---|
94 | INT16 xSrc,
|
---|
95 | INT16 ySrc,
|
---|
96 | INT16 xMask,
|
---|
97 | INT16 yMask,
|
---|
98 | INT16 xDst,
|
---|
99 | INT16 yDst,
|
---|
100 | CARD16 width,
|
---|
101 | CARD16 height);
|
---|
102 |
|
---|
103 | extern _X_EXPORT Bool
|
---|
104 | miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
---|
105 |
|
---|
106 | extern _X_EXPORT Bool
|
---|
107 | miRealizeGlyph (ScreenPtr pScreen,
|
---|
108 | GlyphPtr glyph);
|
---|
109 |
|
---|
110 | extern _X_EXPORT void
|
---|
111 | miUnrealizeGlyph (ScreenPtr pScreen,
|
---|
112 | GlyphPtr glyph);
|
---|
113 |
|
---|
114 | extern _X_EXPORT void
|
---|
115 | miGlyphs (CARD8 op,
|
---|
116 | PicturePtr pSrc,
|
---|
117 | PicturePtr pDst,
|
---|
118 | PictFormatPtr maskFormat,
|
---|
119 | INT16 xSrc,
|
---|
120 | INT16 ySrc,
|
---|
121 | int nlist,
|
---|
122 | GlyphListPtr list,
|
---|
123 | GlyphPtr *glyphs);
|
---|
124 |
|
---|
125 | extern _X_EXPORT void
|
---|
126 | miRenderColorToPixel (PictFormatPtr pPict,
|
---|
127 | xRenderColor *color,
|
---|
128 | CARD32 *pixel);
|
---|
129 |
|
---|
130 | extern _X_EXPORT void
|
---|
131 | miRenderPixelToColor (PictFormatPtr pPict,
|
---|
132 | CARD32 pixel,
|
---|
133 | xRenderColor *color);
|
---|
134 |
|
---|
135 | extern _X_EXPORT Bool
|
---|
136 | miIsSolidAlpha (PicturePtr pSrc);
|
---|
137 |
|
---|
138 | extern _X_EXPORT void
|
---|
139 | miCompositeRects (CARD8 op,
|
---|
140 | PicturePtr pDst,
|
---|
141 | xRenderColor *color,
|
---|
142 | int nRect,
|
---|
143 | xRectangle *rects);
|
---|
144 |
|
---|
145 | extern _X_EXPORT void
|
---|
146 | miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
|
---|
147 |
|
---|
148 | extern _X_EXPORT void
|
---|
149 | miTrapezoids (CARD8 op,
|
---|
150 | PicturePtr pSrc,
|
---|
151 | PicturePtr pDst,
|
---|
152 | PictFormatPtr maskFormat,
|
---|
153 | INT16 xSrc,
|
---|
154 | INT16 ySrc,
|
---|
155 | int ntrap,
|
---|
156 | xTrapezoid *traps);
|
---|
157 |
|
---|
158 | extern _X_EXPORT void
|
---|
159 | miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds);
|
---|
160 |
|
---|
161 | extern _X_EXPORT void
|
---|
162 | miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
|
---|
163 |
|
---|
164 | extern _X_EXPORT void
|
---|
165 | miTriangles (CARD8 op,
|
---|
166 | PicturePtr pSrc,
|
---|
167 | PicturePtr pDst,
|
---|
168 | PictFormatPtr maskFormat,
|
---|
169 | INT16 xSrc,
|
---|
170 | INT16 ySrc,
|
---|
171 | int ntri,
|
---|
172 | xTriangle *tris);
|
---|
173 |
|
---|
174 | extern _X_EXPORT void
|
---|
175 | miTriStrip (CARD8 op,
|
---|
176 | PicturePtr pSrc,
|
---|
177 | PicturePtr pDst,
|
---|
178 | PictFormatPtr maskFormat,
|
---|
179 | INT16 xSrc,
|
---|
180 | INT16 ySrc,
|
---|
181 | int npoint,
|
---|
182 | xPointFixed *points);
|
---|
183 |
|
---|
184 | extern _X_EXPORT void
|
---|
185 | miTriFan (CARD8 op,
|
---|
186 | PicturePtr pSrc,
|
---|
187 | PicturePtr pDst,
|
---|
188 | PictFormatPtr maskFormat,
|
---|
189 | INT16 xSrc,
|
---|
190 | INT16 ySrc,
|
---|
191 | int npoint,
|
---|
192 | xPointFixed *points);
|
---|
193 |
|
---|
194 | extern _X_EXPORT PicturePtr
|
---|
195 | miCreateAlphaPicture (ScreenPtr pScreen,
|
---|
196 | PicturePtr pDst,
|
---|
197 | PictFormatPtr pPictFormat,
|
---|
198 | CARD16 width,
|
---|
199 | CARD16 height);
|
---|
200 |
|
---|
201 | extern _X_EXPORT Bool
|
---|
202 | miInitIndexed (ScreenPtr pScreen,
|
---|
203 | PictFormatPtr pFormat);
|
---|
204 |
|
---|
205 | extern _X_EXPORT void
|
---|
206 | miCloseIndexed (ScreenPtr pScreen,
|
---|
207 | PictFormatPtr pFormat);
|
---|
208 |
|
---|
209 | extern _X_EXPORT void
|
---|
210 | miUpdateIndexed (ScreenPtr pScreen,
|
---|
211 | PictFormatPtr pFormat,
|
---|
212 | int ndef,
|
---|
213 | xColorItem *pdef);
|
---|
214 |
|
---|
215 | #endif /* _MIPICT_H_ */
|
---|