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 |
|
---|
86 | extern _X_EXPORT Bool
|
---|
87 | miComputeCompositeRegion (RegionPtr pRegion,
|
---|
88 | PicturePtr pSrc,
|
---|
89 | PicturePtr pMask,
|
---|
90 | PicturePtr pDst,
|
---|
91 | INT16 xSrc,
|
---|
92 | INT16 ySrc,
|
---|
93 | INT16 xMask,
|
---|
94 | INT16 yMask,
|
---|
95 | INT16 xDst,
|
---|
96 | INT16 yDst,
|
---|
97 | CARD16 width,
|
---|
98 | CARD16 height);
|
---|
99 |
|
---|
100 | extern _X_EXPORT Bool
|
---|
101 | miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
---|
102 |
|
---|
103 | extern _X_EXPORT Bool
|
---|
104 | miRealizeGlyph (ScreenPtr pScreen,
|
---|
105 | GlyphPtr glyph);
|
---|
106 |
|
---|
107 | extern _X_EXPORT void
|
---|
108 | miUnrealizeGlyph (ScreenPtr pScreen,
|
---|
109 | GlyphPtr glyph);
|
---|
110 |
|
---|
111 | extern _X_EXPORT void
|
---|
112 | miGlyphs (CARD8 op,
|
---|
113 | PicturePtr pSrc,
|
---|
114 | PicturePtr pDst,
|
---|
115 | PictFormatPtr maskFormat,
|
---|
116 | INT16 xSrc,
|
---|
117 | INT16 ySrc,
|
---|
118 | int nlist,
|
---|
119 | GlyphListPtr list,
|
---|
120 | GlyphPtr *glyphs);
|
---|
121 |
|
---|
122 | extern _X_EXPORT void
|
---|
123 | miRenderColorToPixel (PictFormatPtr pPict,
|
---|
124 | xRenderColor *color,
|
---|
125 | CARD32 *pixel);
|
---|
126 |
|
---|
127 | extern _X_EXPORT void
|
---|
128 | miRenderPixelToColor (PictFormatPtr pPict,
|
---|
129 | CARD32 pixel,
|
---|
130 | xRenderColor *color);
|
---|
131 |
|
---|
132 | extern _X_EXPORT Bool
|
---|
133 | miIsSolidAlpha (PicturePtr pSrc);
|
---|
134 |
|
---|
135 | extern _X_EXPORT void
|
---|
136 | miCompositeRects (CARD8 op,
|
---|
137 | PicturePtr pDst,
|
---|
138 | xRenderColor *color,
|
---|
139 | int nRect,
|
---|
140 | xRectangle *rects);
|
---|
141 |
|
---|
142 | extern _X_EXPORT void
|
---|
143 | miTriStrip (CARD8 op,
|
---|
144 | PicturePtr pSrc,
|
---|
145 | PicturePtr pDst,
|
---|
146 | PictFormatPtr maskFormat,
|
---|
147 | INT16 xSrc,
|
---|
148 | INT16 ySrc,
|
---|
149 | int npoints,
|
---|
150 | xPointFixed *points);
|
---|
151 |
|
---|
152 | extern _X_EXPORT void
|
---|
153 | miTriFan (CARD8 op,
|
---|
154 | PicturePtr pSrc,
|
---|
155 | PicturePtr pDst,
|
---|
156 | PictFormatPtr maskFormat,
|
---|
157 | INT16 xSrc,
|
---|
158 | INT16 ySrc,
|
---|
159 | int npoints,
|
---|
160 | xPointFixed *points);
|
---|
161 |
|
---|
162 | extern _X_EXPORT void
|
---|
163 | miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
|
---|
164 |
|
---|
165 | extern _X_EXPORT void
|
---|
166 | miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds);
|
---|
167 |
|
---|
168 | extern _X_EXPORT void
|
---|
169 | miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
|
---|
170 |
|
---|
171 | extern _X_EXPORT Bool
|
---|
172 | miInitIndexed (ScreenPtr pScreen,
|
---|
173 | PictFormatPtr pFormat);
|
---|
174 |
|
---|
175 | extern _X_EXPORT void
|
---|
176 | miCloseIndexed (ScreenPtr pScreen,
|
---|
177 | PictFormatPtr pFormat);
|
---|
178 |
|
---|
179 | extern _X_EXPORT void
|
---|
180 | miUpdateIndexed (ScreenPtr pScreen,
|
---|
181 | PictFormatPtr pFormat,
|
---|
182 | int ndef,
|
---|
183 | xColorItem *pdef);
|
---|
184 |
|
---|
185 | #endif /* _MIPICT_H_ */
|
---|