3 * Copyright © 2000 SuSE, Inc.
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.
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.
22 * Author: Keith Packard, SuSE, Inc.
28 #include "picturestr.h"
30 #define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
32 #if MI_MAX_INDEXED <= 256
33 typedef CARD8 miIndexType
;
36 typedef struct _miIndexed
{
38 CARD32 rgba
[MI_MAX_INDEXED
];
39 miIndexType ent
[32768];
40 } miIndexedRec
, *miIndexedPtr
;
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))
48 #define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
51 miCreatePicture(PicturePtr pPicture
);
54 miDestroyPicture(PicturePtr pPicture
);
57 miDestroyPictureClip(PicturePtr pPicture
);
60 miChangePictureClip(PicturePtr pPicture
, int type
, pointer value
, int n
);
63 miChangePicture(PicturePtr pPicture
, Mask mask
);
66 miValidatePicture(PicturePtr pPicture
, Mask mask
);
69 miChangePictureTransform(PicturePtr pPicture
, PictTransform
* transform
);
73 miChangePictureFilter(PicturePtr pPicture
,
74 int filter
, xFixed
* params
, int nparams
);
77 miCompositeSourceValidate(PicturePtr pPicture
);
81 miComputeCompositeRegion(RegionPtr pRegion
,
89 INT16 xDst
, INT16 yDst
, CARD16 width
, CARD16 height
);
92 miPictureInit(ScreenPtr pScreen
, PictFormatPtr formats
, int nformats
);
95 miRealizeGlyph(ScreenPtr pScreen
, GlyphPtr glyph
);
98 miUnrealizeGlyph(ScreenPtr pScreen
, GlyphPtr glyph
);
100 extern _X_EXPORT
void
105 PictFormatPtr maskFormat
,
107 INT16 ySrc
, int nlist
, GlyphListPtr list
, GlyphPtr
* glyphs
);
109 extern _X_EXPORT
void
110 miRenderColorToPixel(PictFormatPtr pPict
, xRenderColor
* color
, CARD32
*pixel
);
112 extern _X_EXPORT
void
113 miRenderPixelToColor(PictFormatPtr pPict
, CARD32 pixel
, xRenderColor
* color
);
115 extern _X_EXPORT Bool
116 miIsSolidAlpha(PicturePtr pSrc
);
118 extern _X_EXPORT
void
120 miCompositeRects(CARD8 op
,
122 xRenderColor
* color
, int nRect
, xRectangle
*rects
);
124 extern _X_EXPORT
void
129 PictFormatPtr maskFormat
,
130 INT16 xSrc
, INT16 ySrc
, int npoints
, xPointFixed
* points
);
132 extern _X_EXPORT
void
137 PictFormatPtr maskFormat
,
138 INT16 xSrc
, INT16 ySrc
, int npoints
, xPointFixed
* points
);
140 extern _X_EXPORT
void
141 miTrapezoidBounds(int ntrap
, xTrapezoid
* traps
, BoxPtr box
);
143 extern _X_EXPORT
void
144 miPointFixedBounds(int npoint
, xPointFixed
* points
, BoxPtr bounds
);
146 extern _X_EXPORT
void
147 miTriangleBounds(int ntri
, xTriangle
* tris
, BoxPtr bounds
);
149 extern _X_EXPORT Bool
150 miInitIndexed(ScreenPtr pScreen
, PictFormatPtr pFormat
);
152 extern _X_EXPORT
void
153 miCloseIndexed(ScreenPtr pScreen
, PictFormatPtr pFormat
);
155 extern _X_EXPORT
void
157 miUpdateIndexed(ScreenPtr pScreen
,
158 PictFormatPtr pFormat
, int ndef
, xColorItem
* pdef
);
160 #endif /* _MIPICT_H_ */