45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright © 2000 SuSE, Inc.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission to use, copy, modify, distribute, and sell this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsync * documentation for any purpose is hereby granted without fee, provided that
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the above copyright notice appear in all copies and that both that
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copyright notice and this permission notice appear in supporting
45e9809aff7304721fddb95654901b32195c9c7avboxsync * documentation, and that the name of SuSE not be used in advertising or
45e9809aff7304721fddb95654901b32195c9c7avboxsync * publicity pertaining to distribution of the software without specific,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * written prior permission. SuSE makes no representations about the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * suitability of this software for any purpose. It is provided "as is"
45e9809aff7304721fddb95654901b32195c9c7avboxsync * without express or implied warranty.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
45e9809aff7304721fddb95654901b32195c9c7avboxsync * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
45e9809aff7304721fddb95654901b32195c9c7avboxsync * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
45e9809aff7304721fddb95654901b32195c9c7avboxsync * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
45e9809aff7304721fddb95654901b32195c9c7avboxsync * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Author: Keith Packard, SuSE, Inc.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef _MIPICT_H_
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define _MIPICT_H_
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "picturestr.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#if MI_MAX_INDEXED <= 256
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef CARD8 miIndexType;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _miIndexed {
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool color;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 rgba[MI_MAX_INDEXED];
45e9809aff7304721fddb95654901b32195c9c7avboxsync miIndexType ent[32768];
45e9809aff7304721fddb95654901b32195c9c7avboxsync} miIndexedRec, *miIndexedPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (((s) >> 6) & 0x03e0) | \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (((s) >> 9) & 0x7c00))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15])
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiCreatePicture (PicturePtr pPicture);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiDestroyPicture (PicturePtr pPicture);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiDestroyPictureClip (PicturePtr pPicture);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiChangePictureClip (PicturePtr pPicture,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int type,
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer value,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int n);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiChangePicture (PicturePtr pPicture,
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask mask);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiValidatePicture (PicturePtr pPicture,
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask mask);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiChangePictureTransform (PicturePtr pPicture,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictTransform *transform);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiChangePictureFilter (PicturePtr pPicture,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int filter,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xFixed *params,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int nparams);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiCompositeSourceValidate (PicturePtr pPicture,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 x,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 y,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 width,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 height);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT Bool
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiComputeCompositeRegion (RegionPtr pRegion,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pMask,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 xSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 ySrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 xMask,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 yMask,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 xDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 yDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 width,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 height);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT Bool
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT Bool
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiRealizeGlyph (ScreenPtr pScreen,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GlyphPtr glyph);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiUnrealizeGlyph (ScreenPtr pScreen,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GlyphPtr glyph);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiGlyphs (CARD8 op,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr maskFormat,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 xSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 ySrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int nlist,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GlyphListPtr list,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GlyphPtr *glyphs);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiRenderColorToPixel (PictFormatPtr pPict,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xRenderColor *color,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 *pixel);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiRenderPixelToColor (PictFormatPtr pPict,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 pixel,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xRenderColor *color);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT Bool
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiIsSolidAlpha (PicturePtr pSrc);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiCompositeRects (CARD8 op,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xRenderColor *color,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int nRect,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xRectangle *rects);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiTrapezoids (CARD8 op,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr maskFormat,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 xSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 ySrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int ntrap,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xTrapezoid *traps);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiTriangles (CARD8 op,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr maskFormat,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 xSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 ySrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int ntri,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xTriangle *tris);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiTriStrip (CARD8 op,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr maskFormat,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 xSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 ySrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int npoint,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xPointFixed *points);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiTriFan (CARD8 op,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr maskFormat,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 xSrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync INT16 ySrc,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int npoint,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xPointFixed *points);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT PicturePtr
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiCreateAlphaPicture (ScreenPtr pScreen,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PicturePtr pDst,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr pPictFormat,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 width,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 height);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT Bool
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiInitIndexed (ScreenPtr pScreen,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr pFormat);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiCloseIndexed (ScreenPtr pScreen,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr pFormat);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void
45e9809aff7304721fddb95654901b32195c9c7avboxsyncmiUpdateIndexed (ScreenPtr pScreen,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PictFormatPtr pFormat,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int ndef,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xColorItem *pdef);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* _MIPICT_H_ */