| 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, int type, pointer value, int n); |
| 61 | |
| 62 | extern _X_EXPORT void |
| 63 | miChangePicture(PicturePtr pPicture, Mask mask); |
| 64 | |
| 65 | extern _X_EXPORT void |
| 66 | miValidatePicture(PicturePtr pPicture, Mask mask); |
| 67 | |
| 68 | extern _X_EXPORT int |
| 69 | miChangePictureTransform(PicturePtr pPicture, PictTransform * transform); |
| 70 | |
| 71 | extern _X_EXPORT int |
| 72 | |
| 73 | miChangePictureFilter(PicturePtr pPicture, |
| 74 | int filter, xFixed * params, int nparams); |
| 75 | |
| 76 | extern _X_EXPORT void |
| 77 | miCompositeSourceValidate(PicturePtr pPicture); |
| 78 | |
| 79 | extern _X_EXPORT Bool |
| 80 | |
| 81 | miComputeCompositeRegion(RegionPtr pRegion, |
| 82 | PicturePtr pSrc, |
| 83 | PicturePtr pMask, |
| 84 | PicturePtr pDst, |
| 85 | INT16 xSrc, |
| 86 | INT16 ySrc, |
| 87 | INT16 xMask, |
| 88 | INT16 yMask, |
| 89 | INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); |
| 90 | |
| 91 | extern _X_EXPORT Bool |
| 92 | miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats); |
| 93 | |
| 94 | extern _X_EXPORT Bool |
| 95 | miRealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph); |
| 96 | |
| 97 | extern _X_EXPORT void |
| 98 | miUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph); |
| 99 | |
| 100 | extern _X_EXPORT void |
| 101 | |
| 102 | miGlyphs(CARD8 op, |
| 103 | PicturePtr pSrc, |
| 104 | PicturePtr pDst, |
| 105 | PictFormatPtr maskFormat, |
| 106 | INT16 xSrc, |
| 107 | INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); |
| 108 | |
| 109 | extern _X_EXPORT void |
| 110 | miRenderColorToPixel(PictFormatPtr pPict, xRenderColor * color, CARD32 *pixel); |
| 111 | |
| 112 | extern _X_EXPORT void |
| 113 | miRenderPixelToColor(PictFormatPtr pPict, CARD32 pixel, xRenderColor * color); |
| 114 | |
| 115 | extern _X_EXPORT Bool |
| 116 | miIsSolidAlpha(PicturePtr pSrc); |
| 117 | |
| 118 | extern _X_EXPORT void |
| 119 | |
| 120 | miCompositeRects(CARD8 op, |
| 121 | PicturePtr pDst, |
| 122 | xRenderColor * color, int nRect, xRectangle *rects); |
| 123 | |
| 124 | extern _X_EXPORT void |
| 125 | |
| 126 | miTriStrip(CARD8 op, |
| 127 | PicturePtr pSrc, |
| 128 | PicturePtr pDst, |
| 129 | PictFormatPtr maskFormat, |
| 130 | INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points); |
| 131 | |
| 132 | extern _X_EXPORT void |
| 133 | |
| 134 | miTriFan(CARD8 op, |
| 135 | PicturePtr pSrc, |
| 136 | PicturePtr pDst, |
| 137 | PictFormatPtr maskFormat, |
| 138 | INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points); |
| 139 | |
| 140 | extern _X_EXPORT void |
| 141 | miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box); |
| 142 | |
| 143 | extern _X_EXPORT void |
| 144 | miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds); |
| 145 | |
| 146 | extern _X_EXPORT void |
| 147 | miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds); |
| 148 | |
| 149 | extern _X_EXPORT Bool |
| 150 | miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat); |
| 151 | |
| 152 | extern _X_EXPORT void |
| 153 | miCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat); |
| 154 | |
| 155 | extern _X_EXPORT void |
| 156 | |
| 157 | miUpdateIndexed(ScreenPtr pScreen, |
| 158 | PictFormatPtr pFormat, int ndef, xColorItem * pdef); |
| 159 | |
| 160 | #endif /* _MIPICT_H_ */ |