1 [CCode (cheader_filename = "pixman.h")]
4 public const int MAJOR;
5 public const int MINOR;
6 public const int MICRO;
7 public const string STRING;
8 [CCode (cname = "PIXMAN_VERSION")]
11 public static int encode (int major, int minor, int micro);
12 [CCode (cname = "pixman_version")]
13 public static int library_int ();
14 [CCode (cname = "pixman_string")]
15 public static unowned string library_string ();
18 [SimpleType, IntegerType (rank = 6), CCode (cname = "pixman_fixed_16_16_t")]
19 public struct Fixed1616 : int32 {
22 [SimpleType, IntegerType (rank = 6), CCode (cname = "pixman_fixed_t")]
23 public struct Fixed : Fixed1616 {
25 public double to_double ();
27 public Fixed floor ();
29 public Fixed fraction ();
30 public Fixed mod_2 ();
31 public Fixed sample_ceil_y (int bpp);
32 public Fixed sample_floor_y (int bpp);
35 [CCode (cname = "struct pixman_color", has_type_id = false)]
43 [CCode (cname = "struct pixman_point_fixed", has_type_id = false)]
44 public struct PointFixed {
45 public Pixman.Fixed x;
46 public Pixman.Fixed y;
49 [CCode (cname = "struct pixman_line_fixed", has_type_id = false)]
50 public struct LineFixed {
51 public Pixman.PointFixed p1;
52 public Pixman.PointFixed p2;
55 [CCode (cname = "struct pixman_vector", has_type_id = false)]
56 public struct Vector {
57 public Pixman.Fixed vector[3];
60 [CCode (cname = "struct pixman_transform", has_type_id = false)]
61 public struct Transform {
62 [CCode (array_length = false)]
63 public Pixman.Fixed[,] matrix;
65 [CCode (cname = "pixman_transform_init_identity")]
66 public Transform.identity ();
67 public bool point_3d (Pixman.Vector vector);
69 public bool multiply (Pixman.Transform l, Pixman.Transform r);
70 [CCode (cname = "pixman_transform_init_scale")]
71 public Transform.init_scale (Pixman.Fixed sx, Pixman.Fixed sy);
72 public bool scale (Pixman.Transform reverse, Pixman.Fixed sx, Pixman.Fixed sy);
73 [CCode (cname = "pixman_transform_init_rotate")]
74 public Transform.init_rotate (Pixman.Fixed cos, Pixman.Fixed sin);
75 public bool rotate (Pixman.Transform reverse, Pixman.Fixed c, Pixman.Fixed s);
76 [CCode (cname = "pixman_transform_rotate")]
77 public Transform.init_translate (Pixman.Fixed tx, Pixman.Fixed ty);
78 public bool translate (Pixman.Transform reverse, Pixman.Fixed tx, Pixman.Fixed ty);
79 public bool bounds (Pixman.Box16 b);
80 public bool is_identity ();
81 public bool is_scale ();
82 public bool is_int_translate ();
83 public bool is_inverse (Pixman.Transform b);
86 [CCode (cprefix = "PIXMAN_REGION_", has_type_id = false)]
87 public enum RegionOverlap {
93 [CCode (cname = "pixman_region16_t", has_type_id = false, cprefix = "pixman_region_", destroy_function = "pixman_region_fini")]
94 public struct Region16 {
101 public Region16.rect (int x, int y, uint width, uint height);
102 public Region16.rects (Pixman.Box16[] boxes);
103 public Region16.with_extents (Pixman.Box16 extents);
105 public void translate (int x, int y);
106 public bool copy (out Pixman.Region16 region);
107 [CCode (instance_pos = 1.1)]
108 public bool intersect (out Pixman.Region16 new_reg, Pixman.Region16 reg2);
109 [CCode (instance_pos = 1.1)]
110 public bool union (out Pixman.Region16 new_reg, Pixman.Region16 reg2);
111 [CCode (instance_pos = 1.1)]
112 public bool union_rect (out Pixman.Region16 dest, int x, int y, uint width, uint height);
113 [CCode (instance_pos = 1.1)]
114 public bool subtract (out Pixman.Region16 reg_d, Pixman.Region16 reg_s);
115 [CCode (instance_pos = 1.1)]
116 public bool inverse (out Pixman.Region16 new_reg, Pixman.Box16 inv_rect);
117 public bool contains_point (int x, int y, Pixman.Box16 box);
118 public Pixman.RegionOverlap contains_rectangle (Pixman.Box16 prect);
119 public bool not_empty ();
120 public Pixman.Box16* extents ();
121 public int n_rects ();
122 public Pixman.Box16[] rectangles ();
123 public bool equal (Pixman.Region16 region2);
124 public bool selfcheck ();
125 public void reset (Pixman.Box16 box);
128 [CCode (cname = "pixman_box16_t", has_type_id = false)]
129 public struct Box16 {
136 [CCode (cname = "pixman_rectangle16_t", has_type_id = false)]
137 public struct Rectangle16 {
138 public Pixman.Box16 extents;
141 [CCode (cname = "pixman_region32_t", has_type_id = false, destroy_function = "pixman_region32_fini")]
142 public struct Region32 {
146 public uint32 height;
149 public Region32.rect (int x, int y, uint width, uint height);
150 public Region32.rects (Pixman.Box32[] boxes);
151 public Region32.with_extents (Pixman.Box32 extents);
153 public void translate (int x, int y);
154 public bool copy (out Pixman.Region32 region);
155 [CCode (instance_pos = 1.1)]
156 public bool intersect (out Pixman.Region32 new_reg, Pixman.Region32 reg2);
157 [CCode (instance_pos = 1.1)]
158 public bool union (out Pixman.Region32 new_reg, Pixman.Region32 reg2);
159 [CCode (instance_pos = 1.1)]
160 public bool union_rect (out Pixman.Region32 dest, int x, int y, uint width, uint height);
161 [CCode (instance_pos = 1.1)]
162 public bool subtract (out Pixman.Region32 reg_d, Pixman.Region32 reg_s);
163 [CCode (instance_pos = 1.1)]
164 public bool inverse (out Pixman.Region32 new_reg, Pixman.Box32 inv_rect);
165 public bool contains_point (int x, int y, Pixman.Box32 box);
166 public Pixman.RegionOverlap contains_rectangle (Pixman.Box32 prect);
167 public bool not_empty ();
168 public Pixman.Box32* extents ();
169 public int n_rects ();
170 public Pixman.Box32[] rectangles ();
171 public bool equal (Pixman.Region32 region2);
172 public bool selfcheck ();
173 public void reset (Pixman.Box32 box);
176 [CCode (cname = "pixman_box32_t", has_type_id = false)]
177 public struct Box32 {
184 [CCode (cname = "pixman_rectangle32_t", has_type_id = false)]
185 public struct Rectangle32 {
186 public Pixman.Box32 extents;
189 public static bool blt ([CCode (array_length = false, type = "uint32_t*")] uint8[] src_bits, [CCode (array_length = false, type = "uint32_t*")] uint8[] dst_bits, int src_stride, int dst_stride, int src_bpp, int dst_bpp, int src_x, int src_y, int dst_x, int dst_y, int width, int height);
190 public static bool fill ([CCode (array_length = false, type = "uint32_t*")] uint8[] bits, int stride, int bpp, int x, int y, int width, int height, uint32 _xor);
192 [CCode (cname = "pixman_read_memory_func_t", has_target = false)]
193 public delegate int32 ReadMemoryFunc ([CCode (type = "void*")] uint8[] src);
194 [CCode (cname = "pixman_write_memory_func_t", has_target = false)]
195 public delegate void WriteMemoryFunc ([CCode (type = "void*", array_length = false)] uint8[] dst, uint32 value, int size);
197 [CCode (cname = "struct pixman_gradient_stop", has_type_id = false)]
198 public struct GradientStop {
199 public Pixman.Fixed x;
200 public Pixman.Color color;
203 [CCode (cname = "struct pixman_indexed", has_type_id = false)]
204 public struct Indexed {
206 public uint32 rgba[256];
207 public uint8 ent[32768];
210 [CCode (cname = "enum pixman_repeat_t", has_type_id = false)]
218 [CCode (cname = "enum pixman_filter_t", has_type_id = false)]
228 [CCode (cname = "enum pixman_op_t", has_type_id = false, cprefix = "PIXMAN_OP_")]
229 public enum Operation {
249 DISJOINT_OVER_REVERSE,
253 DISJOINT_OUT_REVERSE,
255 DISJOINT_ATOP_REVERSE,
262 CONJOINT_OVER_REVERSE,
266 CONJOINT_OUT_REVERSE,
268 CONJOINT_ATOP_REVERSE,
288 [CCode (cname = "int", cprefix = "PIXMAN_TYPE_", has_type_id = false)]
289 public enum FormatType {
300 [CCode (cname = "PIXMAN_FORMAT_COLOR")]
301 public bool is_color ();
304 [CCode (cname = "pixman_format_code_t", has_type_id = false, cprefix = "PIXMAN_")]
306 [CCode (cname = "PIXMAN_a8r8g8b8")]
308 [CCode (cname = "PIXMAN_x8r8g8b8")]
310 [CCode (cname = "PIXMAN_a8b8g8r8")]
312 [CCode (cname = "PIXMAN_x8b8g8r8")]
314 [CCode (cname = "PIXMAN_b8g8r8a8")]
316 [CCode (cname = "PIXMAN_b8g8r8x8")]
318 [CCode (cname = "PIXMAN_x14r6g6b6")]
320 [CCode (cname = "PIXMAN_x2r10g10b10")]
322 [CCode (cname = "PIXMAN_a2r10g10b10")]
324 [CCode (cname = "PIXMAN_x2b10g10r10")]
326 [CCode (cname = "PIXMAN_a2b10g10r10")]
328 [CCode (cname = "PIXMAN_r8g8b8")]
330 [CCode (cname = "PIXMAN_b8g8r8")]
332 [CCode (cname = "PIXMAN_r5g6b5")]
334 [CCode (cname = "PIXMAN_b5g6r5")]
336 [CCode (cname = "PIXMAN_a1r5g5b5")]
338 [CCode (cname = "PIXMAN_x1r5g5b5")]
340 [CCode (cname = "PIXMAN_a1b5g5r5")]
342 [CCode (cname = "PIXMAN_x1b5g5r5")]
344 [CCode (cname = "PIXMAN_a4r4g4b4")]
346 [CCode (cname = "PIXMAN_x4r4g4b4")]
348 [CCode (cname = "PIXMAN_a4b4g4r4")]
350 [CCode (cname = "PIXMAN_x4b4g4r4")]
353 [CCode (cname = "PIXMAN_a8")]
355 [CCode (cname = "PIXMAN_r3g3b2")]
357 [CCode (cname = "PIXMAN_b2g3r3")]
359 [CCode (cname = "PIXMAN_a2r2g2b2")]
361 [CCode (cname = "PIXMAN_a2b2g2r2")]
363 [CCode (cname = "PIXMAN_c8")]
365 [CCode (cname = "PIXMAN_g8")]
367 [CCode (cname = "PIXMAN_x4a4")]
369 [CCode (cname = "PIXMAN_x4c4")]
371 [CCode (cname = "PIXMAN_x4g4")]
374 [CCode (cname = "PIXMAN_a4")]
376 [CCode (cname = "PIXMAN_r1g2b1")]
378 [CCode (cname = "PIXMAN_b1g2r1")]
380 [CCode (cname = "PIXMAN_a1r1g1b1")]
382 [CCode (cname = "PIXMAN_a1b1g1r1")]
384 [CCode (cname = "PIXMAN_c4")]
386 [CCode (cname = "PIXMAN_g4")]
389 [CCode (cname = "PIXMAN_a1")]
391 [CCode (cname = "PIXMAN_g1")]
394 [CCode (cname = "PIXMAN_yuy2")]
396 [CCode (cname = "PIXMAN_yv12")]
399 [CCode (cname = "PIXMAN_FORMAT")]
400 public static Pixman.Format create (int bpp, Pixman.FormatType type, int a, int r, int g, int b);
401 [CCode (cname = "pixman_format_supported_destination")]
402 public bool supported_destination ();
403 [CCode (cname = "pixman_format_supported_source")]
404 public bool supported_source ();
407 [CCode (cname = "pixman_image_t", cprefix = "pixman_", ref_function = "pixman_image_ref", unref_function = "pixman_image_unref", has_type_id = false)]
409 [CCode (cname = "pixman_image_create_solid_fill")]
410 public Image.solid_fill (Pixman.Color color);
411 [CCode (cname = "pixman_image_create_linear_gradient")]
412 public Image.linear_gradient (Pixman.PointFixed p1, Pixman.PointFixed p2, Pixman.GradientStop[] stops);
413 [CCode (cname = "pixman_image_create_radial_gradient")]
414 public Image.radial_gradient (Pixman.PointFixed inner, Pixman.PointFixed outer, Pixman.Fixed inner_radius, Pixman.Fixed outer_radius, Pixman.GradientStop[] stops);
415 [CCode (cname = "pixman_image_create_conical_gradient")]
416 public Image.conical_gradient (Pixman.PointFixed center, Pixman.Fixed angle, Pixman.GradientStop[] stops);
417 [CCode (cname = "pixman_image_create_bits")]
418 public Image.bits (Pixman.Format format, int width, int height, [CCode (type = "uint32_t*", array_length = false)] uint8[] bits, int rowstride_bytes);
420 public bool set_clip_region (Pixman.Region16 clip_region);
421 public Pixman.Region16 clip_region { set; }
422 public bool set_clip_region32 (Pixman.Region32 clip_region32);
423 public Pixman.Region32 clip_region32 { set; }
424 public void set_has_client_clip (bool client_clip);
425 public bool has_client_clip { set; }
426 public bool set_transform (Pixman.Transform transform);
427 public Pixman.Transform transform { set; }
428 public void set_repeat (Pixman.Repeat repeat);
429 public Pixman.Repeat repeat { set; }
430 public bool set_filter (Pixman.Filter filter, Pixman.Fixed[] filter_params);
431 public void set_source_clipping (bool source_clipping);
432 public bool source_clipping { set; }
433 public void set_alpha_map (Pixman.Image alpha_map, int16 x, int16 y);
434 public void set_component_alpha (bool component_alpha);
435 public bool component_alpha { set; }
436 public bool set_accessors (Pixman.ReadMemoryFunc read_func, Pixman.WriteMemoryFunc write_func);
437 public bool set_indexed (Pixman.Indexed indexed);
438 public Pixman.Indexed indexed { set; }
439 [CCode (array_length = false)]
440 public uint32[] get_data ();
441 public int get_width ();
442 public int width { get; }
443 public int get_height ();
444 public int height { get; }
445 public int get_stride ();
446 public int stride { get; }
447 public int get_depth ();
448 public int depth { get; }
449 [CCode (instance_pos = 1.1)]
450 public bool fill_rectangles (Pixman.Operation op, Pixman.Color color, [CCode (array_length_pos = 2.1)] Pixman.Rectangle16[] rects);
452 public static bool compute_composite_region (Pixman.Region16 region, Pixman.Image src_image, Pixman.Image? mask_image, Pixman.Image dst_image, int src_x, int src_y, int mask_x, int mask_y, int dest_x, int dest_y, int width, int height);
453 [CCode (cname = "pixman_image_composite")]
454 public static void composite (Pixman.Operation op, Pixman.Image src, Pixman.Image? mask, Pixman.Image dest, int16 src_x, int16 src_y, int16 mask_x, int16 mask_y, int16 dest_x, int16 dest_y, uint16 width, uint16 height);
456 public void rasterize_edges (Pixman.Edge l, Pixman.Edge r, Pixman.Fixed t, Pixman.Fixed b);
457 public void add_traps (int16 x_off, int16 y_off, [CCode (array_length_pos = 2.9)] Pixman.Trap[] traps);
458 public void add_trapezoids (int16 x_off, int y_off, [CCode (array_length_pos = 2.9)] Pixman.Trap[] traps);
459 public void rasterize_trapezoid (Pixman.Trapezoid trap, int x_off, int y_off);
462 [CCode (cname = "struct pixman_edge", has_type_id = false)]
464 public Pixman.Fixed x;
465 public Pixman.Fixed e;
466 public Pixman.Fixed stepx;
467 public Pixman.Fixed signdx;
468 public Pixman.Fixed dy;
469 public Pixman.Fixed dx;
471 public Pixman.Fixed stepx_small;
472 public Pixman.Fixed stepx_big;
473 public Pixman.Fixed dx_small;
474 public Pixman.Fixed dx_big;
476 public void step (int n);
477 public Edge (int bpp, Pixman.Fixed y_start, Pixman.Fixed x_top, Pixman.Fixed y_top, Pixman.Fixed x_bot, Pixman.Fixed y_bot);
478 [CCode (cname = "pixman_line_fixed_edge_init")]
479 public Edge.line_fixed (int bpp, Pixman.Fixed y, Pixman.LineFixed line, int x_off, int y_off);
482 [CCode (cname = "struct pixman_trapezoid", has_type_id = false)]
483 public struct Trapezoid {
484 public Pixman.Fixed top;
485 public Pixman.Fixed bottom;
486 public Pixman.LineFixed left;
487 public Pixman.LineFixed right;
489 public bool valid ();
492 [CCode (cname = "struct pixman_span_fix", has_type_id = false)]
493 public struct SpanFix {
494 public Pixman.Fixed l;
495 public Pixman.Fixed r;
496 public Pixman.Fixed y;
499 [CCode (cname = "struct pixman_trap", has_type_id = false)]
501 public Pixman.SpanFix top;
502 public Pixman.SpanFix bot;