pixman.h revision 7e806d9d
1b4b94579Smrg/*********************************************************** 2b4b94579Smrg 3b4b94579SmrgCopyright 1987, 1998 The Open Group 4b4b94579Smrg 5b4b94579SmrgPermission to use, copy, modify, distribute, and sell this software and its 6b4b94579Smrgdocumentation for any purpose is hereby granted without fee, provided that 7b4b94579Smrgthe above copyright notice appear in all copies and that both that 8b4b94579Smrgcopyright notice and this permission notice appear in supporting 9b4b94579Smrgdocumentation. 10b4b94579Smrg 11b4b94579SmrgThe above copyright notice and this permission notice shall be included in 12b4b94579Smrgall copies or substantial portions of the Software. 13b4b94579Smrg 14b4b94579SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15b4b94579SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16b4b94579SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17b4b94579SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 18b4b94579SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19b4b94579SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20b4b94579Smrg 21b4b94579SmrgExcept as contained in this notice, the name of The Open Group shall not be 22b4b94579Smrgused in advertising or otherwise to promote the sale, use or other dealings 23b4b94579Smrgin this Software without prior written authorization from The Open Group. 24b4b94579Smrg 25b4b94579SmrgCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. 26b4b94579Smrg 27b4b94579Smrg All Rights Reserved 28b4b94579Smrg 29b4b94579SmrgPermission to use, copy, modify, and distribute this software and its 30b4b94579Smrgdocumentation for any purpose and without fee is hereby granted, 31b4b94579Smrgprovided that the above copyright notice appear in all copies and that 32b4b94579Smrgboth that copyright notice and this permission notice appear in 33b4b94579Smrgsupporting documentation, and that the name of Digital not be 34b4b94579Smrgused in advertising or publicity pertaining to distribution of the 35b4b94579Smrgsoftware without specific, written prior permission. 36b4b94579Smrg 37b4b94579SmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 38b4b94579SmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 39b4b94579SmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 40b4b94579SmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 41b4b94579SmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 42b4b94579SmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 43b4b94579SmrgSOFTWARE. 44b4b94579Smrg 45b4b94579Smrg******************************************************************/ 46b4b94579Smrg/* 47b4b94579Smrg * Copyright © 1998, 2004 Keith Packard 48b4b94579Smrg * Copyright 2007 Red Hat, Inc. 49b4b94579Smrg * 50b4b94579Smrg * Permission to use, copy, modify, distribute, and sell this software and its 51b4b94579Smrg * documentation for any purpose is hereby granted without fee, provided that 52b4b94579Smrg * the above copyright notice appear in all copies and that both that 53b4b94579Smrg * copyright notice and this permission notice appear in supporting 54b4b94579Smrg * documentation, and that the name of Keith Packard not be used in 55b4b94579Smrg * advertising or publicity pertaining to distribution of the software without 56b4b94579Smrg * specific, written prior permission. Keith Packard makes no 57b4b94579Smrg * representations about the suitability of this software for any purpose. It 58b4b94579Smrg * is provided "as is" without express or implied warranty. 59b4b94579Smrg * 60b4b94579Smrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 61b4b94579Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 62b4b94579Smrg * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR 63b4b94579Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 64b4b94579Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 65b4b94579Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 66b4b94579Smrg * PERFORMANCE OF THIS SOFTWARE. 67b4b94579Smrg */ 68b4b94579Smrg 69b4b94579Smrg#ifndef PIXMAN_H__ 70b4b94579Smrg#define PIXMAN_H__ 71b4b94579Smrg 72b4b94579Smrg#include <pixman-version.h> 73b4b94579Smrg 74952204abSmrg#ifdef __cplusplus 75952204abSmrg#define PIXMAN_BEGIN_DECLS extern "C" { 76952204abSmrg#define PIXMAN_END_DECLS } 77952204abSmrg#else 78952204abSmrg#define PIXMAN_BEGIN_DECLS 79952204abSmrg#define PIXMAN_END_DECLS 80952204abSmrg#endif 81952204abSmrg 82952204abSmrgPIXMAN_BEGIN_DECLS 83952204abSmrg 84b4b94579Smrg/* 85b4b94579Smrg * Standard integers 86b4b94579Smrg */ 87952204abSmrg 88952204abSmrg#if !defined (PIXMAN_DONT_DEFINE_STDINT) 89952204abSmrg 90952204abSmrg#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__) || defined (__HP_cc) 91b4b94579Smrg# include <inttypes.h> 92952204abSmrg/* VS 2010 (_MSC_VER 1600) has stdint.h */ 93952204abSmrg#elif defined (_MSC_VER) && _MSC_VER < 1600 94b4b94579Smrgtypedef __int8 int8_t; 95b4b94579Smrgtypedef unsigned __int8 uint8_t; 96b4b94579Smrgtypedef __int16 int16_t; 97b4b94579Smrgtypedef unsigned __int16 uint16_t; 98b4b94579Smrgtypedef __int32 int32_t; 99b4b94579Smrgtypedef unsigned __int32 uint32_t; 100b4b94579Smrgtypedef __int64 int64_t; 101b4b94579Smrgtypedef unsigned __int64 uint64_t; 10227693ee9Sveego#elif defined (_AIX) 10327693ee9Sveego# include <sys/inttypes.h> 104b4b94579Smrg#else 105b4b94579Smrg# include <stdint.h> 106b4b94579Smrg#endif 107b4b94579Smrg 108952204abSmrg#endif 109952204abSmrg 110b4b94579Smrg/* 111b4b94579Smrg * Boolean 112b4b94579Smrg */ 113b4b94579Smrgtypedef int pixman_bool_t; 114b4b94579Smrg 115b4b94579Smrg/* 116b4b94579Smrg * Fixpoint numbers 117b4b94579Smrg */ 118b4b94579Smrgtypedef int64_t pixman_fixed_32_32_t; 119b4b94579Smrgtypedef pixman_fixed_32_32_t pixman_fixed_48_16_t; 120b4b94579Smrgtypedef uint32_t pixman_fixed_1_31_t; 121b4b94579Smrgtypedef uint32_t pixman_fixed_1_16_t; 122b4b94579Smrgtypedef int32_t pixman_fixed_16_16_t; 123b4b94579Smrgtypedef pixman_fixed_16_16_t pixman_fixed_t; 124b4b94579Smrg 125b4b94579Smrg#define pixman_fixed_e ((pixman_fixed_t) 1) 126b4b94579Smrg#define pixman_fixed_1 (pixman_int_to_fixed(1)) 127b4b94579Smrg#define pixman_fixed_1_minus_e (pixman_fixed_1 - pixman_fixed_e) 128952204abSmrg#define pixman_fixed_minus_1 (pixman_int_to_fixed(-1)) 129b4b94579Smrg#define pixman_fixed_to_int(f) ((int) ((f) >> 16)) 1307e806d9dSmrg#define pixman_int_to_fixed(i) ((pixman_fixed_t) ((uint32_t) (i) << 16)) 131b4b94579Smrg#define pixman_fixed_to_double(f) (double) ((f) / (double) pixman_fixed_1) 132b4b94579Smrg#define pixman_double_to_fixed(d) ((pixman_fixed_t) ((d) * 65536.0)) 133b4b94579Smrg#define pixman_fixed_frac(f) ((f) & pixman_fixed_1_minus_e) 134b4b94579Smrg#define pixman_fixed_floor(f) ((f) & ~pixman_fixed_1_minus_e) 135b4b94579Smrg#define pixman_fixed_ceil(f) pixman_fixed_floor ((f) + pixman_fixed_1_minus_e) 136b4b94579Smrg#define pixman_fixed_fraction(f) ((f) & pixman_fixed_1_minus_e) 137b4b94579Smrg#define pixman_fixed_mod_2(f) ((f) & (pixman_fixed1 | pixman_fixed_1_minus_e)) 138b4b94579Smrg#define pixman_max_fixed_48_16 ((pixman_fixed_48_16_t) 0x7fffffff) 139b4b94579Smrg#define pixman_min_fixed_48_16 (-((pixman_fixed_48_16_t) 1 << 31)) 140b4b94579Smrg 141b4b94579Smrg/* 142b4b94579Smrg * Misc structs 143b4b94579Smrg */ 144b4b94579Smrgtypedef struct pixman_color pixman_color_t; 145b4b94579Smrgtypedef struct pixman_point_fixed pixman_point_fixed_t; 146b4b94579Smrgtypedef struct pixman_line_fixed pixman_line_fixed_t; 147b4b94579Smrgtypedef struct pixman_vector pixman_vector_t; 148b4b94579Smrgtypedef struct pixman_transform pixman_transform_t; 149b4b94579Smrg 150b4b94579Smrgstruct pixman_color 151b4b94579Smrg{ 152b4b94579Smrg uint16_t red; 153b4b94579Smrg uint16_t green; 154b4b94579Smrg uint16_t blue; 155b4b94579Smrg uint16_t alpha; 156b4b94579Smrg}; 157b4b94579Smrg 158b4b94579Smrgstruct pixman_point_fixed 159b4b94579Smrg{ 160b4b94579Smrg pixman_fixed_t x; 161b4b94579Smrg pixman_fixed_t y; 162b4b94579Smrg}; 163b4b94579Smrg 164b4b94579Smrgstruct pixman_line_fixed 165b4b94579Smrg{ 166b4b94579Smrg pixman_point_fixed_t p1, p2; 167b4b94579Smrg}; 168b4b94579Smrg 169317c648bSmrg/* 170317c648bSmrg * Fixed point matrices 171317c648bSmrg */ 172317c648bSmrg 173b4b94579Smrgstruct pixman_vector 174b4b94579Smrg{ 175b4b94579Smrg pixman_fixed_t vector[3]; 176b4b94579Smrg}; 177b4b94579Smrg 178b4b94579Smrgstruct pixman_transform 179b4b94579Smrg{ 180b4b94579Smrg pixman_fixed_t matrix[3][3]; 181b4b94579Smrg}; 182b4b94579Smrg 183317c648bSmrg/* forward declaration (sorry) */ 184317c648bSmrgstruct pixman_box16; 185952204abSmrgtypedef union pixman_image pixman_image_t; 186317c648bSmrg 187d0321353Smrgvoid pixman_transform_init_identity (struct pixman_transform *matrix); 188d0321353Smrgpixman_bool_t pixman_transform_point_3d (const struct pixman_transform *transform, 189d0321353Smrg struct pixman_vector *vector); 190d0321353Smrgpixman_bool_t pixman_transform_point (const struct pixman_transform *transform, 191d0321353Smrg struct pixman_vector *vector); 192d0321353Smrgpixman_bool_t pixman_transform_multiply (struct pixman_transform *dst, 193d0321353Smrg const struct pixman_transform *l, 194d0321353Smrg const struct pixman_transform *r); 195d0321353Smrgvoid pixman_transform_init_scale (struct pixman_transform *t, 196d0321353Smrg pixman_fixed_t sx, 197d0321353Smrg pixman_fixed_t sy); 198d0321353Smrgpixman_bool_t pixman_transform_scale (struct pixman_transform *forward, 199d0321353Smrg struct pixman_transform *reverse, 200d0321353Smrg pixman_fixed_t sx, 201d0321353Smrg pixman_fixed_t sy); 202d0321353Smrgvoid pixman_transform_init_rotate (struct pixman_transform *t, 203d0321353Smrg pixman_fixed_t cos, 204d0321353Smrg pixman_fixed_t sin); 205d0321353Smrgpixman_bool_t pixman_transform_rotate (struct pixman_transform *forward, 206d0321353Smrg struct pixman_transform *reverse, 207d0321353Smrg pixman_fixed_t c, 208d0321353Smrg pixman_fixed_t s); 209d0321353Smrgvoid pixman_transform_init_translate (struct pixman_transform *t, 210d0321353Smrg pixman_fixed_t tx, 211d0321353Smrg pixman_fixed_t ty); 212d0321353Smrgpixman_bool_t pixman_transform_translate (struct pixman_transform *forward, 213d0321353Smrg struct pixman_transform *reverse, 214d0321353Smrg pixman_fixed_t tx, 215d0321353Smrg pixman_fixed_t ty); 216d0321353Smrgpixman_bool_t pixman_transform_bounds (const struct pixman_transform *matrix, 217d0321353Smrg struct pixman_box16 *b); 218d0321353Smrgpixman_bool_t pixman_transform_invert (struct pixman_transform *dst, 219d0321353Smrg const struct pixman_transform *src); 220d0321353Smrgpixman_bool_t pixman_transform_is_identity (const struct pixman_transform *t); 221d0321353Smrgpixman_bool_t pixman_transform_is_scale (const struct pixman_transform *t); 222d0321353Smrgpixman_bool_t pixman_transform_is_int_translate (const struct pixman_transform *t); 223d0321353Smrgpixman_bool_t pixman_transform_is_inverse (const struct pixman_transform *a, 224d0321353Smrg const struct pixman_transform *b); 225317c648bSmrg 226317c648bSmrg/* 227317c648bSmrg * Floating point matrices 228317c648bSmrg */ 2299a0cb412Smrgtypedef struct pixman_f_transform pixman_f_transform_t; 2309a0cb412Smrgtypedef struct pixman_f_vector pixman_f_vector_t; 2319a0cb412Smrg 232d0321353Smrgstruct pixman_f_vector 233d0321353Smrg{ 234317c648bSmrg double v[3]; 235317c648bSmrg}; 236317c648bSmrg 237d0321353Smrgstruct pixman_f_transform 238d0321353Smrg{ 239317c648bSmrg double m[3][3]; 240317c648bSmrg}; 241317c648bSmrg 242d0321353Smrgpixman_bool_t pixman_transform_from_pixman_f_transform (struct pixman_transform *t, 243d0321353Smrg const struct pixman_f_transform *ft); 244d0321353Smrgvoid pixman_f_transform_from_pixman_transform (struct pixman_f_transform *ft, 245d0321353Smrg const struct pixman_transform *t); 246d0321353Smrgpixman_bool_t pixman_f_transform_invert (struct pixman_f_transform *dst, 247d0321353Smrg const struct pixman_f_transform *src); 248d0321353Smrgpixman_bool_t pixman_f_transform_point (const struct pixman_f_transform *t, 249d0321353Smrg struct pixman_f_vector *v); 250d0321353Smrgvoid pixman_f_transform_point_3d (const struct pixman_f_transform *t, 251d0321353Smrg struct pixman_f_vector *v); 252d0321353Smrgvoid pixman_f_transform_multiply (struct pixman_f_transform *dst, 253d0321353Smrg const struct pixman_f_transform *l, 254d0321353Smrg const struct pixman_f_transform *r); 255d0321353Smrgvoid pixman_f_transform_init_scale (struct pixman_f_transform *t, 256d0321353Smrg double sx, 257d0321353Smrg double sy); 258d0321353Smrgpixman_bool_t pixman_f_transform_scale (struct pixman_f_transform *forward, 259d0321353Smrg struct pixman_f_transform *reverse, 260d0321353Smrg double sx, 261d0321353Smrg double sy); 262d0321353Smrgvoid pixman_f_transform_init_rotate (struct pixman_f_transform *t, 263d0321353Smrg double cos, 264d0321353Smrg double sin); 265d0321353Smrgpixman_bool_t pixman_f_transform_rotate (struct pixman_f_transform *forward, 266d0321353Smrg struct pixman_f_transform *reverse, 267d0321353Smrg double c, 268d0321353Smrg double s); 269d0321353Smrgvoid pixman_f_transform_init_translate (struct pixman_f_transform *t, 270d0321353Smrg double tx, 271d0321353Smrg double ty); 272d0321353Smrgpixman_bool_t pixman_f_transform_translate (struct pixman_f_transform *forward, 273d0321353Smrg struct pixman_f_transform *reverse, 274d0321353Smrg double tx, 275d0321353Smrg double ty); 276d0321353Smrgpixman_bool_t pixman_f_transform_bounds (const struct pixman_f_transform *t, 277d0321353Smrg struct pixman_box16 *b); 278d0321353Smrgvoid pixman_f_transform_init_identity (struct pixman_f_transform *t); 279317c648bSmrg 280b4b94579Smrgtypedef enum 281b4b94579Smrg{ 282b4b94579Smrg PIXMAN_REPEAT_NONE, 283b4b94579Smrg PIXMAN_REPEAT_NORMAL, 284b4b94579Smrg PIXMAN_REPEAT_PAD, 285b4b94579Smrg PIXMAN_REPEAT_REFLECT 286b4b94579Smrg} pixman_repeat_t; 287b4b94579Smrg 288b4b94579Smrgtypedef enum 289b4b94579Smrg{ 290b4b94579Smrg PIXMAN_FILTER_FAST, 291b4b94579Smrg PIXMAN_FILTER_GOOD, 292b4b94579Smrg PIXMAN_FILTER_BEST, 293b4b94579Smrg PIXMAN_FILTER_NEAREST, 294b4b94579Smrg PIXMAN_FILTER_BILINEAR, 2959a0cb412Smrg PIXMAN_FILTER_CONVOLUTION, 2969a0cb412Smrg 2979a0cb412Smrg /* The SEPARABLE_CONVOLUTION filter takes the following parameters: 2989a0cb412Smrg * 2999a0cb412Smrg * width: integer given as 16.16 fixpoint number 3009a0cb412Smrg * height: integer given as 16.16 fixpoint number 3019a0cb412Smrg * x_phase_bits: integer given as 16.16 fixpoint 3029a0cb412Smrg * y_phase_bits: integer given as 16.16 fixpoint 3039a0cb412Smrg * xtables: (1 << x_phase_bits) tables of size width 3049a0cb412Smrg * ytables: (1 << y_phase_bits) tables of size height 3059a0cb412Smrg * 3069a0cb412Smrg * When sampling at (x, y), the location is first rounded to one of 3079a0cb412Smrg * n_x_phases * n_y_phases subpixel positions. These subpixel positions 3089a0cb412Smrg * determine an xtable and a ytable to use. 3099a0cb412Smrg * 3109a0cb412Smrg * Conceptually a width x height matrix is then formed in which each entry 3119a0cb412Smrg * is the product of the corresponding entries in the x and y tables. 3129a0cb412Smrg * This matrix is then aligned with the image pixels such that its center 3139a0cb412Smrg * is as close as possible to the subpixel location chosen earlier. Then 3149a0cb412Smrg * the image is convolved with the matrix and the resulting pixel returned. 3159a0cb412Smrg */ 3169a0cb412Smrg PIXMAN_FILTER_SEPARABLE_CONVOLUTION 317b4b94579Smrg} pixman_filter_t; 318b4b94579Smrg 319b4b94579Smrgtypedef enum 320b4b94579Smrg{ 321b4b94579Smrg PIXMAN_OP_CLEAR = 0x00, 322b4b94579Smrg PIXMAN_OP_SRC = 0x01, 323b4b94579Smrg PIXMAN_OP_DST = 0x02, 324b4b94579Smrg PIXMAN_OP_OVER = 0x03, 325b4b94579Smrg PIXMAN_OP_OVER_REVERSE = 0x04, 326b4b94579Smrg PIXMAN_OP_IN = 0x05, 327b4b94579Smrg PIXMAN_OP_IN_REVERSE = 0x06, 328b4b94579Smrg PIXMAN_OP_OUT = 0x07, 329b4b94579Smrg PIXMAN_OP_OUT_REVERSE = 0x08, 330b4b94579Smrg PIXMAN_OP_ATOP = 0x09, 331b4b94579Smrg PIXMAN_OP_ATOP_REVERSE = 0x0a, 332b4b94579Smrg PIXMAN_OP_XOR = 0x0b, 333b4b94579Smrg PIXMAN_OP_ADD = 0x0c, 334b4b94579Smrg PIXMAN_OP_SATURATE = 0x0d, 335b4b94579Smrg 336b4b94579Smrg PIXMAN_OP_DISJOINT_CLEAR = 0x10, 337b4b94579Smrg PIXMAN_OP_DISJOINT_SRC = 0x11, 338b4b94579Smrg PIXMAN_OP_DISJOINT_DST = 0x12, 339b4b94579Smrg PIXMAN_OP_DISJOINT_OVER = 0x13, 340b4b94579Smrg PIXMAN_OP_DISJOINT_OVER_REVERSE = 0x14, 341b4b94579Smrg PIXMAN_OP_DISJOINT_IN = 0x15, 342b4b94579Smrg PIXMAN_OP_DISJOINT_IN_REVERSE = 0x16, 343b4b94579Smrg PIXMAN_OP_DISJOINT_OUT = 0x17, 344b4b94579Smrg PIXMAN_OP_DISJOINT_OUT_REVERSE = 0x18, 345b4b94579Smrg PIXMAN_OP_DISJOINT_ATOP = 0x19, 346b4b94579Smrg PIXMAN_OP_DISJOINT_ATOP_REVERSE = 0x1a, 347b4b94579Smrg PIXMAN_OP_DISJOINT_XOR = 0x1b, 348b4b94579Smrg 349b4b94579Smrg PIXMAN_OP_CONJOINT_CLEAR = 0x20, 350b4b94579Smrg PIXMAN_OP_CONJOINT_SRC = 0x21, 351b4b94579Smrg PIXMAN_OP_CONJOINT_DST = 0x22, 352b4b94579Smrg PIXMAN_OP_CONJOINT_OVER = 0x23, 353b4b94579Smrg PIXMAN_OP_CONJOINT_OVER_REVERSE = 0x24, 354b4b94579Smrg PIXMAN_OP_CONJOINT_IN = 0x25, 355b4b94579Smrg PIXMAN_OP_CONJOINT_IN_REVERSE = 0x26, 356b4b94579Smrg PIXMAN_OP_CONJOINT_OUT = 0x27, 357b4b94579Smrg PIXMAN_OP_CONJOINT_OUT_REVERSE = 0x28, 358b4b94579Smrg PIXMAN_OP_CONJOINT_ATOP = 0x29, 359b4b94579Smrg PIXMAN_OP_CONJOINT_ATOP_REVERSE = 0x2a, 360b4b94579Smrg PIXMAN_OP_CONJOINT_XOR = 0x2b, 361b4b94579Smrg 362dc259aabSmrg PIXMAN_OP_MULTIPLY = 0x30, 363dc259aabSmrg PIXMAN_OP_SCREEN = 0x31, 364dc259aabSmrg PIXMAN_OP_OVERLAY = 0x32, 365dc259aabSmrg PIXMAN_OP_DARKEN = 0x33, 366dc259aabSmrg PIXMAN_OP_LIGHTEN = 0x34, 367dc259aabSmrg PIXMAN_OP_COLOR_DODGE = 0x35, 368dc259aabSmrg PIXMAN_OP_COLOR_BURN = 0x36, 369dc259aabSmrg PIXMAN_OP_HARD_LIGHT = 0x37, 370dc259aabSmrg PIXMAN_OP_SOFT_LIGHT = 0x38, 371dc259aabSmrg PIXMAN_OP_DIFFERENCE = 0x39, 372dc259aabSmrg PIXMAN_OP_EXCLUSION = 0x3a, 373dc259aabSmrg PIXMAN_OP_HSL_HUE = 0x3b, 374dc259aabSmrg PIXMAN_OP_HSL_SATURATION = 0x3c, 375dc259aabSmrg PIXMAN_OP_HSL_COLOR = 0x3d, 376952204abSmrg PIXMAN_OP_HSL_LUMINOSITY = 0x3e 377dc259aabSmrg 378952204abSmrg#ifdef PIXMAN_USE_INTERNAL_API 379952204abSmrg , 380952204abSmrg PIXMAN_N_OPERATORS, 381afd9aa65Sapb PIXMAN_OP_NONE = PIXMAN_N_OPERATORS, 382afd9aa65Sapb PIXMAN_OP_any = PIXMAN_N_OPERATORS + 1 383952204abSmrg#endif 384b4b94579Smrg} pixman_op_t; 385b4b94579Smrg 386b4b94579Smrg/* 387b4b94579Smrg * Regions 388b4b94579Smrg */ 389b4b94579Smrgtypedef struct pixman_region16_data pixman_region16_data_t; 390b4b94579Smrgtypedef struct pixman_box16 pixman_box16_t; 391b4b94579Smrgtypedef struct pixman_rectangle16 pixman_rectangle16_t; 392b4b94579Smrgtypedef struct pixman_region16 pixman_region16_t; 393b4b94579Smrg 394b4b94579Smrgstruct pixman_region16_data { 395b4b94579Smrg long size; 396b4b94579Smrg long numRects; 397b4b94579Smrg/* pixman_box16_t rects[size]; in memory but not explicitly declared */ 398b4b94579Smrg}; 399b4b94579Smrg 400b4b94579Smrgstruct pixman_rectangle16 401b4b94579Smrg{ 402d0321353Smrg int16_t x, y; 403d0321353Smrg uint16_t width, height; 404b4b94579Smrg}; 405b4b94579Smrg 406b4b94579Smrgstruct pixman_box16 407b4b94579Smrg{ 408b4b94579Smrg int16_t x1, y1, x2, y2; 409b4b94579Smrg}; 410b4b94579Smrg 411b4b94579Smrgstruct pixman_region16 412b4b94579Smrg{ 413b4b94579Smrg pixman_box16_t extents; 414d0321353Smrg pixman_region16_data_t *data; 415b4b94579Smrg}; 416b4b94579Smrg 417b4b94579Smrgtypedef enum 418b4b94579Smrg{ 419b4b94579Smrg PIXMAN_REGION_OUT, 420b4b94579Smrg PIXMAN_REGION_IN, 421b4b94579Smrg PIXMAN_REGION_PART 422b4b94579Smrg} pixman_region_overlap_t; 423b4b94579Smrg 424d0321353Smrg/* This function exists only to make it possible to preserve 425d0321353Smrg * the X ABI - it should go away at first opportunity. 426b4b94579Smrg */ 427d0321353Smrgvoid pixman_region_set_static_pointers (pixman_box16_t *empty_box, 428d0321353Smrg pixman_region16_data_t *empty_data, 429d0321353Smrg pixman_region16_data_t *broken_data); 430b4b94579Smrg 431b4b94579Smrg/* creation/destruction */ 432d0321353Smrgvoid pixman_region_init (pixman_region16_t *region); 433d0321353Smrgvoid pixman_region_init_rect (pixman_region16_t *region, 434d0321353Smrg int x, 435d0321353Smrg int y, 436d0321353Smrg unsigned int width, 437d0321353Smrg unsigned int height); 438d0321353Smrgpixman_bool_t pixman_region_init_rects (pixman_region16_t *region, 439952204abSmrg const pixman_box16_t *boxes, 440d0321353Smrg int count); 441a1d8a91dSmrgvoid pixman_region_init_with_extents (pixman_region16_t *region, 442a1d8a91dSmrg pixman_box16_t *extents); 443952204abSmrgvoid pixman_region_init_from_image (pixman_region16_t *region, 444952204abSmrg pixman_image_t *image); 445d0321353Smrgvoid pixman_region_fini (pixman_region16_t *region); 446b4b94579Smrg 447b4b94579Smrg 448d0321353Smrg/* manipulation */ 449d0321353Smrgvoid pixman_region_translate (pixman_region16_t *region, 450d0321353Smrg int x, 451d0321353Smrg int y); 452a1d8a91dSmrgpixman_bool_t pixman_region_copy (pixman_region16_t *dest, 453a1d8a91dSmrg pixman_region16_t *source); 454a1d8a91dSmrgpixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg, 455a1d8a91dSmrg pixman_region16_t *reg1, 456a1d8a91dSmrg pixman_region16_t *reg2); 457a1d8a91dSmrgpixman_bool_t pixman_region_union (pixman_region16_t *new_reg, 458a1d8a91dSmrg pixman_region16_t *reg1, 459a1d8a91dSmrg pixman_region16_t *reg2); 460a1d8a91dSmrgpixman_bool_t pixman_region_union_rect (pixman_region16_t *dest, 461a1d8a91dSmrg pixman_region16_t *source, 462a1d8a91dSmrg int x, 463a1d8a91dSmrg int y, 464a1d8a91dSmrg unsigned int width, 465a1d8a91dSmrg unsigned int height); 466a1d8a91dSmrgpixman_bool_t pixman_region_intersect_rect (pixman_region16_t *dest, 467a1d8a91dSmrg pixman_region16_t *source, 468a1d8a91dSmrg int x, 469a1d8a91dSmrg int y, 470a1d8a91dSmrg unsigned int width, 471a1d8a91dSmrg unsigned int height); 472a1d8a91dSmrgpixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d, 473a1d8a91dSmrg pixman_region16_t *reg_m, 474a1d8a91dSmrg pixman_region16_t *reg_s); 475a1d8a91dSmrgpixman_bool_t pixman_region_inverse (pixman_region16_t *new_reg, 476a1d8a91dSmrg pixman_region16_t *reg1, 477a1d8a91dSmrg pixman_box16_t *inv_rect); 478a1d8a91dSmrgpixman_bool_t pixman_region_contains_point (pixman_region16_t *region, 479a1d8a91dSmrg int x, 480a1d8a91dSmrg int y, 481a1d8a91dSmrg pixman_box16_t *box); 482a1d8a91dSmrgpixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *region, 483a1d8a91dSmrg pixman_box16_t *prect); 484a1d8a91dSmrgpixman_bool_t pixman_region_not_empty (pixman_region16_t *region); 485a1d8a91dSmrgpixman_box16_t * pixman_region_extents (pixman_region16_t *region); 486a1d8a91dSmrgint pixman_region_n_rects (pixman_region16_t *region); 487a1d8a91dSmrgpixman_box16_t * pixman_region_rectangles (pixman_region16_t *region, 488a1d8a91dSmrg int *n_rects); 489a1d8a91dSmrgpixman_bool_t pixman_region_equal (pixman_region16_t *region1, 490a1d8a91dSmrg pixman_region16_t *region2); 491d0321353Smrgpixman_bool_t pixman_region_selfcheck (pixman_region16_t *region); 492a1d8a91dSmrgvoid pixman_region_reset (pixman_region16_t *region, 493a1d8a91dSmrg pixman_box16_t *box); 49481988197Sjmcneillvoid pixman_region_clear (pixman_region16_t *region); 495b4b94579Smrg/* 496b4b94579Smrg * 32 bit regions 497b4b94579Smrg */ 498b4b94579Smrgtypedef struct pixman_region32_data pixman_region32_data_t; 499b4b94579Smrgtypedef struct pixman_box32 pixman_box32_t; 500b4b94579Smrgtypedef struct pixman_rectangle32 pixman_rectangle32_t; 501b4b94579Smrgtypedef struct pixman_region32 pixman_region32_t; 502b4b94579Smrg 503b4b94579Smrgstruct pixman_region32_data { 504b4b94579Smrg long size; 505b4b94579Smrg long numRects; 506b4b94579Smrg/* pixman_box32_t rects[size]; in memory but not explicitly declared */ 507b4b94579Smrg}; 508b4b94579Smrg 509b4b94579Smrgstruct pixman_rectangle32 510b4b94579Smrg{ 511b4b94579Smrg int32_t x, y; 512b4b94579Smrg uint32_t width, height; 513b4b94579Smrg}; 514b4b94579Smrg 515b4b94579Smrgstruct pixman_box32 516b4b94579Smrg{ 517b4b94579Smrg int32_t x1, y1, x2, y2; 518b4b94579Smrg}; 519b4b94579Smrg 520b4b94579Smrgstruct pixman_region32 521b4b94579Smrg{ 522b4b94579Smrg pixman_box32_t extents; 523b4b94579Smrg pixman_region32_data_t *data; 524b4b94579Smrg}; 525b4b94579Smrg 526b4b94579Smrg/* creation/destruction */ 527b4b94579Smrgvoid pixman_region32_init (pixman_region32_t *region); 528b4b94579Smrgvoid pixman_region32_init_rect (pixman_region32_t *region, 529b4b94579Smrg int x, 530b4b94579Smrg int y, 531b4b94579Smrg unsigned int width, 532b4b94579Smrg unsigned int height); 533b4b94579Smrgpixman_bool_t pixman_region32_init_rects (pixman_region32_t *region, 534952204abSmrg const pixman_box32_t *boxes, 535b4b94579Smrg int count); 536a1d8a91dSmrgvoid pixman_region32_init_with_extents (pixman_region32_t *region, 537a1d8a91dSmrg pixman_box32_t *extents); 538952204abSmrgvoid pixman_region32_init_from_image (pixman_region32_t *region, 539952204abSmrg pixman_image_t *image); 540b4b94579Smrgvoid pixman_region32_fini (pixman_region32_t *region); 541b4b94579Smrg 542b4b94579Smrg 543b4b94579Smrg/* manipulation */ 544b4b94579Smrgvoid pixman_region32_translate (pixman_region32_t *region, 545b4b94579Smrg int x, 546b4b94579Smrg int y); 547a1d8a91dSmrgpixman_bool_t pixman_region32_copy (pixman_region32_t *dest, 548a1d8a91dSmrg pixman_region32_t *source); 549a1d8a91dSmrgpixman_bool_t pixman_region32_intersect (pixman_region32_t *new_reg, 550a1d8a91dSmrg pixman_region32_t *reg1, 551a1d8a91dSmrg pixman_region32_t *reg2); 552a1d8a91dSmrgpixman_bool_t pixman_region32_union (pixman_region32_t *new_reg, 553a1d8a91dSmrg pixman_region32_t *reg1, 554a1d8a91dSmrg pixman_region32_t *reg2); 555a1d8a91dSmrgpixman_bool_t pixman_region32_intersect_rect (pixman_region32_t *dest, 556a1d8a91dSmrg pixman_region32_t *source, 557a1d8a91dSmrg int x, 558a1d8a91dSmrg int y, 559a1d8a91dSmrg unsigned int width, 560a1d8a91dSmrg unsigned int height); 561a1d8a91dSmrgpixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest, 562a1d8a91dSmrg pixman_region32_t *source, 563a1d8a91dSmrg int x, 564a1d8a91dSmrg int y, 565a1d8a91dSmrg unsigned int width, 566a1d8a91dSmrg unsigned int height); 567a1d8a91dSmrgpixman_bool_t pixman_region32_subtract (pixman_region32_t *reg_d, 568a1d8a91dSmrg pixman_region32_t *reg_m, 569a1d8a91dSmrg pixman_region32_t *reg_s); 570a1d8a91dSmrgpixman_bool_t pixman_region32_inverse (pixman_region32_t *new_reg, 571a1d8a91dSmrg pixman_region32_t *reg1, 572a1d8a91dSmrg pixman_box32_t *inv_rect); 573a1d8a91dSmrgpixman_bool_t pixman_region32_contains_point (pixman_region32_t *region, 574a1d8a91dSmrg int x, 575a1d8a91dSmrg int y, 576a1d8a91dSmrg pixman_box32_t *box); 577a1d8a91dSmrgpixman_region_overlap_t pixman_region32_contains_rectangle (pixman_region32_t *region, 578a1d8a91dSmrg pixman_box32_t *prect); 579a1d8a91dSmrgpixman_bool_t pixman_region32_not_empty (pixman_region32_t *region); 580a1d8a91dSmrgpixman_box32_t * pixman_region32_extents (pixman_region32_t *region); 581a1d8a91dSmrgint pixman_region32_n_rects (pixman_region32_t *region); 582a1d8a91dSmrgpixman_box32_t * pixman_region32_rectangles (pixman_region32_t *region, 583a1d8a91dSmrg int *n_rects); 584a1d8a91dSmrgpixman_bool_t pixman_region32_equal (pixman_region32_t *region1, 585a1d8a91dSmrg pixman_region32_t *region2); 586b4b94579Smrgpixman_bool_t pixman_region32_selfcheck (pixman_region32_t *region); 587a1d8a91dSmrgvoid pixman_region32_reset (pixman_region32_t *region, 588a1d8a91dSmrg pixman_box32_t *box); 58981988197Sjmcneillvoid pixman_region32_clear (pixman_region32_t *region); 590b4b94579Smrg 591b4b94579Smrg 592b4b94579Smrg/* Copy / Fill / Misc */ 593b4b94579Smrgpixman_bool_t pixman_blt (uint32_t *src_bits, 594b4b94579Smrg uint32_t *dst_bits, 595b4b94579Smrg int src_stride, 596b4b94579Smrg int dst_stride, 597b4b94579Smrg int src_bpp, 598b4b94579Smrg int dst_bpp, 599b4b94579Smrg int src_x, 600b4b94579Smrg int src_y, 6016ba797d6Smrg int dest_x, 6026ba797d6Smrg int dest_y, 603b4b94579Smrg int width, 604b4b94579Smrg int height); 605b4b94579Smrgpixman_bool_t pixman_fill (uint32_t *bits, 606b4b94579Smrg int stride, 607b4b94579Smrg int bpp, 608b4b94579Smrg int x, 609b4b94579Smrg int y, 610b4b94579Smrg int width, 611b4b94579Smrg int height, 612b4b94579Smrg uint32_t _xor); 613b4b94579Smrg 614b4b94579Smrgint pixman_version (void); 615b4b94579Smrgconst char* pixman_version_string (void); 616b4b94579Smrg 617b4b94579Smrg/* 618b4b94579Smrg * Images 619b4b94579Smrg */ 620b4b94579Smrgtypedef struct pixman_indexed pixman_indexed_t; 621b4b94579Smrgtypedef struct pixman_gradient_stop pixman_gradient_stop_t; 622b4b94579Smrg 623b4b94579Smrgtypedef uint32_t (* pixman_read_memory_func_t) (const void *src, int size); 624b4b94579Smrgtypedef void (* pixman_write_memory_func_t) (void *dst, uint32_t value, int size); 625b4b94579Smrg 626dc259aabSmrgtypedef void (* pixman_image_destroy_func_t) (pixman_image_t *image, void *data); 627dc259aabSmrg 628b4b94579Smrgstruct pixman_gradient_stop { 629b4b94579Smrg pixman_fixed_t x; 630b4b94579Smrg pixman_color_t color; 631b4b94579Smrg}; 632b4b94579Smrg 633b4b94579Smrg#define PIXMAN_MAX_INDEXED 256 /* XXX depth must be <= 8 */ 634b4b94579Smrg 635b4b94579Smrg#if PIXMAN_MAX_INDEXED <= 256 636b4b94579Smrgtypedef uint8_t pixman_index_type; 637b4b94579Smrg#endif 638b4b94579Smrg 639b4b94579Smrgstruct pixman_indexed 640b4b94579Smrg{ 641b4b94579Smrg pixman_bool_t color; 642b4b94579Smrg uint32_t rgba[PIXMAN_MAX_INDEXED]; 643b4b94579Smrg pixman_index_type ent[32768]; 644b4b94579Smrg}; 645b4b94579Smrg 646b4b94579Smrg/* 647b4b94579Smrg * While the protocol is generous in format support, the 648b4b94579Smrg * sample implementation allows only packed RGB and GBR 649b4b94579Smrg * representations for data to simplify software rendering, 650b4b94579Smrg */ 651b4b94579Smrg#define PIXMAN_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \ 652b4b94579Smrg ((type) << 16) | \ 653b4b94579Smrg ((a) << 12) | \ 654b4b94579Smrg ((r) << 8) | \ 655b4b94579Smrg ((g) << 4) | \ 656b4b94579Smrg ((b))) 657b4b94579Smrg 6587fb3d851Smrg#define PIXMAN_FORMAT_BYTE(bpp,type,a,r,g,b) \ 6597fb3d851Smrg (((bpp >> 3) << 24) | \ 6607fb3d851Smrg (3 << 22) | ((type) << 16) | \ 6617fb3d851Smrg ((a >> 3) << 12) | \ 6627fb3d851Smrg ((r >> 3) << 8) | \ 6637fb3d851Smrg ((g >> 3) << 4) | \ 6647fb3d851Smrg ((b >> 3))) 6657fb3d851Smrg 6667fb3d851Smrg#define PIXMAN_FORMAT_RESHIFT(val, ofs, num) \ 6677fb3d851Smrg (((val >> (ofs)) & ((1 << (num)) - 1)) << ((val >> 22) & 3)) 6687fb3d851Smrg 6697fb3d851Smrg#define PIXMAN_FORMAT_BPP(f) PIXMAN_FORMAT_RESHIFT(f, 24, 8) 6707fb3d851Smrg#define PIXMAN_FORMAT_SHIFT(f) ((uint32_t)((f >> 22) & 3)) 6717fb3d851Smrg#define PIXMAN_FORMAT_TYPE(f) (((f) >> 16) & 0x3f) 6727fb3d851Smrg#define PIXMAN_FORMAT_A(f) PIXMAN_FORMAT_RESHIFT(f, 12, 4) 6737fb3d851Smrg#define PIXMAN_FORMAT_R(f) PIXMAN_FORMAT_RESHIFT(f, 8, 4) 6747fb3d851Smrg#define PIXMAN_FORMAT_G(f) PIXMAN_FORMAT_RESHIFT(f, 4, 4) 6757fb3d851Smrg#define PIXMAN_FORMAT_B(f) PIXMAN_FORMAT_RESHIFT(f, 0, 4) 676b4b94579Smrg#define PIXMAN_FORMAT_RGB(f) (((f) ) & 0xfff) 677b4b94579Smrg#define PIXMAN_FORMAT_VIS(f) (((f) ) & 0xffff) 678b4b94579Smrg#define PIXMAN_FORMAT_DEPTH(f) (PIXMAN_FORMAT_A(f) + \ 679b4b94579Smrg PIXMAN_FORMAT_R(f) + \ 680b4b94579Smrg PIXMAN_FORMAT_G(f) + \ 681b4b94579Smrg PIXMAN_FORMAT_B(f)) 682b4b94579Smrg 683b4b94579Smrg#define PIXMAN_TYPE_OTHER 0 684b4b94579Smrg#define PIXMAN_TYPE_A 1 685b4b94579Smrg#define PIXMAN_TYPE_ARGB 2 686b4b94579Smrg#define PIXMAN_TYPE_ABGR 3 687b4b94579Smrg#define PIXMAN_TYPE_COLOR 4 688b4b94579Smrg#define PIXMAN_TYPE_GRAY 5 689b4b94579Smrg#define PIXMAN_TYPE_YUY2 6 690b4b94579Smrg#define PIXMAN_TYPE_YV12 7 691317c648bSmrg#define PIXMAN_TYPE_BGRA 8 6926ba797d6Smrg#define PIXMAN_TYPE_RGBA 9 69381988197Sjmcneill#define PIXMAN_TYPE_ARGB_SRGB 10 6947fb3d851Smrg#define PIXMAN_TYPE_RGBA_FLOAT 11 695b4b94579Smrg 696317c648bSmrg#define PIXMAN_FORMAT_COLOR(f) \ 697317c648bSmrg (PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_ARGB || \ 698317c648bSmrg PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_ABGR || \ 6996ba797d6Smrg PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_BGRA || \ 7007fb3d851Smrg PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_RGBA || \ 7017fb3d851Smrg PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_RGBA_FLOAT) 702b4b94579Smrg 703b4b94579Smrgtypedef enum { 7047fb3d851Smrg/* 128bpp formats */ 7057fb3d851Smrg PIXMAN_rgba_float = PIXMAN_FORMAT_BYTE(128,PIXMAN_TYPE_RGBA_FLOAT,32,32,32,32), 7067fb3d851Smrg/* 96bpp formats */ 7077fb3d851Smrg PIXMAN_rgb_float = PIXMAN_FORMAT_BYTE(96,PIXMAN_TYPE_RGBA_FLOAT,0,32,32,32), 7087fb3d851Smrg 7097fb3d851Smrg/* 32bpp formats */ 710d0321353Smrg PIXMAN_a8r8g8b8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,8,8,8,8), 711d0321353Smrg PIXMAN_x8r8g8b8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,0,8,8,8), 712d0321353Smrg PIXMAN_a8b8g8r8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,8,8,8,8), 713d0321353Smrg PIXMAN_x8b8g8r8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,0,8,8,8), 714d0321353Smrg PIXMAN_b8g8r8a8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_BGRA,8,8,8,8), 715d0321353Smrg PIXMAN_b8g8r8x8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_BGRA,0,8,8,8), 7166ba797d6Smrg PIXMAN_r8g8b8a8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_RGBA,8,8,8,8), 7176ba797d6Smrg PIXMAN_r8g8b8x8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_RGBA,0,8,8,8), 7181b18d63aSmrg PIXMAN_x14r6g6b6 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,0,6,6,6), 719d0321353Smrg PIXMAN_x2r10g10b10 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,0,10,10,10), 720d0321353Smrg PIXMAN_a2r10g10b10 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,2,10,10,10), 72127693ee9Sveego PIXMAN_x2b10g10r10 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,0,10,10,10), 72227693ee9Sveego PIXMAN_a2b10g10r10 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,2,10,10,10), 72327693ee9Sveego 72481988197Sjmcneill/* sRGB formats */ 72581988197Sjmcneill PIXMAN_a8r8g8b8_sRGB = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB_SRGB,8,8,8,8), 72681988197Sjmcneill 727b4b94579Smrg/* 24bpp formats */ 728d0321353Smrg PIXMAN_r8g8b8 = PIXMAN_FORMAT(24,PIXMAN_TYPE_ARGB,0,8,8,8), 729d0321353Smrg PIXMAN_b8g8r8 = PIXMAN_FORMAT(24,PIXMAN_TYPE_ABGR,0,8,8,8), 730952204abSmrg 731b4b94579Smrg/* 16bpp formats */ 732d0321353Smrg PIXMAN_r5g6b5 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ARGB,0,5,6,5), 733d0321353Smrg PIXMAN_b5g6r5 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ABGR,0,5,6,5), 734952204abSmrg 735d0321353Smrg PIXMAN_a1r5g5b5 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ARGB,1,5,5,5), 736d0321353Smrg PIXMAN_x1r5g5b5 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ARGB,0,5,5,5), 737d0321353Smrg PIXMAN_a1b5g5r5 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ABGR,1,5,5,5), 738d0321353Smrg PIXMAN_x1b5g5r5 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ABGR,0,5,5,5), 739d0321353Smrg PIXMAN_a4r4g4b4 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ARGB,4,4,4,4), 740d0321353Smrg PIXMAN_x4r4g4b4 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ARGB,0,4,4,4), 741d0321353Smrg PIXMAN_a4b4g4r4 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ABGR,4,4,4,4), 742d0321353Smrg PIXMAN_x4b4g4r4 = PIXMAN_FORMAT(16,PIXMAN_TYPE_ABGR,0,4,4,4), 743952204abSmrg 744b4b94579Smrg/* 8bpp formats */ 745d0321353Smrg PIXMAN_a8 = PIXMAN_FORMAT(8,PIXMAN_TYPE_A,8,0,0,0), 746d0321353Smrg PIXMAN_r3g3b2 = PIXMAN_FORMAT(8,PIXMAN_TYPE_ARGB,0,3,3,2), 747d0321353Smrg PIXMAN_b2g3r3 = PIXMAN_FORMAT(8,PIXMAN_TYPE_ABGR,0,3,3,2), 748d0321353Smrg PIXMAN_a2r2g2b2 = PIXMAN_FORMAT(8,PIXMAN_TYPE_ARGB,2,2,2,2), 749d0321353Smrg PIXMAN_a2b2g2r2 = PIXMAN_FORMAT(8,PIXMAN_TYPE_ABGR,2,2,2,2), 750952204abSmrg 751d0321353Smrg PIXMAN_c8 = PIXMAN_FORMAT(8,PIXMAN_TYPE_COLOR,0,0,0,0), 752d0321353Smrg PIXMAN_g8 = PIXMAN_FORMAT(8,PIXMAN_TYPE_GRAY,0,0,0,0), 753952204abSmrg 754d0321353Smrg PIXMAN_x4a4 = PIXMAN_FORMAT(8,PIXMAN_TYPE_A,4,0,0,0), 755952204abSmrg 756d0321353Smrg PIXMAN_x4c4 = PIXMAN_FORMAT(8,PIXMAN_TYPE_COLOR,0,0,0,0), 757d0321353Smrg PIXMAN_x4g4 = PIXMAN_FORMAT(8,PIXMAN_TYPE_GRAY,0,0,0,0), 758952204abSmrg 759b4b94579Smrg/* 4bpp formats */ 760d0321353Smrg PIXMAN_a4 = PIXMAN_FORMAT(4,PIXMAN_TYPE_A,4,0,0,0), 761d0321353Smrg PIXMAN_r1g2b1 = PIXMAN_FORMAT(4,PIXMAN_TYPE_ARGB,0,1,2,1), 762d0321353Smrg PIXMAN_b1g2r1 = PIXMAN_FORMAT(4,PIXMAN_TYPE_ABGR,0,1,2,1), 763d0321353Smrg PIXMAN_a1r1g1b1 = PIXMAN_FORMAT(4,PIXMAN_TYPE_ARGB,1,1,1,1), 764d0321353Smrg PIXMAN_a1b1g1r1 = PIXMAN_FORMAT(4,PIXMAN_TYPE_ABGR,1,1,1,1), 765952204abSmrg 766d0321353Smrg PIXMAN_c4 = PIXMAN_FORMAT(4,PIXMAN_TYPE_COLOR,0,0,0,0), 767d0321353Smrg PIXMAN_g4 = PIXMAN_FORMAT(4,PIXMAN_TYPE_GRAY,0,0,0,0), 768952204abSmrg 769b4b94579Smrg/* 1bpp formats */ 770d0321353Smrg PIXMAN_a1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_A,1,0,0,0), 771952204abSmrg 772d0321353Smrg PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0), 773b4b94579Smrg 774b4b94579Smrg/* YUV formats */ 775d0321353Smrg PIXMAN_yuy2 = PIXMAN_FORMAT(16,PIXMAN_TYPE_YUY2,0,0,0,0), 776d0321353Smrg PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0) 777b4b94579Smrg} pixman_format_code_t; 778b4b94579Smrg 779b4b94579Smrg/* Querying supported format values. */ 780b4b94579Smrgpixman_bool_t pixman_format_supported_destination (pixman_format_code_t format); 781b4b94579Smrgpixman_bool_t pixman_format_supported_source (pixman_format_code_t format); 782b4b94579Smrg 783b4b94579Smrg/* Constructors */ 78481988197Sjmcneillpixman_image_t *pixman_image_create_solid_fill (const pixman_color_t *color); 78581988197Sjmcneillpixman_image_t *pixman_image_create_linear_gradient (const pixman_point_fixed_t *p1, 78681988197Sjmcneill const pixman_point_fixed_t *p2, 787b4b94579Smrg const pixman_gradient_stop_t *stops, 788b4b94579Smrg int n_stops); 78981988197Sjmcneillpixman_image_t *pixman_image_create_radial_gradient (const pixman_point_fixed_t *inner, 79081988197Sjmcneill const pixman_point_fixed_t *outer, 791b4b94579Smrg pixman_fixed_t inner_radius, 792b4b94579Smrg pixman_fixed_t outer_radius, 793b4b94579Smrg const pixman_gradient_stop_t *stops, 794b4b94579Smrg int n_stops); 79581988197Sjmcneillpixman_image_t *pixman_image_create_conical_gradient (const pixman_point_fixed_t *center, 796b4b94579Smrg pixman_fixed_t angle, 797b4b94579Smrg const pixman_gradient_stop_t *stops, 798b4b94579Smrg int n_stops); 799b4b94579Smrgpixman_image_t *pixman_image_create_bits (pixman_format_code_t format, 800b4b94579Smrg int width, 801b4b94579Smrg int height, 802b4b94579Smrg uint32_t *bits, 803b4b94579Smrg int rowstride_bytes); 80481988197Sjmcneillpixman_image_t *pixman_image_create_bits_no_clear (pixman_format_code_t format, 80581988197Sjmcneill int width, 80681988197Sjmcneill int height, 80781988197Sjmcneill uint32_t * bits, 80881988197Sjmcneill int rowstride_bytes); 809b4b94579Smrg 810b4b94579Smrg/* Destructor */ 811b4b94579Smrgpixman_image_t *pixman_image_ref (pixman_image_t *image); 812b4b94579Smrgpixman_bool_t pixman_image_unref (pixman_image_t *image); 813b4b94579Smrg 814dc259aabSmrgvoid pixman_image_set_destroy_function (pixman_image_t *image, 815dc259aabSmrg pixman_image_destroy_func_t function, 816dc259aabSmrg void *data); 817952204abSmrgvoid * pixman_image_get_destroy_data (pixman_image_t *image); 818b4b94579Smrg 819b4b94579Smrg/* Set properties */ 820b4b94579Smrgpixman_bool_t pixman_image_set_clip_region (pixman_image_t *image, 821b4b94579Smrg pixman_region16_t *region); 822b4b94579Smrgpixman_bool_t pixman_image_set_clip_region32 (pixman_image_t *image, 823b4b94579Smrg pixman_region32_t *region); 824b4b94579Smrgvoid pixman_image_set_has_client_clip (pixman_image_t *image, 825b4b94579Smrg pixman_bool_t clien_clip); 826b4b94579Smrgpixman_bool_t pixman_image_set_transform (pixman_image_t *image, 827b4b94579Smrg const pixman_transform_t *transform); 828b4b94579Smrgvoid pixman_image_set_repeat (pixman_image_t *image, 829b4b94579Smrg pixman_repeat_t repeat); 830b4b94579Smrgpixman_bool_t pixman_image_set_filter (pixman_image_t *image, 831b4b94579Smrg pixman_filter_t filter, 832b4b94579Smrg const pixman_fixed_t *filter_params, 833b4b94579Smrg int n_filter_params); 834b4b94579Smrgvoid pixman_image_set_source_clipping (pixman_image_t *image, 835b4b94579Smrg pixman_bool_t source_clipping); 836b4b94579Smrgvoid pixman_image_set_alpha_map (pixman_image_t *image, 837b4b94579Smrg pixman_image_t *alpha_map, 838b4b94579Smrg int16_t x, 839b4b94579Smrg int16_t y); 840b4b94579Smrgvoid pixman_image_set_component_alpha (pixman_image_t *image, 841b4b94579Smrg pixman_bool_t component_alpha); 8421b18d63aSmrgpixman_bool_t pixman_image_get_component_alpha (pixman_image_t *image); 843b4b94579Smrgvoid pixman_image_set_accessors (pixman_image_t *image, 844b4b94579Smrg pixman_read_memory_func_t read_func, 845b4b94579Smrg pixman_write_memory_func_t write_func); 846b4b94579Smrgvoid pixman_image_set_indexed (pixman_image_t *image, 847b4b94579Smrg const pixman_indexed_t *indexed); 848b4b94579Smrguint32_t *pixman_image_get_data (pixman_image_t *image); 849b4b94579Smrgint pixman_image_get_width (pixman_image_t *image); 850b4b94579Smrgint pixman_image_get_height (pixman_image_t *image); 851317c648bSmrgint pixman_image_get_stride (pixman_image_t *image); /* in bytes */ 852b4b94579Smrgint pixman_image_get_depth (pixman_image_t *image); 8531b18d63aSmrgpixman_format_code_t pixman_image_get_format (pixman_image_t *image); 8549a0cb412Smrg 8559a0cb412Smrgtypedef enum 8569a0cb412Smrg{ 8579a0cb412Smrg PIXMAN_KERNEL_IMPULSE, 8589a0cb412Smrg PIXMAN_KERNEL_BOX, 8599a0cb412Smrg PIXMAN_KERNEL_LINEAR, 8609a0cb412Smrg PIXMAN_KERNEL_CUBIC, 8619a0cb412Smrg PIXMAN_KERNEL_GAUSSIAN, 8629a0cb412Smrg PIXMAN_KERNEL_LANCZOS2, 8639a0cb412Smrg PIXMAN_KERNEL_LANCZOS3, 8649a0cb412Smrg PIXMAN_KERNEL_LANCZOS3_STRETCHED /* Jim Blinn's 'nice' filter */ 8659a0cb412Smrg} pixman_kernel_t; 8669a0cb412Smrg 8679a0cb412Smrg/* Create the parameter list for a SEPARABLE_CONVOLUTION filter 8689a0cb412Smrg * with the given kernels and scale parameters. 8699a0cb412Smrg */ 8709a0cb412Smrgpixman_fixed_t * 8719a0cb412Smrgpixman_filter_create_separable_convolution (int *n_values, 8729a0cb412Smrg pixman_fixed_t scale_x, 8739a0cb412Smrg pixman_fixed_t scale_y, 8749a0cb412Smrg pixman_kernel_t reconstruct_x, 8759a0cb412Smrg pixman_kernel_t reconstruct_y, 8769a0cb412Smrg pixman_kernel_t sample_x, 8779a0cb412Smrg pixman_kernel_t sample_y, 8789a0cb412Smrg int subsample_bits_x, 8799a0cb412Smrg int subsample_bits_y); 8809a0cb412Smrg 881b4b94579Smrgpixman_bool_t pixman_image_fill_rectangles (pixman_op_t op, 882b4b94579Smrg pixman_image_t *image, 88381988197Sjmcneill const pixman_color_t *color, 884b4b94579Smrg int n_rects, 885b4b94579Smrg const pixman_rectangle16_t *rects); 886952204abSmrgpixman_bool_t pixman_image_fill_boxes (pixman_op_t op, 887952204abSmrg pixman_image_t *dest, 88881988197Sjmcneill const pixman_color_t *color, 889952204abSmrg int n_boxes, 890952204abSmrg const pixman_box32_t *boxes); 891b4b94579Smrg 892b4b94579Smrg/* Composite */ 893d0321353Smrgpixman_bool_t pixman_compute_composite_region (pixman_region16_t *region, 894d0321353Smrg pixman_image_t *src_image, 895d0321353Smrg pixman_image_t *mask_image, 8966ba797d6Smrg pixman_image_t *dest_image, 897d0321353Smrg int16_t src_x, 898d0321353Smrg int16_t src_y, 899d0321353Smrg int16_t mask_x, 900d0321353Smrg int16_t mask_y, 901d0321353Smrg int16_t dest_x, 902d0321353Smrg int16_t dest_y, 903b4b94579Smrg uint16_t width, 904b4b94579Smrg uint16_t height); 905b4b94579Smrgvoid pixman_image_composite (pixman_op_t op, 906b4b94579Smrg pixman_image_t *src, 907b4b94579Smrg pixman_image_t *mask, 908b4b94579Smrg pixman_image_t *dest, 909b4b94579Smrg int16_t src_x, 910b4b94579Smrg int16_t src_y, 911b4b94579Smrg int16_t mask_x, 912b4b94579Smrg int16_t mask_y, 913b4b94579Smrg int16_t dest_x, 914b4b94579Smrg int16_t dest_y, 915b4b94579Smrg uint16_t width, 916b4b94579Smrg uint16_t height); 917952204abSmrgvoid pixman_image_composite32 (pixman_op_t op, 918952204abSmrg pixman_image_t *src, 919952204abSmrg pixman_image_t *mask, 920952204abSmrg pixman_image_t *dest, 921952204abSmrg int32_t src_x, 922952204abSmrg int32_t src_y, 923952204abSmrg int32_t mask_x, 924952204abSmrg int32_t mask_y, 925952204abSmrg int32_t dest_x, 926952204abSmrg int32_t dest_y, 927952204abSmrg int32_t width, 928952204abSmrg int32_t height); 929b4b94579Smrg 9301b18d63aSmrg/* Executive Summary: This function is a no-op that only exists 9311b18d63aSmrg * for historical reasons. 9321b18d63aSmrg * 9331b18d63aSmrg * There used to be a bug in the X server where it would rely on 9341b18d63aSmrg * out-of-bounds accesses when it was asked to composite with a 9351b18d63aSmrg * window as the source. It would create a pixman image pointing 9361b18d63aSmrg * to some bogus position in memory, but then set a clip region 9371b18d63aSmrg * to the position where the actual bits were. 938d0321353Smrg * 939d0321353Smrg * Due to a bug in old versions of pixman, where it would not clip 940d0321353Smrg * against the image bounds when a clip region was set, this would 9411b18d63aSmrg * actually work. So when the pixman bug was fixed, a workaround was 9421b18d63aSmrg * added to allow certain out-of-bound accesses. This function disabled 9431b18d63aSmrg * those workarounds. 944d0321353Smrg * 9451b18d63aSmrg * Since 0.21.2, pixman doesn't do these workarounds anymore, so now this 9461b18d63aSmrg * function is a no-op. 947d0321353Smrg */ 9481b18d63aSmrgvoid pixman_disable_out_of_bounds_workaround (void); 949d0321353Smrg 95081988197Sjmcneill/* 95181988197Sjmcneill * Glyphs 95281988197Sjmcneill */ 95381988197Sjmcneilltypedef struct pixman_glyph_cache_t pixman_glyph_cache_t; 95481988197Sjmcneilltypedef struct 95581988197Sjmcneill{ 95681988197Sjmcneill int x, y; 95781988197Sjmcneill const void *glyph; 95881988197Sjmcneill} pixman_glyph_t; 95981988197Sjmcneill 96081988197Sjmcneillpixman_glyph_cache_t *pixman_glyph_cache_create (void); 96181988197Sjmcneillvoid pixman_glyph_cache_destroy (pixman_glyph_cache_t *cache); 96281988197Sjmcneillvoid pixman_glyph_cache_freeze (pixman_glyph_cache_t *cache); 96381988197Sjmcneillvoid pixman_glyph_cache_thaw (pixman_glyph_cache_t *cache); 96481988197Sjmcneillconst void * pixman_glyph_cache_lookup (pixman_glyph_cache_t *cache, 96581988197Sjmcneill void *font_key, 96681988197Sjmcneill void *glyph_key); 96781988197Sjmcneillconst void * pixman_glyph_cache_insert (pixman_glyph_cache_t *cache, 96881988197Sjmcneill void *font_key, 96981988197Sjmcneill void *glyph_key, 97081988197Sjmcneill int origin_x, 97181988197Sjmcneill int origin_y, 97281988197Sjmcneill pixman_image_t *glyph_image); 97381988197Sjmcneillvoid pixman_glyph_cache_remove (pixman_glyph_cache_t *cache, 97481988197Sjmcneill void *font_key, 97581988197Sjmcneill void *glyph_key); 97681988197Sjmcneillvoid pixman_glyph_get_extents (pixman_glyph_cache_t *cache, 97781988197Sjmcneill int n_glyphs, 97881988197Sjmcneill pixman_glyph_t *glyphs, 97981988197Sjmcneill pixman_box32_t *extents); 98081988197Sjmcneillpixman_format_code_t pixman_glyph_get_mask_format (pixman_glyph_cache_t *cache, 98181988197Sjmcneill int n_glyphs, 98281988197Sjmcneill const pixman_glyph_t *glyphs); 98381988197Sjmcneillvoid pixman_composite_glyphs (pixman_op_t op, 98481988197Sjmcneill pixman_image_t *src, 98581988197Sjmcneill pixman_image_t *dest, 98681988197Sjmcneill pixman_format_code_t mask_format, 98781988197Sjmcneill int32_t src_x, 98881988197Sjmcneill int32_t src_y, 98981988197Sjmcneill int32_t mask_x, 99081988197Sjmcneill int32_t mask_y, 99181988197Sjmcneill int32_t dest_x, 99281988197Sjmcneill int32_t dest_y, 99381988197Sjmcneill int32_t width, 99481988197Sjmcneill int32_t height, 99581988197Sjmcneill pixman_glyph_cache_t *cache, 99681988197Sjmcneill int n_glyphs, 99781988197Sjmcneill const pixman_glyph_t *glyphs); 99881988197Sjmcneillvoid pixman_composite_glyphs_no_mask (pixman_op_t op, 99981988197Sjmcneill pixman_image_t *src, 100081988197Sjmcneill pixman_image_t *dest, 100181988197Sjmcneill int32_t src_x, 100281988197Sjmcneill int32_t src_y, 100381988197Sjmcneill int32_t dest_x, 100481988197Sjmcneill int32_t dest_y, 100581988197Sjmcneill pixman_glyph_cache_t *cache, 100681988197Sjmcneill int n_glyphs, 100781988197Sjmcneill const pixman_glyph_t *glyphs); 100881988197Sjmcneill 1009b4b94579Smrg/* 1010b4b94579Smrg * Trapezoids 1011b4b94579Smrg */ 1012b4b94579Smrgtypedef struct pixman_edge pixman_edge_t; 1013b4b94579Smrgtypedef struct pixman_trapezoid pixman_trapezoid_t; 1014b4b94579Smrgtypedef struct pixman_trap pixman_trap_t; 1015b4b94579Smrgtypedef struct pixman_span_fix pixman_span_fix_t; 10166ba797d6Smrgtypedef struct pixman_triangle pixman_triangle_t; 1017b4b94579Smrg 1018b4b94579Smrg/* 1019b4b94579Smrg * An edge structure. This represents a single polygon edge 1020b4b94579Smrg * and can be quickly stepped across small or large gaps in the 1021b4b94579Smrg * sample grid 1022b4b94579Smrg */ 1023b4b94579Smrgstruct pixman_edge 1024b4b94579Smrg{ 1025b4b94579Smrg pixman_fixed_t x; 1026b4b94579Smrg pixman_fixed_t e; 1027d0321353Smrg pixman_fixed_t stepx; 1028d0321353Smrg pixman_fixed_t signdx; 1029d0321353Smrg pixman_fixed_t dy; 1030d0321353Smrg pixman_fixed_t dx; 1031d0321353Smrg 1032d0321353Smrg pixman_fixed_t stepx_small; 1033d0321353Smrg pixman_fixed_t stepx_big; 1034d0321353Smrg pixman_fixed_t dx_small; 1035d0321353Smrg pixman_fixed_t dx_big; 1036b4b94579Smrg}; 1037b4b94579Smrg 1038b4b94579Smrgstruct pixman_trapezoid 1039b4b94579Smrg{ 1040d0321353Smrg pixman_fixed_t top, bottom; 1041b4b94579Smrg pixman_line_fixed_t left, right; 1042b4b94579Smrg}; 1043b4b94579Smrg 10446ba797d6Smrgstruct pixman_triangle 10456ba797d6Smrg{ 10466ba797d6Smrg pixman_point_fixed_t p1, p2, p3; 10476ba797d6Smrg}; 1048b4b94579Smrg 1049b4b94579Smrg/* whether 't' is a well defined not obviously empty trapezoid */ 1050d0321353Smrg#define pixman_trapezoid_valid(t) \ 1051b4b94579Smrg ((t)->left.p1.y != (t)->left.p2.y && \ 1052b4b94579Smrg (t)->right.p1.y != (t)->right.p2.y && \ 1053f83768c3Smrg ((t)->bottom > (t)->top)) 1054b4b94579Smrg 1055b4b94579Smrgstruct pixman_span_fix 1056b4b94579Smrg{ 1057b4b94579Smrg pixman_fixed_t l, r, y; 1058b4b94579Smrg}; 1059b4b94579Smrg 1060b4b94579Smrgstruct pixman_trap 1061b4b94579Smrg{ 1062b4b94579Smrg pixman_span_fix_t top, bot; 1063b4b94579Smrg}; 1064b4b94579Smrg 1065b4b94579Smrgpixman_fixed_t pixman_sample_ceil_y (pixman_fixed_t y, 1066b4b94579Smrg int bpp); 1067b4b94579Smrgpixman_fixed_t pixman_sample_floor_y (pixman_fixed_t y, 1068b4b94579Smrg int bpp); 1069b4b94579Smrgvoid pixman_edge_step (pixman_edge_t *e, 1070b4b94579Smrg int n); 1071b4b94579Smrgvoid pixman_edge_init (pixman_edge_t *e, 1072b4b94579Smrg int bpp, 1073b4b94579Smrg pixman_fixed_t y_start, 1074b4b94579Smrg pixman_fixed_t x_top, 1075b4b94579Smrg pixman_fixed_t y_top, 1076b4b94579Smrg pixman_fixed_t x_bot, 1077b4b94579Smrg pixman_fixed_t y_bot); 1078b4b94579Smrgvoid pixman_line_fixed_edge_init (pixman_edge_t *e, 1079b4b94579Smrg int bpp, 1080b4b94579Smrg pixman_fixed_t y, 1081b4b94579Smrg const pixman_line_fixed_t *line, 1082b4b94579Smrg int x_off, 1083b4b94579Smrg int y_off); 1084b4b94579Smrgvoid pixman_rasterize_edges (pixman_image_t *image, 1085b4b94579Smrg pixman_edge_t *l, 1086b4b94579Smrg pixman_edge_t *r, 1087b4b94579Smrg pixman_fixed_t t, 1088b4b94579Smrg pixman_fixed_t b); 1089b4b94579Smrgvoid pixman_add_traps (pixman_image_t *image, 1090b4b94579Smrg int16_t x_off, 1091b4b94579Smrg int16_t y_off, 1092b4b94579Smrg int ntrap, 109381988197Sjmcneill const pixman_trap_t *traps); 1094b4b94579Smrgvoid pixman_add_trapezoids (pixman_image_t *image, 1095b4b94579Smrg int16_t x_off, 1096b4b94579Smrg int y_off, 1097b4b94579Smrg int ntraps, 1098b4b94579Smrg const pixman_trapezoid_t *traps); 1099b4b94579Smrgvoid pixman_rasterize_trapezoid (pixman_image_t *image, 1100b4b94579Smrg const pixman_trapezoid_t *trap, 1101b4b94579Smrg int x_off, 1102b4b94579Smrg int y_off); 11036ba797d6Smrgvoid pixman_composite_trapezoids (pixman_op_t op, 11046ba797d6Smrg pixman_image_t * src, 11056ba797d6Smrg pixman_image_t * dst, 11066ba797d6Smrg pixman_format_code_t mask_format, 11076ba797d6Smrg int x_src, 11086ba797d6Smrg int y_src, 11096ba797d6Smrg int x_dst, 11106ba797d6Smrg int y_dst, 11116ba797d6Smrg int n_traps, 11126ba797d6Smrg const pixman_trapezoid_t * traps); 11136ba797d6Smrgvoid pixman_composite_triangles (pixman_op_t op, 11146ba797d6Smrg pixman_image_t * src, 11156ba797d6Smrg pixman_image_t * dst, 11166ba797d6Smrg pixman_format_code_t mask_format, 11176ba797d6Smrg int x_src, 11186ba797d6Smrg int y_src, 11196ba797d6Smrg int x_dst, 11206ba797d6Smrg int y_dst, 11216ba797d6Smrg int n_tris, 11226ba797d6Smrg const pixman_triangle_t * tris); 11236ba797d6Smrgvoid pixman_add_triangles (pixman_image_t *image, 11246ba797d6Smrg int32_t x_off, 11256ba797d6Smrg int32_t y_off, 11266ba797d6Smrg int n_tris, 11276ba797d6Smrg const pixman_triangle_t *tris); 1128b4b94579Smrg 1129952204abSmrgPIXMAN_END_DECLS 1130952204abSmrg 1131b4b94579Smrg#endif /* PIXMAN_H__ */ 1132