mipict.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. #ifndef _MIPICT_H_
  25. #define _MIPICT_H_
  26. #include "picturestr.h"
  27. #define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
  28. #if MI_MAX_INDEXED <= 256
  29. typedef CARD8 miIndexType;
  30. #endif
  31. typedef struct _miIndexed {
  32. Bool color;
  33. CARD32 rgba[MI_MAX_INDEXED];
  34. miIndexType ent[32768];
  35. } miIndexedRec, *miIndexedPtr;
  36. #define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
  37. (((s) >> 6) & 0x03e0) | \
  38. (((s) >> 9) & 0x7c00))
  39. #define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15])
  40. #define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24))
  41. #define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
  42. int
  43. miCreatePicture(PicturePtr pPicture);
  44. void
  45. miDestroyPicture(PicturePtr pPicture);
  46. void
  47. miDestroyPictureClip(PicturePtr pPicture);
  48. int
  49. miChangePictureClip(PicturePtr pPicture, int type, pointer value, int n);
  50. void
  51. miChangePicture(PicturePtr pPicture, Mask mask);
  52. void
  53. miValidatePicture(PicturePtr pPicture, Mask mask);
  54. int
  55. miChangePictureTransform(PicturePtr pPicture, PictTransform * transform);
  56. int
  57. miChangePictureFilter(PicturePtr pPicture,
  58. int filter, xFixed * params, int nparams);
  59. Bool
  60. miClipPicture(RegionPtr pRegion,
  61. PicturePtr pPicture,
  62. INT16 xReg, INT16 yReg, INT16 xPict, INT16 yPict);
  63. Bool
  64. miComputeCompositeRegion(RegionPtr pRegion,
  65. PicturePtr pSrc,
  66. PicturePtr pMask,
  67. PicturePtr pDst,
  68. INT16 xSrc,
  69. INT16 ySrc,
  70. INT16 xMask,
  71. INT16 yMask,
  72. INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
  73. Bool
  74. miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
  75. Bool
  76. miRealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph);
  77. void
  78. miUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph);
  79. void
  80. miGlyphExtents(int nlist, GlyphListPtr list, GlyphPtr * glyphs, BoxPtr extents);
  81. void
  82. miGlyphs(CARD8 op,
  83. PicturePtr pSrc,
  84. PicturePtr pDst,
  85. PictFormatPtr maskFormat,
  86. INT16 xSrc,
  87. INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs);
  88. void
  89. miRenderColorToPixel(PictFormatPtr pPict, xRenderColor * color, CARD32 *pixel);
  90. void
  91. miRenderPixelToColor(PictFormatPtr pPict, CARD32 pixel, xRenderColor * color);
  92. Bool
  93. miIsSolidAlpha(PicturePtr pSrc);
  94. void
  95. miCompositeRects(CARD8 op,
  96. PicturePtr pDst,
  97. xRenderColor * color, int nRect, xRectangle *rects);
  98. void
  99. miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box);
  100. void
  101. miTrapezoids(CARD8 op,
  102. PicturePtr pSrc,
  103. PicturePtr pDst,
  104. PictFormatPtr maskFormat,
  105. INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps);
  106. void
  107. miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds);
  108. void
  109. miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds);
  110. void
  111. miRasterizeTriangle(PicturePtr pMask, xTriangle * tri, int x_off, int y_off);
  112. void
  113. miTriangles(CARD8 op,
  114. PicturePtr pSrc,
  115. PicturePtr pDst,
  116. PictFormatPtr maskFormat,
  117. INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris);
  118. void
  119. miTriStrip(CARD8 op,
  120. PicturePtr pSrc,
  121. PicturePtr pDst,
  122. PictFormatPtr maskFormat,
  123. INT16 xSrc, INT16 ySrc, int npoint, xPointFixed * points);
  124. void
  125. miTriFan(CARD8 op,
  126. PicturePtr pSrc,
  127. PicturePtr pDst,
  128. PictFormatPtr maskFormat,
  129. INT16 xSrc, INT16 ySrc, int npoint, xPointFixed * points);
  130. PicturePtr
  131. miCreateAlphaPicture(ScreenPtr pScreen,
  132. PicturePtr pDst,
  133. PictFormatPtr pPictFormat, CARD16 width, CARD16 height);
  134. Bool
  135. miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
  136. void
  137. miCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
  138. void
  139. miUpdateIndexed(ScreenPtr pScreen,
  140. PictFormatPtr pFormat, int ndef, xColorItem * pdef);
  141. #endif /* _MIPICT_H_ */