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", has_type_id = false)]
19 public struct Fixed1616 : int32 {
22 [SimpleType, IntegerType (rank = 6), CCode (cname = "pixman_fixed_t", has_type_id = false)]
23 public struct Fixed : Fixed1616 {
24 [CCode (cname = "pixman_double_to_fixed")]
25 public Fixed.double (double val);
26 [CCode (cname = "pixman_int_to_fixed")]
27 public Fixed.int (int val);
29 public double to_double ();
31 public Fixed floor ();
33 public Fixed fraction ();
34 public Fixed mod_2 ();
35 public Fixed sample_ceil_y (int bpp);
36 public Fixed sample_floor_y (int bpp);
39 [CCode (cname = "struct pixman_color", has_type_id = false)]
47 [CCode (cname = "struct pixman_point_fixed", has_type_id = false)]
48 public struct PointFixed {
49 public Pixman.Fixed x;
50 public Pixman.Fixed y;
53 [CCode (cname = "struct pixman_line_fixed", has_type_id = false)]
54 public struct LineFixed {
55 public Pixman.PointFixed p1;
56 public Pixman.PointFixed p2;
59 [CCode (cname = "struct pixman_vector", has_type_id = false)]
60 public struct Vector {
61 public Pixman.Fixed vector[3];
64 [CCode (cname = "struct pixman_transform", has_type_id = false)]
65 public struct Transform {
66 public Pixman.Fixed matrix[9];
68 [CCode (cname = "pixman_transform_init_identity")]
69 public Transform.identity ();
70 public bool point_3d (Pixman.Vector vector);
72 public bool multiply (Pixman.Transform l, Pixman.Transform r);
73 [CCode (cname = "pixman_transform_init_scale")]
74 public Transform.init_scale (Pixman.Fixed sx, Pixman.Fixed sy);
75 public bool scale (Pixman.Transform reverse, Pixman.Fixed sx, Pixman.Fixed sy);
76 [CCode (cname = "pixman_transform_init_rotate")]
77 public Transform.init_rotate (Pixman.Fixed cos, Pixman.Fixed sin);
78 public bool rotate (Pixman.Transform reverse, Pixman.Fixed c, Pixman.Fixed s);
79 [CCode (cname = "pixman_transform_rotate")]
80 public Transform.init_translate (Pixman.Fixed tx, Pixman.Fixed ty);
81 public bool translate (Pixman.Transform reverse, Pixman.Fixed tx, Pixman.Fixed ty);
82 public bool bounds (Pixman.Box16 b);
83 public bool is_identity ();
84 public bool is_scale ();
85 public bool is_int_translate ();
86 public bool is_inverse (Pixman.Transform b);
89 [CCode (cprefix = "PIXMAN_REGION_", has_type_id = false)]
90 public enum RegionOverlap {
96 [CCode (cname = "pixman_region16_t", has_type_id = false, cprefix = "pixman_region_", destroy_function = "pixman_region_fini")]
97 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 [CCode (cname = "pixman_region_extents")]
121 public unowned Pixman.Box16? get_extents ();
122 public int n_rects ();
123 public unowned Pixman.Box16[] rectangles ();
124 public bool equal (Pixman.Region16 region2);
125 public bool selfcheck ();
126 public void reset (Pixman.Box16 box);
129 [CCode (cname = "pixman_box16_t", has_type_id = false)]
130 public struct Box16 {
137 [CCode (cname = "pixman_rectangle16_t", has_type_id = false)]
138 public struct Rectangle16 {
139 public Pixman.Box16 extents;
142 [CCode (cname = "pixman_region32_t", has_type_id = false, destroy_function = "pixman_region32_fini")]
143 public struct Region32 {
144 public Pixman.Box32 extents;
147 public Region32.rect (int x, int y, uint width, uint height);
148 public Region32.rects (Pixman.Box32[] boxes);
149 public Region32.with_extents (Pixman.Box32 extents);
151 public void translate (int x, int y);
152 public bool copy (out Pixman.Region32 region);
153 [CCode (instance_pos = 1.1)]
154 public bool intersect (out Pixman.Region32 new_reg, Pixman.Region32 reg2);
155 [CCode (instance_pos = 1.1)]
156 public bool union (out Pixman.Region32 new_reg, Pixman.Region32 reg2);
157 [CCode (instance_pos = 1.1)]
158 public bool union_rect (out Pixman.Region32 dest, int x, int y, uint width, uint height);
159 [CCode (instance_pos = 1.1)]
160 public bool subtract (out Pixman.Region32 reg_d, Pixman.Region32 reg_s);
161 [CCode (instance_pos = 1.1)]
162 public bool inverse (out Pixman.Region32 new_reg, Pixman.Box32 inv_rect);
163 public bool contains_point (int x, int y, Pixman.Box32 box);
164 public Pixman.RegionOverlap contains_rectangle (Pixman.Box32 prect);
165 public bool not_empty ();
166 [CCode (cname = "pixman_region32_extents")]
167 public unowned Pixman.Box32? get_extents ();
168 public int n_rects ();
169 public unowned Pixman.Box32[] rectangles ();
170 public bool equal (Pixman.Region32 region2);
171 public bool selfcheck ();
172 public void reset (Pixman.Box32 box);
175 [CCode (cname = "pixman_box32_t", has_type_id = false)]
176 public struct Box32 {
183 [CCode (cname = "pixman_rectangle32_t", has_type_id = false)]
184 public struct Rectangle32 {
185 public Pixman.Box32 extents;
188 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);
189 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);
191 [CCode (cname = "pixman_read_memory_func_t", has_target = false)]
192 public delegate int32 ReadMemoryFunc ([CCode (type = "void*")] uint8[] src);
193 [CCode (cname = "pixman_write_memory_func_t", has_target = false)]
194 public delegate void WriteMemoryFunc ([CCode (type = "void*", array_length = false)] uint8[] dst, uint32 value, int size);
196 [CCode (cname = "struct pixman_gradient_stop", has_type_id = false)]
197 public struct GradientStop {
198 public Pixman.Fixed x;
199 public Pixman.Color color;
202 [CCode (cname = "struct pixman_indexed", has_type_id = false)]
203 public struct Indexed {
205 public uint32 rgba[256];
206 public uint8 ent[32768];
209 [CCode (cname = "enum pixman_repeat_t", has_type_id = false)]
217 [CCode (cname = "enum pixman_filter_t", has_type_id = false)]
227 [CCode (cname = "enum pixman_op_t", has_type_id = false, cprefix = "PIXMAN_OP_")]
228 public enum Operation {
248 DISJOINT_OVER_REVERSE,
252 DISJOINT_OUT_REVERSE,
254 DISJOINT_ATOP_REVERSE,
261 CONJOINT_OVER_REVERSE,
265 CONJOINT_OUT_REVERSE,
267 CONJOINT_ATOP_REVERSE,
287 [CCode (cname = "int", cprefix = "PIXMAN_TYPE_", has_type_id = false)]
288 public enum FormatType {
299 [CCode (cname = "PIXMAN_FORMAT_COLOR")]
300 public bool is_color ();
303 [CCode (cname = "pixman_format_code_t", has_type_id = false, cprefix = "PIXMAN_")]
305 [CCode (cname = "PIXMAN_a8r8g8b8")]
307 [CCode (cname = "PIXMAN_x8r8g8b8")]
309 [CCode (cname = "PIXMAN_a8b8g8r8")]
311 [CCode (cname = "PIXMAN_x8b8g8r8")]
313 [CCode (cname = "PIXMAN_b8g8r8a8")]
315 [CCode (cname = "PIXMAN_b8g8r8x8")]
317 [CCode (cname = "PIXMAN_x14r6g6b6")]
319 [CCode (cname = "PIXMAN_x2r10g10b10")]
321 [CCode (cname = "PIXMAN_a2r10g10b10")]
323 [CCode (cname = "PIXMAN_x2b10g10r10")]
325 [CCode (cname = "PIXMAN_a2b10g10r10")]
327 [CCode (cname = "PIXMAN_r8g8b8")]
329 [CCode (cname = "PIXMAN_b8g8r8")]
331 [CCode (cname = "PIXMAN_r5g6b5")]
333 [CCode (cname = "PIXMAN_b5g6r5")]
335 [CCode (cname = "PIXMAN_a1r5g5b5")]
337 [CCode (cname = "PIXMAN_x1r5g5b5")]
339 [CCode (cname = "PIXMAN_a1b5g5r5")]
341 [CCode (cname = "PIXMAN_x1b5g5r5")]
343 [CCode (cname = "PIXMAN_a4r4g4b4")]
345 [CCode (cname = "PIXMAN_x4r4g4b4")]
347 [CCode (cname = "PIXMAN_a4b4g4r4")]
349 [CCode (cname = "PIXMAN_x4b4g4r4")]
352 [CCode (cname = "PIXMAN_a8")]
354 [CCode (cname = "PIXMAN_r3g3b2")]
356 [CCode (cname = "PIXMAN_b2g3r3")]
358 [CCode (cname = "PIXMAN_a2r2g2b2")]
360 [CCode (cname = "PIXMAN_a2b2g2r2")]
362 [CCode (cname = "PIXMAN_c8")]
364 [CCode (cname = "PIXMAN_g8")]
366 [CCode (cname = "PIXMAN_x4a4")]
368 [CCode (cname = "PIXMAN_x4c4")]
370 [CCode (cname = "PIXMAN_x4g4")]
373 [CCode (cname = "PIXMAN_a4")]
375 [CCode (cname = "PIXMAN_r1g2b1")]
377 [CCode (cname = "PIXMAN_b1g2r1")]
379 [CCode (cname = "PIXMAN_a1r1g1b1")]
381 [CCode (cname = "PIXMAN_a1b1g1r1")]
383 [CCode (cname = "PIXMAN_c4")]
385 [CCode (cname = "PIXMAN_g4")]
388 [CCode (cname = "PIXMAN_a1")]
390 [CCode (cname = "PIXMAN_g1")]
393 [CCode (cname = "PIXMAN_yuy2")]
395 [CCode (cname = "PIXMAN_yv12")]
398 [CCode (cname = "PIXMAN_FORMAT")]
399 public static Pixman.Format create (int bpp, Pixman.FormatType type, int a, int r, int g, int b);
400 [CCode (cname = "pixman_format_supported_destination")]
401 public bool supported_destination ();
402 [CCode (cname = "pixman_format_supported_source")]
403 public bool supported_source ();
406 [CCode (cname = "pixman_image_t", cprefix = "pixman_image_", ref_function = "pixman_image_ref", unref_function = "pixman_image_unref", has_type_id = false)]
408 [CCode (cname = "pixman_image_create_solid_fill")]
409 public Image.solid_fill (Pixman.Color color);
410 [CCode (cname = "pixman_image_create_linear_gradient")]
411 public Image.linear_gradient (Pixman.PointFixed p1, Pixman.PointFixed p2, Pixman.GradientStop[] stops);
412 [CCode (cname = "pixman_image_create_radial_gradient")]
413 public Image.radial_gradient (Pixman.PointFixed inner, Pixman.PointFixed outer, Pixman.Fixed inner_radius, Pixman.Fixed outer_radius, Pixman.GradientStop[] stops);
414 [CCode (cname = "pixman_image_create_conical_gradient")]
415 public Image.conical_gradient (Pixman.PointFixed center, Pixman.Fixed angle, Pixman.GradientStop[] stops);
416 [CCode (cname = "pixman_image_create_bits")]
417 public Image.bits (Pixman.Format format, int width, int height, [CCode (type = "uint32_t*", array_length = false)] uint8[]? bits, int rowstride_bytes);
419 public bool set_clip_region (Pixman.Region16 clip_region);
420 public Pixman.Region16 clip_region { set; }
421 public bool set_clip_region32 (Pixman.Region32 clip_region32);
422 public Pixman.Region32 clip_region32 { set; }
423 public void set_has_client_clip (bool client_clip);
424 public bool has_client_clip { set; }
425 public bool set_transform (Pixman.Transform transform);
426 public Pixman.Transform transform { set; }
427 public void set_repeat (Pixman.Repeat repeat);
428 public Pixman.Repeat repeat { set; }
429 public bool set_filter (Pixman.Filter filter, Pixman.Fixed[]? filter_params);
430 public void set_source_clipping (bool source_clipping);
431 public bool source_clipping { set; }
432 public void set_alpha_map (Pixman.Image alpha_map, int16 x, int16 y);
433 public void set_component_alpha (bool component_alpha);
434 public bool component_alpha { set; }
435 public bool set_accessors (Pixman.ReadMemoryFunc read_func, Pixman.WriteMemoryFunc write_func);
436 public bool set_indexed (Pixman.Indexed indexed);
437 public Pixman.Indexed indexed { set; }
438 [CCode (array_length = false)]
439 public unowned uint32[] get_data ();
440 public int get_width ();
441 public int width { get; }
442 public int get_height ();
443 public int height { get; }
444 public int get_stride ();
445 public int stride { get; }
446 public int get_depth ();
447 public int depth { get; }
448 [CCode (instance_pos = 1.1)]
449 public bool fill_rectangles (Pixman.Operation op, Pixman.Color color, [CCode (array_length_pos = 2.1)] Pixman.Rectangle16[] rects);
451 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);
452 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);
454 [CCode (cname = "pixman_rasterize_edges")]
455 public void rasterize_edges (Pixman.Edge l, Pixman.Edge r, Pixman.Fixed t, Pixman.Fixed b);
456 [CCode (cname = "pixman_add_traps")]
457 public void add_traps (int16 x_off, int16 y_off, [CCode (array_length_pos = 2.9)] Pixman.Trap[] traps);
458 [CCode (cname = "pixman_add_trapezoids")]
459 public void add_trapezoids (int16 x_off, int y_off, [CCode (array_length_pos = 2.9)] Pixman.Trap[] traps);
460 [CCode (cname = "pixman_rasterize_trapezoid")]
461 public void rasterize_trapezoid (Pixman.Trapezoid trap, int x_off, int y_off);
464 [CCode (cname = "struct pixman_edge", has_type_id = false)]
466 public Pixman.Fixed x;
467 public Pixman.Fixed e;
468 public Pixman.Fixed stepx;
469 public Pixman.Fixed signdx;
470 public Pixman.Fixed dy;
471 public Pixman.Fixed dx;
473 public Pixman.Fixed stepx_small;
474 public Pixman.Fixed stepx_big;
475 public Pixman.Fixed dx_small;
476 public Pixman.Fixed dx_big;
478 public void step (int n);
479 public Edge (int bpp, Pixman.Fixed y_start, Pixman.Fixed x_top, Pixman.Fixed y_top, Pixman.Fixed x_bot, Pixman.Fixed y_bot);
480 [CCode (cname = "pixman_line_fixed_edge_init")]
481 public Edge.line_fixed (int bpp, Pixman.Fixed y, Pixman.LineFixed line, int x_off, int y_off);
484 [CCode (cname = "struct pixman_trapezoid", has_type_id = false)]
485 public struct Trapezoid {
486 public Pixman.Fixed top;
487 public Pixman.Fixed bottom;
488 public Pixman.LineFixed left;
489 public Pixman.LineFixed right;
491 public bool valid ();
494 [CCode (cname = "struct pixman_span_fix", has_type_id = false)]
495 public struct SpanFix {
496 public Pixman.Fixed l;
497 public Pixman.Fixed r;
498 public Pixman.Fixed y;
501 [CCode (cname = "struct pixman_trap", has_type_id = false)]
503 public Pixman.SpanFix top;
504 public Pixman.SpanFix bot;