mipict.h revision 05b261ec
105b261ecSmrg/* 205b261ecSmrg * 305b261ecSmrg * Copyright © 2000 SuSE, Inc. 405b261ecSmrg * 505b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its 605b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that 705b261ecSmrg * the above copyright notice appear in all copies and that both that 805b261ecSmrg * copyright notice and this permission notice appear in supporting 905b261ecSmrg * documentation, and that the name of SuSE not be used in advertising or 1005b261ecSmrg * publicity pertaining to distribution of the software without specific, 1105b261ecSmrg * written prior permission. SuSE makes no representations about the 1205b261ecSmrg * suitability of this software for any purpose. It is provided "as is" 1305b261ecSmrg * without express or implied warranty. 1405b261ecSmrg * 1505b261ecSmrg * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 1605b261ecSmrg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE 1705b261ecSmrg * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1805b261ecSmrg * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 1905b261ecSmrg * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 2005b261ecSmrg * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 2105b261ecSmrg * 2205b261ecSmrg * Author: Keith Packard, SuSE, Inc. 2305b261ecSmrg */ 2405b261ecSmrg 2505b261ecSmrg#ifndef _MIPICT_H_ 2605b261ecSmrg#define _MIPICT_H_ 2705b261ecSmrg 2805b261ecSmrg#include "picturestr.h" 2905b261ecSmrg 3005b261ecSmrg#define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */ 3105b261ecSmrg 3205b261ecSmrg#if MI_MAX_INDEXED <= 256 3305b261ecSmrgtypedef CARD8 miIndexType; 3405b261ecSmrg#endif 3505b261ecSmrg 3605b261ecSmrgtypedef struct _miIndexed { 3705b261ecSmrg Bool color; 3805b261ecSmrg CARD32 rgba[MI_MAX_INDEXED]; 3905b261ecSmrg miIndexType ent[32768]; 4005b261ecSmrg} miIndexedRec, *miIndexedPtr; 4105b261ecSmrg 4205b261ecSmrg#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \ 4305b261ecSmrg (((s) >> 6) & 0x03e0) | \ 4405b261ecSmrg (((s) >> 9) & 0x7c00)) 4505b261ecSmrg#define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15]) 4605b261ecSmrg#define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24)) 4705b261ecSmrg 4805b261ecSmrg#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)]) 4905b261ecSmrg 5005b261ecSmrgint 5105b261ecSmrgmiCreatePicture (PicturePtr pPicture); 5205b261ecSmrg 5305b261ecSmrgvoid 5405b261ecSmrgmiDestroyPicture (PicturePtr pPicture); 5505b261ecSmrg 5605b261ecSmrgvoid 5705b261ecSmrgmiDestroyPictureClip (PicturePtr pPicture); 5805b261ecSmrg 5905b261ecSmrgint 6005b261ecSmrgmiChangePictureClip (PicturePtr pPicture, 6105b261ecSmrg int type, 6205b261ecSmrg pointer value, 6305b261ecSmrg int n); 6405b261ecSmrg 6505b261ecSmrgvoid 6605b261ecSmrgmiChangePicture (PicturePtr pPicture, 6705b261ecSmrg Mask mask); 6805b261ecSmrg 6905b261ecSmrgvoid 7005b261ecSmrgmiValidatePicture (PicturePtr pPicture, 7105b261ecSmrg Mask mask); 7205b261ecSmrg 7305b261ecSmrgint 7405b261ecSmrgmiChangePictureTransform (PicturePtr pPicture, 7505b261ecSmrg PictTransform *transform); 7605b261ecSmrg 7705b261ecSmrgint 7805b261ecSmrgmiChangePictureFilter (PicturePtr pPicture, 7905b261ecSmrg int filter, 8005b261ecSmrg xFixed *params, 8105b261ecSmrg int nparams); 8205b261ecSmrg 8305b261ecSmrgBool 8405b261ecSmrgmiClipPicture (RegionPtr pRegion, 8505b261ecSmrg PicturePtr pPicture, 8605b261ecSmrg INT16 xReg, 8705b261ecSmrg INT16 yReg, 8805b261ecSmrg INT16 xPict, 8905b261ecSmrg INT16 yPict); 9005b261ecSmrg 9105b261ecSmrgvoid 9205b261ecSmrgmiCompositeSourceValidate (PicturePtr pPicture, 9305b261ecSmrg INT16 x, 9405b261ecSmrg INT16 y, 9505b261ecSmrg CARD16 width, 9605b261ecSmrg CARD16 height); 9705b261ecSmrgBool 9805b261ecSmrgmiComputeCompositeRegion (RegionPtr pRegion, 9905b261ecSmrg PicturePtr pSrc, 10005b261ecSmrg PicturePtr pMask, 10105b261ecSmrg PicturePtr pDst, 10205b261ecSmrg INT16 xSrc, 10305b261ecSmrg INT16 ySrc, 10405b261ecSmrg INT16 xMask, 10505b261ecSmrg INT16 yMask, 10605b261ecSmrg INT16 xDst, 10705b261ecSmrg INT16 yDst, 10805b261ecSmrg CARD16 width, 10905b261ecSmrg CARD16 height); 11005b261ecSmrg 11105b261ecSmrgBool 11205b261ecSmrgmiPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); 11305b261ecSmrg 11405b261ecSmrgBool 11505b261ecSmrgmiRealizeGlyph (ScreenPtr pScreen, 11605b261ecSmrg GlyphPtr glyph); 11705b261ecSmrg 11805b261ecSmrgvoid 11905b261ecSmrgmiUnrealizeGlyph (ScreenPtr pScreen, 12005b261ecSmrg GlyphPtr glyph); 12105b261ecSmrg 12205b261ecSmrgvoid 12305b261ecSmrgmiGlyphExtents (int nlist, 12405b261ecSmrg GlyphListPtr list, 12505b261ecSmrg GlyphPtr *glyphs, 12605b261ecSmrg BoxPtr extents); 12705b261ecSmrg 12805b261ecSmrgvoid 12905b261ecSmrgmiGlyphs (CARD8 op, 13005b261ecSmrg PicturePtr pSrc, 13105b261ecSmrg PicturePtr pDst, 13205b261ecSmrg PictFormatPtr maskFormat, 13305b261ecSmrg INT16 xSrc, 13405b261ecSmrg INT16 ySrc, 13505b261ecSmrg int nlist, 13605b261ecSmrg GlyphListPtr list, 13705b261ecSmrg GlyphPtr *glyphs); 13805b261ecSmrg 13905b261ecSmrgvoid 14005b261ecSmrgmiRenderColorToPixel (PictFormatPtr pPict, 14105b261ecSmrg xRenderColor *color, 14205b261ecSmrg CARD32 *pixel); 14305b261ecSmrg 14405b261ecSmrgvoid 14505b261ecSmrgmiRenderPixelToColor (PictFormatPtr pPict, 14605b261ecSmrg CARD32 pixel, 14705b261ecSmrg xRenderColor *color); 14805b261ecSmrg 14905b261ecSmrgBool 15005b261ecSmrgmiIsSolidAlpha (PicturePtr pSrc); 15105b261ecSmrg 15205b261ecSmrgvoid 15305b261ecSmrgmiCompositeRects (CARD8 op, 15405b261ecSmrg PicturePtr pDst, 15505b261ecSmrg xRenderColor *color, 15605b261ecSmrg int nRect, 15705b261ecSmrg xRectangle *rects); 15805b261ecSmrg 15905b261ecSmrgvoid 16005b261ecSmrgmiTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box); 16105b261ecSmrg 16205b261ecSmrgvoid 16305b261ecSmrgmiTrapezoids (CARD8 op, 16405b261ecSmrg PicturePtr pSrc, 16505b261ecSmrg PicturePtr pDst, 16605b261ecSmrg PictFormatPtr maskFormat, 16705b261ecSmrg INT16 xSrc, 16805b261ecSmrg INT16 ySrc, 16905b261ecSmrg int ntrap, 17005b261ecSmrg xTrapezoid *traps); 17105b261ecSmrg 17205b261ecSmrgvoid 17305b261ecSmrgmiPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds); 17405b261ecSmrg 17505b261ecSmrgvoid 17605b261ecSmrgmiTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds); 17705b261ecSmrg 17805b261ecSmrgvoid 17905b261ecSmrgmiRasterizeTriangle (PicturePtr pMask, 18005b261ecSmrg xTriangle *tri, 18105b261ecSmrg int x_off, 18205b261ecSmrg int y_off); 18305b261ecSmrg 18405b261ecSmrgvoid 18505b261ecSmrgmiTriangles (CARD8 op, 18605b261ecSmrg PicturePtr pSrc, 18705b261ecSmrg PicturePtr pDst, 18805b261ecSmrg PictFormatPtr maskFormat, 18905b261ecSmrg INT16 xSrc, 19005b261ecSmrg INT16 ySrc, 19105b261ecSmrg int ntri, 19205b261ecSmrg xTriangle *tris); 19305b261ecSmrg 19405b261ecSmrgvoid 19505b261ecSmrgmiTriStrip (CARD8 op, 19605b261ecSmrg PicturePtr pSrc, 19705b261ecSmrg PicturePtr pDst, 19805b261ecSmrg PictFormatPtr maskFormat, 19905b261ecSmrg INT16 xSrc, 20005b261ecSmrg INT16 ySrc, 20105b261ecSmrg int npoint, 20205b261ecSmrg xPointFixed *points); 20305b261ecSmrg 20405b261ecSmrgvoid 20505b261ecSmrgmiTriFan (CARD8 op, 20605b261ecSmrg PicturePtr pSrc, 20705b261ecSmrg PicturePtr pDst, 20805b261ecSmrg PictFormatPtr maskFormat, 20905b261ecSmrg INT16 xSrc, 21005b261ecSmrg INT16 ySrc, 21105b261ecSmrg int npoint, 21205b261ecSmrg xPointFixed *points); 21305b261ecSmrg 21405b261ecSmrgPicturePtr 21505b261ecSmrgmiCreateAlphaPicture (ScreenPtr pScreen, 21605b261ecSmrg PicturePtr pDst, 21705b261ecSmrg PictFormatPtr pPictFormat, 21805b261ecSmrg CARD16 width, 21905b261ecSmrg CARD16 height); 22005b261ecSmrg 22105b261ecSmrgBool 22205b261ecSmrgmiInitIndexed (ScreenPtr pScreen, 22305b261ecSmrg PictFormatPtr pFormat); 22405b261ecSmrg 22505b261ecSmrgvoid 22605b261ecSmrgmiCloseIndexed (ScreenPtr pScreen, 22705b261ecSmrg PictFormatPtr pFormat); 22805b261ecSmrg 22905b261ecSmrgvoid 23005b261ecSmrgmiUpdateIndexed (ScreenPtr pScreen, 23105b261ecSmrg PictFormatPtr pFormat, 23205b261ecSmrg int ndef, 23305b261ecSmrg xColorItem *pdef); 23405b261ecSmrg 23505b261ecSmrg#endif /* _MIPICT_H_ */ 236