@girs/cogl-10 10.0.0-3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cogl-10.d.cts ADDED
@@ -0,0 +1,4684 @@
1
+
2
+ /*
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
7
+ */
8
+
9
+ import './cogl-10-ambient.d.ts';
10
+ import './cogl-10-import.d.ts';
11
+ /**
12
+ * Cogl-10
13
+ */
14
+
15
+ import type cairo from '@girs/cairo-1.0';
16
+ import type Graphene from '@girs/graphene-1.0';
17
+ import type GObject from '@girs/gobject-2.0';
18
+ import type GLib from '@girs/glib-2.0';
19
+ import type GL from '@girs/gl-1.0';
20
+
21
+ /**
22
+ * Data types for the components of a vertex attribute.
23
+ */
24
+ export enum AttributeType {
25
+ /**
26
+ * Data is the same size of a byte
27
+ */
28
+ BYTE,
29
+ /**
30
+ * Data is the same size of an
31
+ * unsigned byte
32
+ */
33
+ UNSIGNED_BYTE,
34
+ /**
35
+ * Data is the same size of a short integer
36
+ */
37
+ SHORT,
38
+ /**
39
+ * Data is the same size of
40
+ * an unsigned short integer
41
+ */
42
+ UNSIGNED_SHORT,
43
+ /**
44
+ * Data is the same size of a float
45
+ */
46
+ FLOAT,
47
+ }
48
+ /**
49
+ * Error codes that can be thrown when performing bitmap
50
+ * operations. Note that gdk_pixbuf_new_from_file() can also throw
51
+ * errors directly from the underlying image loading library. For
52
+ * example, if GdkPixbuf is used then errors #GdkPixbufError<!-- -->s
53
+ * will be used directly.
54
+ */
55
+ export enum BitmapError {
56
+ /**
57
+ * Generic failure code, something went
58
+ * wrong.
59
+ */
60
+ FAILED,
61
+ /**
62
+ * Unknown image type.
63
+ */
64
+ UNKNOWN_TYPE,
65
+ /**
66
+ * An image file was broken somehow.
67
+ */
68
+ CORRUPT_IMAGE,
69
+ }
70
+ /**
71
+ * Error enumeration for the blend strings parser
72
+ */
73
+ export enum BlendStringError {
74
+ /**
75
+ * Generic parse error
76
+ */
77
+ PARSE_ERROR,
78
+ /**
79
+ * Argument parse error
80
+ */
81
+ ARGUMENT_PARSE_ERROR,
82
+ /**
83
+ * Internal parser error
84
+ */
85
+ INVALID_ERROR,
86
+ /**
87
+ * Blend string not
88
+ * supported by the GPU
89
+ */
90
+ GPU_UNSUPPORTED_ERROR,
91
+ }
92
+ /**
93
+ * When using depth testing one of these functions is used to compare
94
+ * the depth of an incoming fragment against the depth value currently
95
+ * stored in the depth buffer. The function is changed using
96
+ * cogl_depth_state_set_test_function().
97
+ *
98
+ * The test is only done when depth testing is explicitly enabled. (See
99
+ * cogl_depth_state_set_test_enabled())
100
+ */
101
+ export enum DepthTestFunction {
102
+ /**
103
+ * Never passes.
104
+ */
105
+ NEVER,
106
+ /**
107
+ * Passes if the fragment's depth
108
+ * value is less than the value currently in the depth buffer.
109
+ */
110
+ LESS,
111
+ /**
112
+ * Passes if the fragment's depth
113
+ * value is equal to the value currently in the depth buffer.
114
+ */
115
+ EQUAL,
116
+ /**
117
+ * Passes if the fragment's depth
118
+ * value is less or equal to the value currently in the depth buffer.
119
+ */
120
+ LEQUAL,
121
+ /**
122
+ * Passes if the fragment's depth
123
+ * value is greater than the value currently in the depth buffer.
124
+ */
125
+ GREATER,
126
+ /**
127
+ * Passes if the fragment's depth
128
+ * value is not equal to the value currently in the depth buffer.
129
+ */
130
+ NOTEQUAL,
131
+ /**
132
+ * Passes if the fragment's depth
133
+ * value greater than or equal to the value currently in the depth buffer.
134
+ */
135
+ GEQUAL,
136
+ /**
137
+ * Always passes.
138
+ */
139
+ ALWAYS,
140
+ }
141
+ /**
142
+ * All the capabilities that can vary between different GPUs supported
143
+ * by Cogl. Applications that depend on any of these features should explicitly
144
+ * check for them using cogl_has_feature() or cogl_has_features().
145
+ */
146
+ export enum FeatureID {
147
+ /**
148
+ * Set if
149
+ * %COGL_INDICES_TYPE_UNSIGNED_INT is supported in
150
+ * cogl_indices_new().
151
+ */
152
+ OGL_FEATURE_ID_UNSIGNED_INT_INDICES,
153
+ /**
154
+ * Whether cogl_buffer_map() is
155
+ * supported with CoglBufferAccess including read support.
156
+ */
157
+ OGL_FEATURE_ID_MAP_BUFFER_FOR_READ,
158
+ /**
159
+ * Whether cogl_buffer_map() is
160
+ * supported with CoglBufferAccess including write support.
161
+ */
162
+ OGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE,
163
+ OGL_FEATURE_ID_FENCE,
164
+ /**
165
+ * Support for
166
+ * %COGL_TEXTURE_COMPONENTS_RG as the internal components of a
167
+ * texture.
168
+ */
169
+ OGL_FEATURE_ID_TEXTURE_RG,
170
+ /**
171
+ * Available if the age of #CoglOnscreen back
172
+ * buffers are tracked and so cogl_onscreen_get_buffer_age() can be
173
+ * expected to return age values other than 0.
174
+ */
175
+ OGL_FEATURE_ID_BUFFER_AGE,
176
+ OGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL,
177
+ /**
178
+ * Whether blitting using
179
+ * cogl_blit_framebuffer() is supported.
180
+ */
181
+ OGL_FEATURE_ID_BLIT_FRAMEBUFFER,
182
+ OGL_FEATURE_ID_TIMESTAMP_QUERY,
183
+ }
184
+ /**
185
+ * Return values for the #CoglXlibFilterFunc and #CoglWin32FilterFunc functions.
186
+ */
187
+ export enum FilterReturn {
188
+ /**
189
+ * The event was not handled, continues the
190
+ * processing
191
+ */
192
+ CONTINUE,
193
+ /**
194
+ * Remove the event, stops the processing
195
+ */
196
+ REMOVE,
197
+ }
198
+ /**
199
+ * Identifiers that are passed to #CoglFrameCallback functions
200
+ * (registered using cogl_onscreen_add_frame_callback()) that
201
+ * mark the progression of a frame in some way which usually
202
+ * means that new information will have been accumulated in the
203
+ * frame's corresponding #CoglFrameInfo object.
204
+ *
205
+ * The last event that will be sent for a frame will be a
206
+ * `COGL_FRAME_EVENT_COMPLETE` event and so these are a good
207
+ * opportunity to collect statistics about a frame since the
208
+ * #CoglFrameInfo should hold the most data at this point.
209
+ *
210
+ * <note>A frame may not be completed before the next frame can start
211
+ * so applications should avoid needing to collect all statistics for
212
+ * a particular frame before they can start a new frame.</note>
213
+ */
214
+ export enum FrameEvent {
215
+ /**
216
+ * Notifies that the system compositor has
217
+ * acknowledged a frame and is ready for a
218
+ * new frame to be created.
219
+ */
220
+ SYNC,
221
+ /**
222
+ * Notifies that a frame has ended. This
223
+ * is a good time for applications to
224
+ * collect statistics about the frame
225
+ * since the #CoglFrameInfo should hold
226
+ * the most data at this point. No other
227
+ * events should be expected after a
228
+ * `COGL_FRAME_EVENT_COMPLETE` event.
229
+ */
230
+ COMPLETE,
231
+ }
232
+ export enum FramebufferError {
233
+ FRAMEBUFFER_ERROR_ALLOCATE,
234
+ }
235
+ /**
236
+ * All the error values that might be returned by
237
+ * cogl_get_graphics_reset_status(). Each value's meaning corresponds
238
+ * to the similarly named value defined in the ARB_robustness and
239
+ * NV_robustness_video_memory_purge extensions.
240
+ */
241
+ export enum GraphicsResetStatus {
242
+ NO_ERROR,
243
+ GUILTY_CONTEXT_RESET,
244
+ INNOCENT_CONTEXT_RESET,
245
+ UNKNOWN_CONTEXT_RESET,
246
+ PURGED_CONTEXT_RESET,
247
+ }
248
+ /**
249
+ * You should aim to use the smallest data type that gives you enough
250
+ * range, since it reduces the size of your index array and can help
251
+ * reduce the demand on memory bandwidth.
252
+ *
253
+ * Note that %COGL_INDICES_TYPE_UNSIGNED_INT is only supported if the
254
+ * %COGL_FEATURE_ID_UNSIGNED_INT_INDICES feature is available. This
255
+ * should always be available on OpenGL but on OpenGL ES it will only
256
+ * be available if the GL_OES_element_index_uint extension is
257
+ * advertized.
258
+ */
259
+ export enum IndicesType {
260
+ /**
261
+ * Your indices are unsigned bytes
262
+ */
263
+ BYTE,
264
+ /**
265
+ * Your indices are unsigned shorts
266
+ */
267
+ SHORT,
268
+ /**
269
+ * Your indices are unsigned ints
270
+ */
271
+ INT,
272
+ }
273
+ /**
274
+ * Alpha testing happens before blending primitives with the framebuffer and
275
+ * gives an opportunity to discard fragments based on a comparison with the
276
+ * incoming alpha value and a reference alpha value. The #CoglPipelineAlphaFunc
277
+ * determines how the comparison is done.
278
+ */
279
+ export enum PipelineAlphaFunc {
280
+ /**
281
+ * Never let the fragment through.
282
+ */
283
+ NEVER,
284
+ /**
285
+ * Let the fragment through if the incoming
286
+ * alpha value is less than the reference alpha value
287
+ */
288
+ LESS,
289
+ /**
290
+ * Let the fragment through if the incoming
291
+ * alpha value equals the reference alpha value
292
+ */
293
+ EQUAL,
294
+ /**
295
+ * Let the fragment through if the incoming
296
+ * alpha value is less than or equal to the reference alpha value
297
+ */
298
+ LEQUAL,
299
+ /**
300
+ * Let the fragment through if the incoming
301
+ * alpha value is greater than the reference alpha value
302
+ */
303
+ GREATER,
304
+ /**
305
+ * Let the fragment through if the incoming
306
+ * alpha value does not equal the reference alpha value
307
+ */
308
+ NOTEQUAL,
309
+ /**
310
+ * Let the fragment through if the incoming
311
+ * alpha value is greater than or equal to the reference alpha value.
312
+ */
313
+ GEQUAL,
314
+ /**
315
+ * Always let the fragment through.
316
+ */
317
+ ALWAYS,
318
+ }
319
+ /**
320
+ * Specifies which faces should be culled. This can be set on a
321
+ * pipeline using cogl_pipeline_set_cull_face_mode().
322
+ */
323
+ export enum PipelineCullFaceMode {
324
+ /**
325
+ * Neither face will be
326
+ * culled. This is the default.
327
+ */
328
+ NONE,
329
+ /**
330
+ * Front faces will be culled.
331
+ */
332
+ FRONT,
333
+ /**
334
+ * Back faces will be culled.
335
+ */
336
+ BACK,
337
+ /**
338
+ * All faces will be culled.
339
+ */
340
+ BOTH,
341
+ }
342
+ /**
343
+ * Texture filtering is used whenever the current pixel maps either to more
344
+ * than one texture element (texel) or less than one. These filter enums
345
+ * correspond to different strategies used to come up with a pixel color, by
346
+ * possibly referring to multiple neighbouring texels and taking a weighted
347
+ * average or simply using the nearest texel.
348
+ */
349
+ export enum PipelineFilter {
350
+ /**
351
+ * Measuring in manhatten distance from the,
352
+ * current pixel center, use the nearest texture texel
353
+ */
354
+ NEAREST,
355
+ /**
356
+ * Use the weighted average of the 4 texels
357
+ * nearest the current pixel center
358
+ */
359
+ LINEAR,
360
+ /**
361
+ * Select the mimap level whose
362
+ * texel size most closely matches the current pixel, and use the
363
+ * %COGL_PIPELINE_FILTER_NEAREST criterion
364
+ */
365
+ NEAREST_MIPMAP_NEAREST,
366
+ /**
367
+ * Select the mimap level whose
368
+ * texel size most closely matches the current pixel, and use the
369
+ * %COGL_PIPELINE_FILTER_LINEAR criterion
370
+ */
371
+ LINEAR_MIPMAP_NEAREST,
372
+ /**
373
+ * Select the two mimap levels
374
+ * whose texel size most closely matches the current pixel, use
375
+ * the %COGL_PIPELINE_FILTER_NEAREST criterion on each one and take
376
+ * their weighted average
377
+ */
378
+ NEAREST_MIPMAP_LINEAR,
379
+ /**
380
+ * Select the two mimap levels
381
+ * whose texel size most closely matches the current pixel, use
382
+ * the %COGL_PIPELINE_FILTER_LINEAR criterion on each one and take
383
+ * their weighted average
384
+ */
385
+ LINEAR_MIPMAP_LINEAR,
386
+ }
387
+ /**
388
+ * The wrap mode specifies what happens when texture coordinates
389
+ * outside the range 0→1 are used. Note that if the filter mode is
390
+ * anything but %COGL_PIPELINE_FILTER_NEAREST then texels outside the
391
+ * range 0→1 might be used even when the coordinate is exactly 0 or 1
392
+ * because OpenGL will try to sample neighbouring pixels. For example
393
+ * if you are trying to render the full texture then you may get
394
+ * artifacts around the edges when the pixels from the other side are
395
+ * merged in if the wrap mode is set to repeat.
396
+ */
397
+ export enum PipelineWrapMode {
398
+ /**
399
+ * The texture will be repeated. This
400
+ * is useful for example to draw a tiled background.
401
+ */
402
+ REPEAT,
403
+ MIRRORED_REPEAT,
404
+ /**
405
+ * The coordinates outside the
406
+ * range 0→1 will sample copies of the edge pixels of the
407
+ * texture. This is useful to avoid artifacts if only one copy of
408
+ * the texture is being rendered.
409
+ */
410
+ CLAMP_TO_EDGE,
411
+ /**
412
+ * Cogl will try to automatically
413
+ * decide which of the above two to use. For cogl_rectangle(), it
414
+ * will use repeat mode if any of the texture coordinates are
415
+ * outside the range 0→1, otherwise it will use clamp to edge. For
416
+ * cogl_polygon() it will always use repeat mode. For
417
+ * cogl_vertex_buffer_draw() it will use repeat mode except for
418
+ * layers that have point sprite coordinate generation enabled. This
419
+ * is the default value.
420
+ */
421
+ AUTOMATIC,
422
+ }
423
+ export enum RendererError {
424
+ XLIB_DISPLAY_OPEN,
425
+ BAD_CONSTRAINT,
426
+ }
427
+ export enum ScanoutError {
428
+ SCANOUT_ERROR_INHIBITED,
429
+ }
430
+ /**
431
+ * Types of shaders
432
+ */
433
+ export enum ShaderType {
434
+ /**
435
+ * A program for processing vertices
436
+ */
437
+ VERTEX,
438
+ /**
439
+ * A program for processing fragments
440
+ */
441
+ FRAGMENT,
442
+ }
443
+ /**
444
+ * Represents how draw should affect the two buffers
445
+ * of a stereo framebuffer. See cogl_framebuffer_set_stereo_mode().
446
+ */
447
+ export enum StereoMode {
448
+ /**
449
+ * draw to both stereo buffers
450
+ */
451
+ BOTH,
452
+ /**
453
+ * draw only to the left stereo buffer
454
+ */
455
+ LEFT,
456
+ /**
457
+ * draw only to the left stereo buffer
458
+ */
459
+ RIGHT,
460
+ }
461
+ /**
462
+ * Error enumeration for Cogl
463
+ *
464
+ * The `COGL_SYSTEM_ERROR_UNSUPPORTED` error can be thrown for a
465
+ * variety of reasons. For example:
466
+ *
467
+ * <itemizedlist>
468
+ * <listitem><para>You've tried to use a feature that is not
469
+ * advertised by cogl_has_feature().</para></listitem>
470
+ * <listitem><para>The GPU can not handle the configuration you have
471
+ * requested. An example might be if you try to use too many texture
472
+ * layers in a single #CoglPipeline</para></listitem>
473
+ * <listitem><para>The driver does not support some
474
+ * configuration.</para></listiem>
475
+ * </itemizedlist>
476
+ *
477
+ * Currently this is only used by Cogl API marked as experimental so
478
+ * this enum should also be considered experimental.
479
+ */
480
+ export enum SystemError {
481
+ /**
482
+ * You tried to use a feature or
483
+ * configuration not currently available.
484
+ */
485
+ UNSUPPORTED,
486
+ /**
487
+ * You tried to allocate a resource
488
+ * such as a texture and there wasn't enough memory.
489
+ */
490
+ NO_MEMORY,
491
+ }
492
+ /**
493
+ * See cogl_texture_set_components().
494
+ */
495
+ export enum TextureComponents {
496
+ /**
497
+ * Only the alpha component
498
+ */
499
+ A,
500
+ /**
501
+ * Red and green components. Note that
502
+ * this can only be used if the %COGL_FEATURE_ID_TEXTURE_RG feature
503
+ * is advertised.
504
+ */
505
+ RG,
506
+ /**
507
+ * Red, green and blue components
508
+ */
509
+ RGB,
510
+ /**
511
+ * Red, green, blue and alpha components
512
+ */
513
+ RGBA,
514
+ /**
515
+ * Only a depth component
516
+ */
517
+ DEPTH,
518
+ }
519
+ /**
520
+ * Error codes that can be thrown when allocating textures.
521
+ */
522
+ export enum TextureError {
523
+ /**
524
+ * Unsupported size
525
+ */
526
+ SIZE,
527
+ /**
528
+ * Unsupported format
529
+ */
530
+ FORMAT,
531
+ BAD_PARAMETER,
532
+ /**
533
+ * A primitive texture type that is
534
+ * unsupported by the driver was used
535
+ */
536
+ TYPE,
537
+ }
538
+ /**
539
+ * Different ways of interpreting vertices when drawing.
540
+ */
541
+ export enum VerticesMode {
542
+ /**
543
+ * FIXME, equivalent to
544
+ * <constant>GL_POINTS</constant>
545
+ */
546
+ POINTS,
547
+ /**
548
+ * FIXME, equivalent to <constant>GL_LINES</constant>
549
+ */
550
+ LINES,
551
+ /**
552
+ * FIXME, equivalent to
553
+ * <constant>GL_LINE_LOOP</constant>
554
+ */
555
+ LINE_LOOP,
556
+ /**
557
+ * FIXME, equivalent to
558
+ * <constant>GL_LINE_STRIP</constant>
559
+ */
560
+ LINE_STRIP,
561
+ /**
562
+ * FIXME, equivalent to
563
+ * <constant>GL_TRIANGLES</constant>
564
+ */
565
+ TRIANGLES,
566
+ /**
567
+ * FIXME, equivalent to
568
+ * <constant>GL_TRIANGLE_STRIP</constant>
569
+ */
570
+ TRIANGLE_STRIP,
571
+ /**
572
+ * FIXME, equivalent to <constant>GL_TRIANGLE_FAN</constant>
573
+ */
574
+ TRIANGLE_FAN,
575
+ }
576
+ /**
577
+ * Enum used to represent the two directions of rotation. This can be
578
+ * used to set the front face for culling by calling
579
+ * cogl_pipeline_set_front_face_winding().
580
+ */
581
+ export enum Winding {
582
+ /**
583
+ * Vertices are in a clockwise order
584
+ */
585
+ CLOCKWISE,
586
+ /**
587
+ * Vertices are in a counter-clockwise order
588
+ */
589
+ COUNTER_CLOCKWISE,
590
+ }
591
+ export enum WinsysFeature {
592
+ VBLANK_COUNTER,
593
+ VBLANK_WAIT,
594
+ TEXTURE_FROM_PIXMAP,
595
+ SWAP_BUFFERS_EVENT,
596
+ SWAP_REGION,
597
+ SWAP_REGION_THROTTLE,
598
+ SWAP_REGION_SYNCHRONIZED,
599
+ BUFFER_AGE,
600
+ SYNC_AND_COMPLETE_EVENT,
601
+ N_FEATURES,
602
+ }
603
+ /**
604
+ * Types of auxiliary buffers
605
+ * @bitfield
606
+ */
607
+ export enum BufferBit {
608
+ /**
609
+ * Selects the primary color buffer
610
+ */
611
+ COLOR,
612
+ /**
613
+ * Selects the depth buffer
614
+ */
615
+ DEPTH,
616
+ /**
617
+ * Selects the stencil buffer
618
+ */
619
+ STENCIL,
620
+ }
621
+ /**
622
+ * Target flags for FBOs.
623
+ * @bitfield
624
+ */
625
+ export enum BufferTarget {
626
+ /**
627
+ * FIXME
628
+ */
629
+ WINDOW_BUFFER,
630
+ /**
631
+ * FIXME
632
+ */
633
+ OFFSCREEN_BUFFER,
634
+ }
635
+ export enum EglImageFlags {
636
+ NONE,
637
+ NO_GET_DATA,
638
+ }
639
+ /**
640
+ * Pixel formats used by Cogl. For the formats with a byte per
641
+ * component, the order of the components specify the order in
642
+ * increasing memory addresses. So for example
643
+ * %COGL_PIXEL_FORMAT_RGB_888 would have the red component in the
644
+ * lowest address, green in the next address and blue after that
645
+ * regardless of the endianness of the system.
646
+ *
647
+ * For the formats with non byte aligned components the component
648
+ * order specifies the order within a 16-bit or 32-bit number from
649
+ * most significant bit to least significant. So for
650
+ * %COGL_PIXEL_FORMAT_RGB_565, the red component would be in bits
651
+ * 11-15, the green component would be in 6-11 and the blue component
652
+ * would be in 1-5. Therefore the order in memory depends on the
653
+ * endianness of the system.
654
+ *
655
+ * When uploading a texture %COGL_PIXEL_FORMAT_ANY can be used as the
656
+ * internal format. Cogl will try to pick the best format to use
657
+ * internally and convert the texture data if necessary.
658
+ * @bitfield
659
+ */
660
+ export enum PixelFormat {
661
+ /**
662
+ * Any format
663
+ */
664
+ ANY,
665
+ /**
666
+ * 8 bits alpha mask
667
+ */
668
+ A_8,
669
+ /**
670
+ * RGB, 16 bits
671
+ */
672
+ RGB_565,
673
+ /**
674
+ * RGBA, 16 bits
675
+ */
676
+ RGBA_4444,
677
+ /**
678
+ * RGBA, 16 bits
679
+ */
680
+ RGBA_5551,
681
+ /**
682
+ * Not currently supported
683
+ */
684
+ YUV,
685
+ /**
686
+ * Single luminance component
687
+ */
688
+ G_8,
689
+ /**
690
+ * RG, 16 bits. Note that red-green textures
691
+ * are only available if %COGL_FEATURE_ID_TEXTURE_RG is advertised.
692
+ * See cogl_texture_set_components() for details.
693
+ */
694
+ RG_88,
695
+ /**
696
+ * RGB, 24 bits
697
+ */
698
+ RGB_888,
699
+ /**
700
+ * BGR, 24 bits
701
+ */
702
+ BGR_888,
703
+ /**
704
+ * RGBA, 32 bits
705
+ */
706
+ RGBA_8888,
707
+ /**
708
+ * BGRA, 32 bits
709
+ */
710
+ BGRA_8888,
711
+ /**
712
+ * ARGB, 32 bits
713
+ */
714
+ ARGB_8888,
715
+ /**
716
+ * ABGR, 32 bits
717
+ */
718
+ ABGR_8888,
719
+ /**
720
+ * RGBA, 32 bits, 10 bpc
721
+ */
722
+ RGBA_1010102,
723
+ /**
724
+ * BGRA, 32 bits, 10 bpc
725
+ */
726
+ BGRA_1010102,
727
+ XRGB_2101010,
728
+ /**
729
+ * ARGB, 32 bits, 10 bpc
730
+ */
731
+ ARGB_2101010,
732
+ XBGR_2101010,
733
+ /**
734
+ * ABGR, 32 bits, 10 bpc
735
+ */
736
+ ABGR_2101010,
737
+ /**
738
+ * RGBA half floating point, 64 bit
739
+ */
740
+ RGBA_FP_16161616,
741
+ /**
742
+ * BGRA half floating point, 64 bit
743
+ */
744
+ BGRA_FP_16161616,
745
+ XRGB_FP_16161616,
746
+ /**
747
+ * ARGB half floating point, 64 bit
748
+ */
749
+ ARGB_FP_16161616,
750
+ XBGR_FP_16161616,
751
+ /**
752
+ * ABGR half floating point, 64 bit
753
+ */
754
+ ABGR_FP_16161616,
755
+ /**
756
+ * Premultiplied RGBA, 32 bits
757
+ */
758
+ RGBA_8888_PRE,
759
+ /**
760
+ * Premultiplied BGRA, 32 bits
761
+ */
762
+ BGRA_8888_PRE,
763
+ /**
764
+ * Premultiplied ARGB, 32 bits
765
+ */
766
+ ARGB_8888_PRE,
767
+ /**
768
+ * Premultiplied ABGR, 32 bits
769
+ */
770
+ ABGR_8888_PRE,
771
+ /**
772
+ * Premultiplied RGBA, 16 bits
773
+ */
774
+ RGBA_4444_PRE,
775
+ /**
776
+ * Premultiplied RGBA, 16 bits
777
+ */
778
+ RGBA_5551_PRE,
779
+ /**
780
+ * Premultiplied RGBA, 32 bits, 10 bpc
781
+ */
782
+ RGBA_1010102_PRE,
783
+ /**
784
+ * Premultiplied BGRA, 32 bits, 10 bpc
785
+ */
786
+ BGRA_1010102_PRE,
787
+ /**
788
+ * Premultiplied ARGB, 32 bits, 10 bpc
789
+ */
790
+ ARGB_2101010_PRE,
791
+ /**
792
+ * Premultiplied ABGR, 32 bits, 10 bpc
793
+ */
794
+ ABGR_2101010_PRE,
795
+ /**
796
+ * Premultiplied RGBA half floating point, 64 bit
797
+ */
798
+ RGBA_FP_16161616_PRE,
799
+ /**
800
+ * Premultiplied BGRA half floating point, 64 bit
801
+ */
802
+ BGRA_FP_16161616_PRE,
803
+ /**
804
+ * Premultiplied ARGB half floating point, 64 bit
805
+ */
806
+ ARGB_FP_16161616_PRE,
807
+ /**
808
+ * Premultiplied ABGR half floating point, 64 bit
809
+ */
810
+ ABGR_FP_16161616_PRE,
811
+ DEPTH_16,
812
+ DEPTH_32,
813
+ DEPTH_24_STENCIL_8,
814
+ }
815
+ /**
816
+ * Flags for cogl_framebuffer_read_pixels_into_bitmap()
817
+ * @bitfield
818
+ */
819
+ export enum ReadPixelsFlags {
820
+ /**
821
+ * Read from the color buffer
822
+ */
823
+ READ_PIXELS_COLOR_BUFFER,
824
+ }
825
+ /**
826
+ * Flags to pass to the cogl_texture_new_* family of functions.
827
+ * @bitfield
828
+ */
829
+ export enum TextureFlags {
830
+ /**
831
+ * No flags specified
832
+ */
833
+ NONE,
834
+ /**
835
+ * Disables the automatic generation of
836
+ * the mipmap pyramid from the base level image whenever it is
837
+ * updated. The mipmaps are only generated when the texture is
838
+ * rendered with a mipmap filter so it should be free to leave out
839
+ * this flag when using other filtering modes
840
+ */
841
+ NO_AUTO_MIPMAP,
842
+ /**
843
+ * Disables the slicing of the texture
844
+ */
845
+ NO_SLICING,
846
+ /**
847
+ * Disables the insertion of the texture inside
848
+ * the texture atlas used by Cogl
849
+ */
850
+ NO_ATLAS,
851
+ }
852
+ export const AFIRST_BIT: number
853
+ export const A_BIT: number
854
+ export const BGR_BIT: number
855
+ export const DEPTH_BIT: number
856
+ /**
857
+ * The maximum number of planes of a pixel format (see also
858
+ * cogl_pixel_format_get_planes()).
859
+ */
860
+ export const PIXEL_FORMAT_MAX_PLANES: number
861
+ export const PREMULT_BIT: number
862
+ export const STENCIL_BIT: number
863
+ export const TEXTURE_MAX_WASTE: number
864
+ export function blend_string_error_quark(): number
865
+ /**
866
+ * `return` FALSE for an immediately detected error, TRUE otherwise.
867
+ *
868
+ * This blits a region of the color buffer of the source buffer
869
+ * to the destination buffer. This function should only be
870
+ * called if the COGL_FEATURE_ID_BLIT_FRAMEBUFFER feature is
871
+ * advertised.
872
+ *
873
+ * The source and destination rectangles are defined in offscreen
874
+ * framebuffer orientation. When copying between an offscreen and
875
+ * onscreen framebuffers, the image is y-flipped accordingly.
876
+ *
877
+ * The two buffers must have the same value types (e.g. floating-point,
878
+ * unsigned int, signed int, or fixed-point), but color formats do not
879
+ * need to match. This limitation comes from OpenGL ES 3.0 definition
880
+ * of glBlitFramebuffer.
881
+ *
882
+ * Note that this function differs a lot from the glBlitFramebuffer
883
+ * function provided by the GL_EXT_framebuffer_blit extension. Notably
884
+ * it doesn't support having different sizes for the source and
885
+ * destination rectangle. This doesn't seem
886
+ * like a particularly useful feature. If the application wanted to
887
+ * scale the results it may make more sense to draw a primitive
888
+ * instead.
889
+ *
890
+ * The GL function is documented to be affected by the scissor. This
891
+ * function therefore ensure that an empty clip stack is flushed
892
+ * before performing the blit which means the scissor is effectively
893
+ * ignored.
894
+ *
895
+ * The function also doesn't support specifying the buffers to copy
896
+ * and instead only the color buffer is copied. When copying the depth
897
+ * or stencil buffers the extension on GLES2.0 only supports copying
898
+ * the full buffer which would be awkward to document with this
899
+ * API. If we wanted to support that feature it may be better to have
900
+ * a separate function to copy the entire buffer for a given mask.
901
+ *
902
+ * The `c` error argument is optional, it can be NULL. If it is not NULL
903
+ * and this function returns FALSE, an error object with a code from
904
+ * COGL_SYSTEM_ERROR will be created.
905
+ * @param framebuffer The source #CoglFramebuffer
906
+ * @param dst The destination #CoglFramebuffer
907
+ * @param src_x Source x position
908
+ * @param src_y Source y position
909
+ * @param dst_x Destination x position
910
+ * @param dst_y Destination y position
911
+ * @param width Width of region to copy
912
+ * @param height Height of region to copy
913
+ */
914
+ export function blit_framebuffer(framebuffer: Framebuffer, dst: Framebuffer, src_x: number, src_y: number, dst_x: number, dst_y: number, width: number, height: number): boolean
915
+ export function clutter_winsys_has_feature_CLUTTER(feature: WinsysFeature): boolean
916
+ /**
917
+ * Compares two #CoglColor<!-- -->s and checks if they are the same.
918
+ *
919
+ * This function can be passed to g_hash_table_new() as the `key_equal_func`
920
+ * parameter, when using #CoglColor<!-- -->s as keys in a #GHashTable.
921
+ * @param v1 a #CoglColor
922
+ * @param v2 a #CoglColor
923
+ * @returns %TRUE if the two colors are the same.
924
+ */
925
+ export function color_equal(v1: any | null, v2: any | null): boolean
926
+ /**
927
+ * Converts a color expressed in HLS (hue, luminance and saturation)
928
+ * values into a #CoglColor.
929
+ * @param hue hue value, in the 0 .. 360 range
930
+ * @param saturation saturation value, in the 0 .. 1 range
931
+ * @param luminance luminance value, in the 0 .. 1 range
932
+ */
933
+ export function color_init_from_hsl(hue: number, saturation: number, luminance: number): /* color */ Color
934
+ /**
935
+ * Create a new cogl program object that can be used to replace parts of the GL
936
+ * rendering pipeline with custom code.
937
+ * @returns a new cogl program.
938
+ */
939
+ export function create_program(): Handle
940
+ /**
941
+ * Create a new shader handle, use cogl_shader_source() to set the
942
+ * source code to be used on it.
943
+ * @param shader_type COGL_SHADER_TYPE_VERTEX or COGL_SHADER_TYPE_FRAGMENT.
944
+ * @returns a new shader handle.
945
+ */
946
+ export function create_shader(shader_type: ShaderType): Handle
947
+ /**
948
+ * Invokes `func` once for each type of object that Cogl uses and
949
+ * passes a count of the number of objects for that type. This is
950
+ * intended to be used solely for debugging purposes to track down
951
+ * issues with objects leaking.
952
+ * @param func A callback function for each type
953
+ */
954
+ export function debug_object_foreach_type(func: DebugObjectForeachTypeCallback): void
955
+ /**
956
+ * Prints a list of all the object types that Cogl uses along with the
957
+ * number of objects of that type that are currently in use. This is
958
+ * intended to be used solely for debugging purposes to track down
959
+ * issues with objects leaking.
960
+ */
961
+ export function debug_object_print_instances(): void
962
+ /**
963
+ * This function should only need to be called in exceptional circumstances.
964
+ *
965
+ * As an optimization Cogl drawing functions may batch up primitives
966
+ * internally, so if you are trying to use raw GL outside of Cogl you stand a
967
+ * better chance of being successful if you ask Cogl to flush any batched
968
+ * geometry before making your state changes.
969
+ *
970
+ * It only ensure that the underlying driver is issued all the commands
971
+ * necessary to draw the batched primitives. It provides no guarantees about
972
+ * when the driver will complete the rendering.
973
+ *
974
+ * This provides no guarantees about the GL state upon returning and to avoid
975
+ * confusing Cogl you should aim to restore any changes you make before
976
+ * resuming use of Cogl.
977
+ *
978
+ * If you are making state changes with the intention of affecting Cogl drawing
979
+ * primitives you are 100% on your own since you stand a good chance of
980
+ * conflicting with Cogl internals. For example clutter-gst which currently
981
+ * uses direct GL calls to bind ARBfp programs will very likely break when Cogl
982
+ * starts to use ARBfb programs itself for the material API.
983
+ */
984
+ export function flush(): void
985
+ /**
986
+ * Iterates through all the context level features currently supported
987
+ * for a given `context` and for each feature `callback` is called.
988
+ * @param context A #CoglContext pointer
989
+ * @param callback A #CoglFeatureCallback called for each supported feature
990
+ */
991
+ export function foreach_feature(context: Context, callback: FeatureCallback): void
992
+ /**
993
+ * Returns the graphics reset status as reported by
994
+ * GetGraphicsResetStatusARB defined in the ARB_robustness extension.
995
+ *
996
+ * Note that Cogl doesn't normally enable the ARB_robustness
997
+ * extension in which case this will only ever return
998
+ * #COGL_GRAPHICS_RESET_STATUS_NO_ERROR.
999
+ *
1000
+ * Applications must explicitly use a backend specific method to
1001
+ * request that errors get reported such as X11's
1002
+ * cogl_xlib_renderer_request_reset_on_video_memory_purge().
1003
+ * @param context a #CoglContext pointer
1004
+ * @returns a #CoglGraphicsResetStatus
1005
+ */
1006
+ export function get_graphics_reset_status(context: Context): GraphicsResetStatus
1007
+ /**
1008
+ * Retrieves the #GOptionGroup used by Cogl to parse the command
1009
+ * line options. Clutter uses this to handle the Cogl command line
1010
+ * options during its initialization process.
1011
+ * @returns a #GOptionGroup
1012
+ */
1013
+ export function get_option_group(): GLib.OptionGroup
1014
+ export function handle_get_type(): GObject.GType
1015
+ /**
1016
+ * Checks if a given `feature` is currently available
1017
+ *
1018
+ * Cogl does not aim to be a lowest common denominator API, it aims to
1019
+ * expose all the interesting features of GPUs to application which
1020
+ * means applications have some responsibility to explicitly check
1021
+ * that certain features are available before depending on them.
1022
+ * @param context A #CoglContext pointer
1023
+ * @param feature A #CoglFeatureID
1024
+ * @returns %TRUE if the @feature is currently supported or %FALSE if not.
1025
+ */
1026
+ export function has_feature(context: Context, feature: FeatureID): boolean
1027
+ /**
1028
+ * Checks whether `object` is a #CoglBitmap
1029
+ * @param object a #CoglObject pointer
1030
+ * @returns %TRUE if the passed @object represents a bitmap, and %FALSE otherwise
1031
+ */
1032
+ export function is_bitmap(object: any | null): boolean
1033
+ /**
1034
+ * Gets whether the given object references an existing context object.
1035
+ * @param object An object or %NULL
1036
+ * @returns %TRUE if the @object references a #CoglContext, %FALSE otherwise
1037
+ */
1038
+ export function is_context(object: any | null): boolean
1039
+ /**
1040
+ * Gets whether the given object references a #CoglFrameInfo.
1041
+ * @param object A #CoglObject pointer
1042
+ * @returns %TRUE if the object references a #CoglFrameInfo and %FALSE otherwise.
1043
+ */
1044
+ export function is_frame_info(object: any | null): boolean
1045
+ /**
1046
+ * Gets whether the given object references a #CoglFramebuffer.
1047
+ * @param object A #CoglObject pointer
1048
+ * @returns %TRUE if the object references a #CoglFramebuffer and %FALSE otherwise.
1049
+ */
1050
+ export function is_framebuffer(object: any | null): boolean
1051
+ /**
1052
+ * Gets whether the given `object` references an existing pipeline object.
1053
+ * @param object A #CoglObject
1054
+ * @returns %TRUE if the @object references a #CoglPipeline, %FALSE otherwise
1055
+ */
1056
+ export function is_pipeline(object: any | null): boolean
1057
+ /**
1058
+ * Gets whether the given handle references an existing program object.
1059
+ * @param handle A CoglHandle
1060
+ * @returns %TRUE if the handle references a program, %FALSE otherwise
1061
+ */
1062
+ export function is_program(handle: Handle): boolean
1063
+ /**
1064
+ * Gets whether the given handle references an existing shader object.
1065
+ * @param handle A CoglHandle
1066
+ * @returns %TRUE if the handle references a shader, %FALSE otherwise
1067
+ */
1068
+ export function is_shader(handle: Handle): boolean
1069
+ /**
1070
+ * Gets whether the given object references a texture object.
1071
+ * @param object A #CoglObject pointer
1072
+ * @returns %TRUE if the @object references a texture, and %FALSE otherwise
1073
+ */
1074
+ export function is_texture(object: any | null): boolean
1075
+ /**
1076
+ * Gets whether the given object references an existing #CoglTexture2D
1077
+ * object.
1078
+ * @param object A #CoglObject
1079
+ * @returns %TRUE if the object references a #CoglTexture2D, %FALSE otherwise
1080
+ */
1081
+ export function is_texture_2d(object: any | null): boolean
1082
+ /**
1083
+ * Gets whether the given object references a #CoglTexture2DSliced.
1084
+ * @param object A #CoglObject pointer
1085
+ * @returns %TRUE if the object references a #CoglTexture2DSliced and %FALSE otherwise.
1086
+ */
1087
+ export function is_texture_2d_sliced(object: any | null): boolean
1088
+ /**
1089
+ * Queries the number of bytes per pixel for a given format in the given plane.
1090
+ * @param format The pixel format
1091
+ * @param plane The index of the plane (should not be more than the number of planes in the given format).
1092
+ * @returns The number of bytes per pixel in the given format's given plane.
1093
+ */
1094
+ export function pixel_format_get_bytes_per_pixel(format: PixelFormat, plane: number): number
1095
+ /**
1096
+ * Returns the number of planes the given CoglPixelFormat specifies.
1097
+ * @param format The format for which to get the number of planes
1098
+ * @returns The no. of planes of @format (at most %COGL_PIXEL_FORMAT_MAX_PLANES)
1099
+ */
1100
+ export function pixel_format_get_n_planes(format: PixelFormat): number
1101
+ /**
1102
+ * Returns a string representation of `format,` useful for debugging purposes.
1103
+ * @param format a #CoglPixelFormat
1104
+ * @returns A string representation of @format.
1105
+ */
1106
+ export function pixel_format_to_string(format: PixelFormat): string | null
1107
+ /**
1108
+ * Attaches a shader to a program object. A program can have multiple
1109
+ * vertex or fragment shaders but only one of them may provide a
1110
+ * main() function. It is allowed to use a program with only a vertex
1111
+ * shader or only a fragment shader.
1112
+ * @param program_handle a #CoglHandle for a shdaer program.
1113
+ * @param shader_handle a #CoglHandle for a vertex of fragment shader.
1114
+ */
1115
+ export function program_attach_shader(program_handle: Handle, shader_handle: Handle): void
1116
+ /**
1117
+ * Retrieve the location (offset) of a uniform variable in a shader program,
1118
+ * a uniform is a variable that is constant for all vertices/fragments for a
1119
+ * shader object and is possible to modify as an external parameter.
1120
+ * @param handle a #CoglHandle for a shader program.
1121
+ * @param uniform_name the name of a uniform.
1122
+ * @returns the offset of a uniform in a specified program.
1123
+ */
1124
+ export function program_get_uniform_location(handle: Handle, uniform_name: string | null): number
1125
+ /**
1126
+ * Links a program making it ready for use. Note that calling this
1127
+ * function is optional. If it is not called the program will
1128
+ * automatically be linked the first time it is used.
1129
+ * @param handle a #CoglHandle for a shader program.
1130
+ */
1131
+ export function program_link(handle: Handle): void
1132
+ /**
1133
+ * Changes the value of a floating point uniform for the given linked
1134
+ * `program`.
1135
+ * @param program A #CoglHandle for a linked program
1136
+ * @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
1137
+ * @param value the new value of the uniform.
1138
+ */
1139
+ export function program_set_uniform_1f(program: Handle, uniform_location: number, value: number): void
1140
+ /**
1141
+ * Changes the value of an integer uniform for the given linked
1142
+ * `program`.
1143
+ * @param program A #CoglHandle for a linked program
1144
+ * @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
1145
+ * @param value the new value of the uniform.
1146
+ */
1147
+ export function program_set_uniform_1i(program: Handle, uniform_location: number, value: number): void
1148
+ /**
1149
+ * Changes the value of a float vector uniform, or uniform array for
1150
+ * the given linked `program`.
1151
+ * @param program A #CoglHandle for a linked program
1152
+ * @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
1153
+ * @param n_components The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4.
1154
+ * @param value the new value of the uniform[s].
1155
+ */
1156
+ export function program_set_uniform_float(program: Handle, uniform_location: number, n_components: number, value: number[]): void
1157
+ /**
1158
+ * Changes the value of a int vector uniform, or uniform array for
1159
+ * the given linked `program`.
1160
+ * @param program A #CoglHandle for a linked program
1161
+ * @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
1162
+ * @param n_components The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4.
1163
+ * @param value the new value of the uniform[s].
1164
+ */
1165
+ export function program_set_uniform_int(program: Handle, uniform_location: number, n_components: number, value: number[]): void
1166
+ /**
1167
+ * Changes the value of a matrix uniform, or uniform array in the
1168
+ * given linked `program`.
1169
+ * @param program A #CoglHandle for a linked program
1170
+ * @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
1171
+ * @param dimensions The dimensions of the matrix. So for for example pass 2 for a 2x2 matrix or 3 for 3x3.
1172
+ * @param transpose Whether to transpose the matrix when setting the uniform.
1173
+ * @param value the new value of the uniform.
1174
+ */
1175
+ export function program_set_uniform_matrix(program: Handle, uniform_location: number, dimensions: number, transpose: boolean, value: number[]): void
1176
+ export function scanout_error_quark(): GLib.Quark
1177
+ export function set_tracing_disabled_on_thread(main_context: GLib.MainContext): void
1178
+ export function set_tracing_enabled_on_thread(main_context: GLib.MainContext, group: string | null, filename: string | null): void
1179
+ export function set_tracing_enabled_on_thread_with_fd(main_context: GLib.MainContext, group: string | null, fd: number): void
1180
+ /**
1181
+ * Retrieves the type of a shader #CoglHandle
1182
+ * @param handle #CoglHandle for a shader.
1183
+ * @returns %COGL_SHADER_TYPE_VERTEX if the shader is a vertex processor or %COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor
1184
+ */
1185
+ export function shader_get_type(handle: Handle): ShaderType
1186
+ /**
1187
+ * Replaces the current source associated with a shader with a new
1188
+ * one.
1189
+ *
1190
+ * Please see <link
1191
+ * linkend="cogl-Shaders-and-Programmable-Pipeline.description">above</link>
1192
+ * for a description of the recommended format for the shader code.
1193
+ * @param shader #CoglHandle for a shader.
1194
+ * @param source Shader source.
1195
+ */
1196
+ export function shader_source(shader: Handle, source: string | null): void
1197
+ export function texture_error_quark(): number
1198
+ /**
1199
+ * Creates a #CoglTexture from a #CoglBitmap.
1200
+ * @param bitmap A #CoglBitmap pointer
1201
+ * @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
1202
+ * @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture
1203
+ * @returns A newly created #CoglTexture or %NULL on failure
1204
+ */
1205
+ export function texture_new_from_bitmap(bitmap: Bitmap, flags: TextureFlags, internal_format: PixelFormat): Texture
1206
+ /**
1207
+ * Creates a new #CoglTexture based on data residing in memory.
1208
+ * @param width width of texture in pixels
1209
+ * @param height height of texture in pixels
1210
+ * @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
1211
+ * @param format the #CoglPixelFormat the buffer is stored in in RAM
1212
+ * @param internal_format the #CoglPixelFormat that will be used for storing the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
1213
+ * @param rowstride the memory offset in bytes between the starts of scanlines in `data`
1214
+ * @param data pointer the memory region where the source buffer resides
1215
+ * @returns A newly created #CoglTexture or %NULL on failure
1216
+ */
1217
+ export function texture_new_from_data(width: number, height: number, flags: TextureFlags, format: PixelFormat, internal_format: PixelFormat, rowstride: number, data: Uint8Array): Texture
1218
+ /**
1219
+ * Creates a #CoglTexture from an image file.
1220
+ * @param filename the file to load
1221
+ * @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
1222
+ * @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
1223
+ * @returns A newly created #CoglTexture or %NULL on failure
1224
+ */
1225
+ export function texture_new_from_file(filename: string | null, flags: TextureFlags, internal_format: PixelFormat): Texture
1226
+ export function trace_describe(head: TraceHead, description: string | null): void
1227
+ export function trace_end(head: TraceHead): void
1228
+ /**
1229
+ * A callback function to use for cogl_debug_object_foreach_type().
1230
+ * @callback
1231
+ * @param info A pointer to a struct containing information about the type.
1232
+ */
1233
+ export interface DebugObjectForeachTypeCallback {
1234
+ (info: DebugObjectTypeInfo): void
1235
+ }
1236
+ /**
1237
+ * A callback used with cogl_foreach_feature() for enumerating all
1238
+ * context level features supported by Cogl.
1239
+ * @callback
1240
+ * @param feature A single feature currently supported by Cogl
1241
+ */
1242
+ export interface FeatureCallback {
1243
+ (feature: FeatureID): void
1244
+ }
1245
+ /**
1246
+ * Is a callback that can be registered via
1247
+ * cogl_onscreen_add_frame_callback() to be called when a frame
1248
+ * progresses in some notable way.
1249
+ *
1250
+ * Please see the documentation for #CoglFrameEvent and
1251
+ * cogl_onscreen_add_frame_callback() for more details about what
1252
+ * events can be notified.
1253
+ * @callback
1254
+ * @param onscreen The onscreen that the frame is associated with
1255
+ * @param event A #CoglFrameEvent notifying how the frame has progressed
1256
+ * @param info The meta information, such as timing information, about the frame that has progressed.
1257
+ */
1258
+ export interface FrameCallback {
1259
+ (onscreen: Onscreen, event: FrameEvent, info: FrameInfo): void
1260
+ }
1261
+ /**
1262
+ * Is a callback that can be registered via
1263
+ * cogl_onscreen_add_dirty_callback() to be called when the windowing
1264
+ * system determines that a region of the onscreen window has been
1265
+ * lost and the application should redraw it.
1266
+ * @callback
1267
+ * @param onscreen The onscreen that the frame is associated with
1268
+ * @param info A #CoglOnscreenDirtyInfo struct containing the details of the dirty area
1269
+ */
1270
+ export interface OnscreenDirtyCallback {
1271
+ (onscreen: Onscreen, info: OnscreenDirtyInfo): void
1272
+ }
1273
+ /**
1274
+ * The callback prototype used with cogl_pipeline_foreach_layer() for
1275
+ * iterating all the layers of a `pipeline`.
1276
+ * @callback
1277
+ * @param pipeline The #CoglPipeline whose layers are being iterated
1278
+ * @param layer_index The current layer index
1279
+ */
1280
+ export interface PipelineLayerCallback {
1281
+ (pipeline: Pipeline, layer_index: number): boolean
1282
+ }
1283
+ export interface Texture2DEGLImageExternalAlloc {
1284
+ (tex_2d: Texture2D): boolean
1285
+ }
1286
+ export module Texture {
1287
+
1288
+ // Constructor properties interface
1289
+
1290
+ export interface ConstructorProperties extends Object.ConstructorProperties, GObject.Object.ConstructorProperties {
1291
+ }
1292
+
1293
+ }
1294
+
1295
+ export interface Texture extends Object {
1296
+
1297
+ // Owm methods of Cogl-10.Cogl.Texture
1298
+
1299
+ /**
1300
+ * Explicitly allocates the storage for the given `texture` which
1301
+ * allows you to be sure that there is enough memory for the
1302
+ * texture and if not then the error can be handled gracefully.
1303
+ *
1304
+ * <note>Normally applications don't need to use this api directly
1305
+ * since the texture will be implicitly allocated when data is set on
1306
+ * the texture, or if the texture is attached to a #CoglOffscreen
1307
+ * framebuffer and rendered too.</note>
1308
+ * @returns %TRUE if the texture was successfully allocated, otherwise %FALSE and @error will be updated if it wasn't %NULL.
1309
+ */
1310
+ allocate(): boolean
1311
+ /**
1312
+ * Queries what components the given `texture` stores internally as set
1313
+ * via cogl_texture_set_components().
1314
+ *
1315
+ * For textures created by the ‘_with_size’ constructors the default
1316
+ * is %COGL_TEXTURE_COMPONENTS_RGBA. The other constructors which take
1317
+ * a %CoglBitmap or a data pointer default to the same components as
1318
+ * the pixel format of the data.
1319
+ */
1320
+ get_components(): TextureComponents
1321
+ /**
1322
+ * Copies the pixel data from a cogl texture to system memory.
1323
+ *
1324
+ * <note>Don't pass the value of cogl_texture_get_rowstride() as the
1325
+ * `rowstride` argument, the rowstride should be the rowstride you
1326
+ * want for the destination `data` buffer not the rowstride of the
1327
+ * source texture</note>
1328
+ * @param format the #CoglPixelFormat to store the texture as.
1329
+ * @param rowstride the rowstride of `data` in bytes or pass 0 to calculate from the bytes-per-pixel of `format` multiplied by the `texture` width.
1330
+ * @param data memory location to write the `texture'`s contents, or %NULL to only query the data size through the return value.
1331
+ * @returns the size of the texture data in bytes
1332
+ */
1333
+ get_data(format: PixelFormat, rowstride: number, data: Uint8Array | null): number
1334
+
1335
+ // Overloads of get_data
1336
+
1337
+ /**
1338
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
1339
+ * @param key name of the key for that association
1340
+ * @returns the data if found, or %NULL if no such data exists.
1341
+ */
1342
+ get_data(key: string | null): any | null
1343
+ /**
1344
+ * Queries the GL handles for a GPU side texture through its #CoglTexture.
1345
+ *
1346
+ * If the texture is spliced the data for the first sub texture will be
1347
+ * queried.
1348
+ * @returns %TRUE if the handle was successfully retrieved, %FALSE if the handle was invalid
1349
+ */
1350
+ get_gl_texture(): [ /* returnType */ boolean, /* out_gl_handle */ number, /* out_gl_target */ number ]
1351
+ /**
1352
+ * Queries the height of a cogl texture.
1353
+ * @returns the height of the GPU side texture in pixels
1354
+ */
1355
+ get_height(): number
1356
+ /**
1357
+ * Queries the maximum wasted (unused) pixels in one dimension of a GPU side
1358
+ * texture.
1359
+ * @returns the maximum waste
1360
+ */
1361
+ get_max_waste(): number
1362
+ /**
1363
+ * Queries the pre-multiplied alpha status for internally stored red,
1364
+ * green and blue components for the given `texture` as set by
1365
+ * cogl_texture_set_premultiplied().
1366
+ *
1367
+ * By default the pre-multipled state is `TRUE`.
1368
+ * @returns %TRUE if red, green and blue components are internally stored pre-multiplied by the alpha value or %FALSE if not.
1369
+ */
1370
+ get_premultiplied(): boolean
1371
+ /**
1372
+ * Queries the width of a cogl texture.
1373
+ * @returns the width of the GPU side texture in pixels
1374
+ */
1375
+ get_width(): number
1376
+ /**
1377
+ * Queries if a texture is sliced (stored as multiple GPU side tecture
1378
+ * objects).
1379
+ * @returns %TRUE if the texture is sliced, %FALSE if the texture is stored as a single GPU texture
1380
+ */
1381
+ is_sliced(): boolean
1382
+ /**
1383
+ * Affects the internal storage format for this texture by specifying
1384
+ * what components will be required for sampling later.
1385
+ *
1386
+ * This api affects how data is uploaded to the GPU since unused
1387
+ * components can potentially be discarded from source data.
1388
+ *
1389
+ * For textures created by the ‘_with_size’ constructors the default
1390
+ * is %COGL_TEXTURE_COMPONENTS_RGBA. The other constructors which take
1391
+ * a %CoglBitmap or a data pointer default to the same components as
1392
+ * the pixel format of the data.
1393
+ *
1394
+ * Note that the %COGL_TEXTURE_COMPONENTS_RG format is not available
1395
+ * on all drivers. The availability can be determined by checking for
1396
+ * the %COGL_FEATURE_ID_TEXTURE_RG feature. If this format is used on
1397
+ * a driver where it is not available then %COGL_TEXTURE_ERROR_FORMAT
1398
+ * will be raised when the texture is allocated. Even if the feature
1399
+ * is not available then %COGL_PIXEL_FORMAT_RG_88 can still be used as
1400
+ * an image format as long as %COGL_TEXTURE_COMPONENTS_RG isn't used
1401
+ * as the texture's components.
1402
+ * @param components
1403
+ */
1404
+ set_components(components: TextureComponents): void
1405
+ /**
1406
+ * `texture` a #CoglTexture.
1407
+ * Sets all the pixels for a given mipmap `level` by copying the pixel
1408
+ * data pointed to by the `data` argument into the given `texture`.
1409
+ *
1410
+ * `data` should point to the first pixel to copy corresponding
1411
+ * to the top left of the mipmap `level` being set.
1412
+ *
1413
+ * If `rowstride` equals 0 then it will be automatically calculated
1414
+ * from the width of the mipmap level and the bytes-per-pixel for the
1415
+ * given `format`.
1416
+ *
1417
+ * A mipmap `level` of 0 corresponds to the largest, base image of a
1418
+ * texture and `level` 1 is half the width and height of level 0. If
1419
+ * dividing any dimension of the previous level by two results in a
1420
+ * fraction then round the number down (floor()), but clamp to 1
1421
+ * something like this:
1422
+ *
1423
+ *
1424
+ * ```
1425
+ * next_width = MAX (1, floor (prev_width));
1426
+ * ```
1427
+ *
1428
+ *
1429
+ * You can determine the number of mipmap levels for a given texture
1430
+ * like this:
1431
+ *
1432
+ *
1433
+ * ```
1434
+ * n_levels = 1 + floor (log2 (max_dimension));
1435
+ * ```
1436
+ *
1437
+ *
1438
+ * Where %max_dimension is the larger of cogl_texture_get_width() and
1439
+ * cogl_texture_get_height().
1440
+ *
1441
+ * It is an error to pass a `level` number >= the number of levels that
1442
+ * `texture` can have according to the above calculation.
1443
+ *
1444
+ * <note>Since the storage for a #CoglTexture is allocated lazily then
1445
+ * if the given `texture` has not previously been allocated then this
1446
+ * api can return %FALSE and throw an exceptional `error` if there is
1447
+ * not enough memory to allocate storage for `texture`.</note>
1448
+ * @param format the #CoglPixelFormat used in the source `data` buffer.
1449
+ * @param rowstride rowstride of the source `data` buffer (computed from the texture width and `format` if it equals 0)
1450
+ * @param data the source data, pointing to the first top-left pixel to set
1451
+ * @param level The mipmap level to update (Normally 0 for the largest, base texture)
1452
+ * @returns %TRUE if the data upload was successful, and %FALSE otherwise
1453
+ */
1454
+ set_data(format: PixelFormat, rowstride: number, data: Uint8Array, level: number): boolean
1455
+
1456
+ // Overloads of set_data
1457
+
1458
+ /**
1459
+ * Each object carries around a table of associations from
1460
+ * strings to pointers. This function lets you set an association.
1461
+ *
1462
+ * If the object already had an association with that name,
1463
+ * the old association will be destroyed.
1464
+ *
1465
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
1466
+ * This means a copy of `key` is kept permanently (even after `object` has been
1467
+ * finalized) — so it is recommended to only use a small, bounded set of values
1468
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
1469
+ * @param key name of the key
1470
+ * @param data data to associate with that key
1471
+ */
1472
+ set_data(key: string | null, data: any | null): void
1473
+ /**
1474
+ * Affects the internal storage format for this texture by specifying
1475
+ * whether red, green and blue color components should be stored as
1476
+ * pre-multiplied alpha values.
1477
+ *
1478
+ * This api affects how data is uploaded to the GPU since Cogl will
1479
+ * convert source data to have premultiplied or unpremultiplied
1480
+ * components according to this state.
1481
+ *
1482
+ * For example if you create a texture via
1483
+ * cogl_texture_2d_new_with_size() and then upload data via
1484
+ * cogl_texture_set_data() passing a source format of
1485
+ * %COGL_PIXEL_FORMAT_RGBA_8888 then Cogl will internally multiply the
1486
+ * red, green and blue components of the source data by the alpha
1487
+ * component, for each pixel so that the internally stored data has
1488
+ * pre-multiplied alpha components. If you instead upload data that
1489
+ * already has pre-multiplied components by passing
1490
+ * %COGL_PIXEL_FORMAT_RGBA_8888_PRE as the source format to
1491
+ * cogl_texture_set_data() then the data can be uploaded without being
1492
+ * converted.
1493
+ *
1494
+ * By default the `premultipled` state is `TRUE`.
1495
+ * @param premultiplied Whether any internally stored red, green or blue components are pre-multiplied by an alpha component.
1496
+ */
1497
+ set_premultiplied(premultiplied: boolean): void
1498
+ /**
1499
+ * Sets the pixels in a rectangular subregion of `texture` from an in-memory
1500
+ * buffer containing pixel data.
1501
+ *
1502
+ * <note>The region set can't be larger than the source `data<`/note>
1503
+ * @param src_x upper left coordinate to use from source data.
1504
+ * @param src_y upper left coordinate to use from source data.
1505
+ * @param dst_x upper left destination horizontal coordinate.
1506
+ * @param dst_y upper left destination vertical coordinate.
1507
+ * @param dst_width width of destination region to write. (Must be less than or equal to `width)`
1508
+ * @param dst_height height of destination region to write. (Must be less than or equal to `height)`
1509
+ * @param width width of source data buffer.
1510
+ * @param height height of source data buffer.
1511
+ * @param format the #CoglPixelFormat used in the source buffer.
1512
+ * @param rowstride rowstride of source buffer (computed from width if none specified)
1513
+ * @param data the actual pixel data.
1514
+ * @returns %TRUE if the subregion upload was successful, and %FALSE otherwise
1515
+ */
1516
+ set_region(src_x: number, src_y: number, dst_x: number, dst_y: number, dst_width: number, dst_height: number, width: number, height: number, format: PixelFormat, rowstride: number, data: Uint8Array): boolean
1517
+ /**
1518
+ * Copies a specified source region from `bitmap` to the position
1519
+ * (`src_x,` `src_y)` of the given destination texture `handle`.
1520
+ *
1521
+ * <note>The region updated can't be larger than the source
1522
+ * bitmap</note>
1523
+ * @param src_x upper left coordinate to use from the source bitmap.
1524
+ * @param src_y upper left coordinate to use from the source bitmap
1525
+ * @param dst_x upper left destination horizontal coordinate.
1526
+ * @param dst_y upper left destination vertical coordinate.
1527
+ * @param dst_width width of destination region to write. (Must be less than or equal to the bitmap width)
1528
+ * @param dst_height height of destination region to write. (Must be less than or equal to the bitmap height)
1529
+ * @param bitmap The source bitmap to read from
1530
+ * @returns %TRUE if the subregion upload was successful, and %FALSE otherwise
1531
+ */
1532
+ set_region_from_bitmap(src_x: number, src_y: number, dst_x: number, dst_y: number, dst_width: number, dst_height: number, bitmap: Bitmap): boolean
1533
+
1534
+ // Class property signals of Cogl-10.Cogl.Texture
1535
+
1536
+ connect(sigName: string, callback: (...args: any[]) => void): number
1537
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1538
+ emit(sigName: string, ...args: any[]): void
1539
+ disconnect(id: number): void
1540
+ }
1541
+
1542
+ export class Texture extends GObject.Object {
1543
+
1544
+ // Own properties of Cogl-10.Cogl.Texture
1545
+
1546
+ static name: string
1547
+ static $gtype: GObject.GType<Texture>
1548
+
1549
+ // Constructors of Cogl-10.Cogl.Texture
1550
+
1551
+ constructor(config?: Texture.ConstructorProperties)
1552
+ _init(config?: Texture.ConstructorProperties): void
1553
+ /**
1554
+ * Creates a #CoglTexture from a #CoglBitmap.
1555
+ * @param bitmap A #CoglBitmap pointer
1556
+ * @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
1557
+ * @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture
1558
+ * @returns A newly created #CoglTexture or %NULL on failure
1559
+ */
1560
+ static new_from_bitmap(bitmap: Bitmap, flags: TextureFlags, internal_format: PixelFormat): Texture
1561
+ /**
1562
+ * Creates a new #CoglTexture based on data residing in memory.
1563
+ * @param width width of texture in pixels
1564
+ * @param height height of texture in pixels
1565
+ * @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
1566
+ * @param format the #CoglPixelFormat the buffer is stored in in RAM
1567
+ * @param internal_format the #CoglPixelFormat that will be used for storing the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
1568
+ * @param rowstride the memory offset in bytes between the starts of scanlines in `data`
1569
+ * @param data pointer the memory region where the source buffer resides
1570
+ * @returns A newly created #CoglTexture or %NULL on failure
1571
+ */
1572
+ static new_from_data(width: number, height: number, flags: TextureFlags, format: PixelFormat, internal_format: PixelFormat, rowstride: number, data: Uint8Array): Texture
1573
+ /**
1574
+ * Creates a #CoglTexture from an image file.
1575
+ * @param filename the file to load
1576
+ * @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
1577
+ * @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
1578
+ * @returns A newly created #CoglTexture or %NULL on failure
1579
+ */
1580
+ static new_from_file(filename: string | null, flags: TextureFlags, internal_format: PixelFormat): Texture
1581
+ static error_quark(): number
1582
+ }
1583
+
1584
+ export module Bitmap {
1585
+
1586
+ // Constructor properties interface
1587
+
1588
+ export interface ConstructorProperties extends Object.ConstructorProperties {
1589
+ }
1590
+
1591
+ }
1592
+
1593
+ export interface Bitmap {
1594
+
1595
+ // Owm methods of Cogl-10.Cogl.Bitmap
1596
+
1597
+ get_format(): PixelFormat
1598
+ get_height(): number
1599
+ get_rowstride(): number
1600
+ get_width(): number
1601
+
1602
+ // Class property signals of Cogl-10.Cogl.Bitmap
1603
+
1604
+ connect(sigName: string, callback: (...args: any[]) => void): number
1605
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1606
+ emit(sigName: string, ...args: any[]): void
1607
+ disconnect(id: number): void
1608
+ }
1609
+
1610
+ export class Bitmap extends Object {
1611
+
1612
+ // Own properties of Cogl-10.Cogl.Bitmap
1613
+
1614
+ static name: string
1615
+ static $gtype: GObject.GType<Bitmap>
1616
+
1617
+ // Constructors of Cogl-10.Cogl.Bitmap
1618
+
1619
+ constructor(config?: Bitmap.ConstructorProperties)
1620
+ /**
1621
+ * Loads an image file from disk. This function can be safely called from
1622
+ * within a thread.
1623
+ * @constructor
1624
+ * @param filename the file to load.
1625
+ * @returns a #CoglBitmap to the new loaded image data, or %NULL if loading the image failed.
1626
+ */
1627
+ static new_from_file(filename: string | null): Bitmap
1628
+ _init(config?: Bitmap.ConstructorProperties): void
1629
+ static error_quark(): number
1630
+ /**
1631
+ * Parses an image file enough to extract the width and height
1632
+ * of the bitmap.
1633
+ * @param filename the file to check
1634
+ * @returns %TRUE if the image was successfully parsed
1635
+ */
1636
+ static get_size_from_file(filename: string | null): [ /* returnType */ boolean, /* width */ number, /* height */ number ]
1637
+ }
1638
+
1639
+ export module Context {
1640
+
1641
+ // Constructor properties interface
1642
+
1643
+ export interface ConstructorProperties extends Object.ConstructorProperties {
1644
+ }
1645
+
1646
+ }
1647
+
1648
+ export interface Context {
1649
+
1650
+ // Owm methods of Cogl-10.Cogl.Context
1651
+
1652
+ free_timestamp_query(query: TimestampQuery): void
1653
+ /**
1654
+ * This function should only be called if the COGL_FEATURE_ID_TIMESTAMP_QUERY
1655
+ * feature is advertised.
1656
+ * @returns Current GPU time in nanoseconds
1657
+ */
1658
+ get_gpu_time_ns(): number
1659
+ get_named_pipeline(key: PipelineKey): Pipeline
1660
+ is_hardware_accelerated(): boolean
1661
+ /**
1662
+ * Associate a #CoglPipeline with a `context` and `key`. This will not take a new
1663
+ * reference to the `pipeline,` but will unref all associated pipelines when
1664
+ * the `context` gets destroyed. Similarly, if a pipeline gets overwritten,
1665
+ * it will get unreffed as well.
1666
+ * @param key a #CoglPipelineKey pointer
1667
+ * @param pipeline a #CoglPipeline to associate with the `context` and `key`
1668
+ */
1669
+ set_named_pipeline(key: PipelineKey, pipeline: Pipeline | null): void
1670
+ timestamp_query_get_time_ns(query: TimestampQuery): number
1671
+
1672
+ // Class property signals of Cogl-10.Cogl.Context
1673
+
1674
+ connect(sigName: string, callback: (...args: any[]) => void): number
1675
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1676
+ emit(sigName: string, ...args: any[]): void
1677
+ disconnect(id: number): void
1678
+ }
1679
+
1680
+ export class Context extends Object {
1681
+
1682
+ // Own properties of Cogl-10.Cogl.Context
1683
+
1684
+ static name: string
1685
+ static $gtype: GObject.GType<Context>
1686
+
1687
+ // Constructors of Cogl-10.Cogl.Context
1688
+
1689
+ constructor(config?: Context.ConstructorProperties)
1690
+ _init(config?: Context.ConstructorProperties): void
1691
+ }
1692
+
1693
+ export module FrameInfo {
1694
+
1695
+ // Constructor properties interface
1696
+
1697
+ export interface ConstructorProperties extends Object.ConstructorProperties {
1698
+ }
1699
+
1700
+ }
1701
+
1702
+ export interface FrameInfo {
1703
+
1704
+ // Owm methods of Cogl-10.Cogl.FrameInfo
1705
+
1706
+ /**
1707
+ * Gets the frame counter for the #CoglOnscreen that corresponds
1708
+ * to this frame.
1709
+ * @returns The frame counter value
1710
+ */
1711
+ get_frame_counter(): number
1712
+ get_is_symbolic(): boolean
1713
+ /**
1714
+ * Gets the presentation time for the frame. This is the time at which
1715
+ * the frame became visible to the user.
1716
+ *
1717
+ * The presentation time measured in microseconds, is based on
1718
+ * CLOCK_MONOTONIC.
1719
+ *
1720
+ * <note>Some buggy Mesa drivers up to 9.0.1 may
1721
+ * incorrectly report non-monotonic timestamps.</note>
1722
+ * @returns the presentation time for the frame
1723
+ */
1724
+ get_presentation_time_us(): number
1725
+ /**
1726
+ * Gets the refresh rate in Hertz for the output that the frame was on
1727
+ * at the time the frame was presented.
1728
+ *
1729
+ * <note>Some platforms can't associate a #CoglOutput with a
1730
+ * #CoglFrameInfo object but are able to report a refresh rate via
1731
+ * this api. Therefore if you need this information then this api is
1732
+ * more reliable than using cogl_frame_info_get_output() followed by
1733
+ * cogl_output_get_refresh_rate().</note>
1734
+ * @returns the refresh rate in Hertz
1735
+ */
1736
+ get_refresh_rate(): number
1737
+ get_rendering_duration_ns(): number
1738
+ get_sequence(): number
1739
+ get_time_before_buffer_swap_us(): number
1740
+ is_hw_clock(): boolean
1741
+ is_vsync(): boolean
1742
+ is_zero_copy(): boolean
1743
+
1744
+ // Class property signals of Cogl-10.Cogl.FrameInfo
1745
+
1746
+ connect(sigName: string, callback: (...args: any[]) => void): number
1747
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1748
+ emit(sigName: string, ...args: any[]): void
1749
+ disconnect(id: number): void
1750
+ }
1751
+
1752
+ /**
1753
+ * Frame information.
1754
+ * @class
1755
+ */
1756
+ export class FrameInfo extends Object {
1757
+
1758
+ // Own properties of Cogl-10.Cogl.FrameInfo
1759
+
1760
+ static name: string
1761
+ static $gtype: GObject.GType<FrameInfo>
1762
+
1763
+ // Constructors of Cogl-10.Cogl.FrameInfo
1764
+
1765
+ constructor(config?: FrameInfo.ConstructorProperties)
1766
+ _init(config?: FrameInfo.ConstructorProperties): void
1767
+ }
1768
+
1769
+ export module Framebuffer {
1770
+
1771
+ // Signal callback interfaces
1772
+
1773
+ /**
1774
+ * Signal callback interface for `destroy`
1775
+ */
1776
+ export interface DestroySignalCallback {
1777
+ ($obj: Framebuffer): void
1778
+ }
1779
+
1780
+
1781
+ // Constructor properties interface
1782
+
1783
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1784
+
1785
+ // Own constructor properties of Cogl-10.Cogl.Framebuffer
1786
+
1787
+ driver_config?: any | null
1788
+ height?: number | null
1789
+ width?: number | null
1790
+ }
1791
+
1792
+ }
1793
+
1794
+ export interface Framebuffer {
1795
+
1796
+ // Own properties of Cogl-10.Cogl.Framebuffer
1797
+
1798
+ readonly driver_config: any
1799
+ height: number
1800
+ width: number
1801
+
1802
+ // Own fields of Cogl-10.Cogl.Framebuffer
1803
+
1804
+ parent_instance: GObject.Object
1805
+
1806
+ // Owm methods of Cogl-10.Cogl.Framebuffer
1807
+
1808
+ /**
1809
+ * Explicitly allocates a configured #CoglFramebuffer allowing developers to
1810
+ * check and handle any errors that might arise from an unsupported
1811
+ * configuration so that fallback configurations may be tried.
1812
+ *
1813
+ * <note>Many applications don't support any fallback options at least when
1814
+ * they are initially developed and in that case the don't need to use this API
1815
+ * since Cogl will automatically allocate a framebuffer when it first gets
1816
+ * used. The disadvantage of relying on automatic allocation is that the
1817
+ * program will abort with an error message if there is an error during
1818
+ * automatic allocation.</note>
1819
+ * @returns %TRUE if there were no error allocating the framebuffer, else %FALSE.
1820
+ */
1821
+ allocate(): boolean
1822
+ /**
1823
+ * Clears all the auxiliary buffers identified in the `buffers` mask, and if
1824
+ * that includes the color buffer then the specified `color` is used.
1825
+ * @param buffers A mask of #CoglBufferBit<!-- -->'s identifying which auxiliary buffers to clear
1826
+ * @param color The color to clear the color buffer too if specified in `buffers`.
1827
+ */
1828
+ clear(buffers: number, color: Color): void
1829
+ /**
1830
+ * Clears all the auxiliary buffers identified in the `buffers` mask, and if
1831
+ * that includes the color buffer then the specified `color` is used.
1832
+ * @param buffers A mask of #CoglBufferBit<!-- -->'s identifying which auxiliary buffers to clear
1833
+ * @param red The red component of color to clear the color buffer too if specified in `buffers`.
1834
+ * @param green The green component of color to clear the color buffer too if specified in `buffers`.
1835
+ * @param blue The blue component of color to clear the color buffer too if specified in `buffers`.
1836
+ * @param alpha The alpha component of color to clear the color buffer too if specified in `buffers`.
1837
+ */
1838
+ clear4f(buffers: number, red: number, green: number, blue: number, alpha: number): void
1839
+ /**
1840
+ * Declares that the specified `buffers` no longer need to be referenced
1841
+ * by any further rendering commands. This can be an important
1842
+ * optimization to avoid subsequent frames of rendering depending on
1843
+ * the results of a previous frame.
1844
+ *
1845
+ * For example; some tile-based rendering GPUs are able to avoid allocating and
1846
+ * accessing system memory for the depth and stencil buffer so long as these
1847
+ * buffers are not required as input for subsequent frames and that can save a
1848
+ * significant amount of memory bandwidth used to save and restore their
1849
+ * contents to system memory between frames.
1850
+ *
1851
+ * It is currently considered an error to try and explicitly discard the color
1852
+ * buffer by passing %COGL_BUFFER_BIT_COLOR. This is because the color buffer is
1853
+ * already implicitly discard when you finish rendering to a #CoglOnscreen
1854
+ * framebuffer, and it's not meaningful to try and discard the color buffer of
1855
+ * a #CoglOffscreen framebuffer since they are single-buffered.
1856
+ * @param buffers A #CoglBufferBit mask of which ancillary buffers you want to discard.
1857
+ */
1858
+ discard_buffers(buffers: number): void
1859
+ /**
1860
+ * Draws a textured rectangle to `framebuffer` with the given `pipeline`
1861
+ * state with the top left corner positioned at (`x_1`, `y_1`) and the
1862
+ * bottom right corner positioned at (`x_2`, `y_2`). As a pipeline may
1863
+ * contain multiple texture layers this interface lets you supply
1864
+ * texture coordinates for each layer of the pipeline.
1865
+ *
1866
+ * <note>The position is the position before the rectangle has been
1867
+ * transformed by the model-view matrix and the projection
1868
+ * matrix.</note>
1869
+ *
1870
+ * This is a high level drawing api that can handle any kind of
1871
+ * #CoglMetaTexture texture for the first layer such as
1872
+ * #CoglTexture2DSliced textures which may internally be comprised of
1873
+ * multiple low-level textures. This is unlike low-level drawing apis
1874
+ * such as cogl_primitive_draw() which only support low level texture
1875
+ * types that are directly supported by GPUs such as #CoglTexture2D.
1876
+ *
1877
+ * <note>This api can not currently handle multiple high-level meta
1878
+ * texture layers. The first layer may be a high level meta texture
1879
+ * such as #CoglTexture2DSliced but all other layers much be low
1880
+ * level textures such as #CoglTexture2D.
1881
+ *
1882
+ * The top left texture coordinate for layer 0 of any pipeline will be
1883
+ * (tex_coords[0], tex_coords[1]) and the bottom right coordinate will
1884
+ * be (tex_coords[2], tex_coords[3]). The coordinates for layer 1
1885
+ * would be (tex_coords[4], tex_coords[5]) (tex_coords[6],
1886
+ * tex_coords[7]) and so on...
1887
+ *
1888
+ * The given texture coordinates should always be normalized such that
1889
+ * (0, 0) corresponds to the top left and (1, 1) corresponds to the
1890
+ * bottom right. To map an entire texture across the rectangle pass
1891
+ * in tex_coords[0]=0, tex_coords[1]=0, tex_coords[2]=1,
1892
+ * tex_coords[3]=1.
1893
+ *
1894
+ * The first pair of coordinates are for the first layer (with the
1895
+ * smallest layer index) and if you supply less texture coordinates
1896
+ * than there are layers in the current source material then default
1897
+ * texture coordinates (0.0, 0.0, 1.0, 1.0) are generated.
1898
+ * @param pipeline A #CoglPipeline state object
1899
+ * @param x_1 x coordinate upper left on screen.
1900
+ * @param y_1 y coordinate upper left on screen.
1901
+ * @param x_2 x coordinate lower right on screen.
1902
+ * @param y_2 y coordinate lower right on screen.
1903
+ * @param tex_coords An array containing groups of 4 float values: [s_1, t_1, s_2, t_2] that are interpreted as two texture coordinates; one for the top left texel, and one for the bottom right texel. Each value should be between 0.0 and 1.0, where the coordinate (0.0, 0.0) represents the top left of the texture, and (1.0, 1.0) the bottom right.
1904
+ * @param tex_coords_len The length of the `tex_coords` array. (For one layer and one group of texture coordinates, this would be 4)
1905
+ */
1906
+ draw_multitextured_rectangle(pipeline: Pipeline, x_1: number, y_1: number, x_2: number, y_2: number, tex_coords: number[], tex_coords_len: number): void
1907
+ /**
1908
+ * Draws a rectangle to `framebuffer` with the given `pipeline` state
1909
+ * and with the top left corner positioned at (`x_1`, `y_1`) and the
1910
+ * bottom right corner positioned at (`x_2`, `y_2`).
1911
+ *
1912
+ * <note>The position is the position before the rectangle has been
1913
+ * transformed by the model-view matrix and the projection
1914
+ * matrix.</note>
1915
+ *
1916
+ * <note>If you want to describe a rectangle with a texture mapped on
1917
+ * it then you can use
1918
+ * cogl_framebuffer_draw_textured_rectangle().</note>
1919
+ * @param pipeline A #CoglPipeline state object
1920
+ * @param x_1 X coordinate of the top-left corner
1921
+ * @param y_1 Y coordinate of the top-left corner
1922
+ * @param x_2 X coordinate of the bottom-right corner
1923
+ * @param y_2 Y coordinate of the bottom-right corner
1924
+ */
1925
+ draw_rectangle(pipeline: Pipeline, x_1: number, y_1: number, x_2: number, y_2: number): void
1926
+ /**
1927
+ * Draws a series of rectangles to `framebuffer` with the given
1928
+ * `pipeline` state in the same way that
1929
+ * cogl_framebuffer_draw_rectangle() does.
1930
+ *
1931
+ * The top left corner of the first rectangle is positioned at
1932
+ * (coordinates[0], coordinates[1]) and the bottom right corner is
1933
+ * positioned at (coordinates[2], coordinates[3]). The positions for
1934
+ * the second rectangle are (coordinates[4], coordinates[5]) and
1935
+ * (coordinates[6], coordinates[7]) and so on...
1936
+ *
1937
+ * <note>The position is the position before the rectangle has been
1938
+ * transformed by the model-view matrix and the projection
1939
+ * matrix.</note>
1940
+ *
1941
+ * As a general rule for better performance its recommended to use
1942
+ * this this API instead of calling
1943
+ * cogl_framebuffer_draw_textured_rectangle() separately for multiple
1944
+ * rectangles if all of the rectangles will be drawn together with the
1945
+ * same `pipeline` state.
1946
+ * @param pipeline A #CoglPipeline state object
1947
+ * @param coordinates an array of coordinates containing groups of 4 float values: [x_1, y_1, x_2, y_2] that are interpreted as two position coordinates; one for the top left of the rectangle (x1, y1), and one for the bottom right of the rectangle (x2, y2).
1948
+ * @param n_rectangles number of rectangles defined in `coordinates`.
1949
+ */
1950
+ draw_rectangles(pipeline: Pipeline, coordinates: number[], n_rectangles: number): void
1951
+ /**
1952
+ * Draws a textured rectangle to `framebuffer` using the given
1953
+ * `pipeline` state with the top left corner positioned at (`x_1`, `y_1`)
1954
+ * and the bottom right corner positioned at (`x_2`, `y_2`). The top
1955
+ * left corner will have texture coordinates of (`s_1`, `t_1`) and the
1956
+ * bottom right corner will have texture coordinates of (`s_2`, `t_2`).
1957
+ *
1958
+ * <note>The position is the position before the rectangle has been
1959
+ * transformed by the model-view matrix and the projection
1960
+ * matrix.</note>
1961
+ *
1962
+ * This is a high level drawing api that can handle any kind of
1963
+ * #CoglMetaTexture texture such as #CoglTexture2DSliced textures
1964
+ * which may internally be comprised of multiple low-level textures.
1965
+ * This is unlike low-level drawing apis such as cogl_primitive_draw()
1966
+ * which only support low level texture types that are directly
1967
+ * supported by GPUs such as #CoglTexture2D.
1968
+ *
1969
+ * <note>The given texture coordinates will only be used for the first
1970
+ * texture layer of the pipeline and if your pipeline has more than
1971
+ * one layer then all other layers will have default texture
1972
+ * coordinates of `s_1`=0.0 `t_1`=0.0 `s_2`=1.0 `t_2`=1.0 </note>
1973
+ *
1974
+ * The given texture coordinates should always be normalized such that
1975
+ * (0, 0) corresponds to the top left and (1, 1) corresponds to the
1976
+ * bottom right. To map an entire texture across the rectangle pass
1977
+ * in `s_1`=0, `t_1`=0, `s_2`=1, `t_2`=1.
1978
+ * @param pipeline A #CoglPipeline state object
1979
+ * @param x_1 x coordinate upper left on screen.
1980
+ * @param y_1 y coordinate upper left on screen.
1981
+ * @param x_2 x coordinate lower right on screen.
1982
+ * @param y_2 y coordinate lower right on screen.
1983
+ * @param s_1 S texture coordinate of the top-left coorner
1984
+ * @param t_1 T texture coordinate of the top-left coorner
1985
+ * @param s_2 S texture coordinate of the bottom-right coorner
1986
+ * @param t_2 T texture coordinate of the bottom-right coorner
1987
+ */
1988
+ draw_textured_rectangle(pipeline: Pipeline, x_1: number, y_1: number, x_2: number, y_2: number, s_1: number, t_1: number, s_2: number, t_2: number): void
1989
+ /**
1990
+ * Draws a series of rectangles to `framebuffer` with the given
1991
+ * `pipeline` state in the same way that
1992
+ * cogl_framebuffer_draw_textured_rectangle() does.
1993
+ *
1994
+ * <note>The position is the position before the rectangle has been
1995
+ * transformed by the model-view matrix and the projection
1996
+ * matrix.</note>
1997
+ *
1998
+ * This is a high level drawing api that can handle any kind of
1999
+ * #CoglMetaTexture texture such as #CoglTexture2DSliced textures
2000
+ * which may internally be comprised of multiple low-level textures.
2001
+ * This is unlike low-level drawing apis such as cogl_primitive_draw()
2002
+ * which only support low level texture types that are directly
2003
+ * supported by GPUs such as #CoglTexture2D.
2004
+ *
2005
+ * The top left corner of the first rectangle is positioned at
2006
+ * (coordinates[0], coordinates[1]) and the bottom right corner is
2007
+ * positioned at (coordinates[2], coordinates[3]). The top left
2008
+ * texture coordinate is (coordinates[4], coordinates[5]) and the
2009
+ * bottom right texture coordinate is (coordinates[6],
2010
+ * coordinates[7]). The coordinates for subsequent rectangles
2011
+ * are defined similarly by the subsequent coordinates.
2012
+ *
2013
+ * As a general rule for better performance its recommended to use
2014
+ * this this API instead of calling
2015
+ * cogl_framebuffer_draw_textured_rectangle() separately for multiple
2016
+ * rectangles if all of the rectangles will be drawn together with the
2017
+ * same `pipeline` state.
2018
+ *
2019
+ * The given texture coordinates should always be normalized such that
2020
+ * (0, 0) corresponds to the top left and (1, 1) corresponds to the
2021
+ * bottom right. To map an entire texture across the rectangle pass
2022
+ * in tex_coords[0]=0, tex_coords[1]=0, tex_coords[2]=1,
2023
+ * tex_coords[3]=1.
2024
+ * @param pipeline A #CoglPipeline state object
2025
+ * @param coordinates an array containing groups of 8 float values: [x_1, y_1, x_2, y_2, s_1, t_1, s_2, t_2] that have the same meaning as the arguments for cogl_framebuffer_draw_textured_rectangle().
2026
+ * @param n_rectangles number of rectangles to `coordinates` to draw
2027
+ */
2028
+ draw_textured_rectangles(pipeline: Pipeline, coordinates: number[], n_rectangles: number): void
2029
+ /**
2030
+ * This blocks the CPU until all pending rendering associated with the
2031
+ * specified framebuffer has completed. It's very rare that developers should
2032
+ * ever need this level of synchronization with the GPU and should never be
2033
+ * used unless you clearly understand why you need to explicitly force
2034
+ * synchronization.
2035
+ *
2036
+ * One example might be for benchmarking purposes to be sure timing
2037
+ * measurements reflect the time that the GPU is busy for not just the time it
2038
+ * takes to queue rendering commands.
2039
+ */
2040
+ finish(): void
2041
+ /**
2042
+ * Flushes `framebuffer` to ensure the current batch of commands is
2043
+ * submitted to the GPU.
2044
+ *
2045
+ * Unlike cogl_framebuffer_finish(), this does not block the CPU.
2046
+ */
2047
+ flush(): void
2048
+ /**
2049
+ * Replaces the current projection matrix with a perspective matrix
2050
+ * for a given viewing frustum defined by 4 side clip planes that
2051
+ * all cross through the origin and 2 near and far clip planes.
2052
+ * @param left X position of the left clipping plane where it intersects the near clipping plane
2053
+ * @param right X position of the right clipping plane where it intersects the near clipping plane
2054
+ * @param bottom Y position of the bottom clipping plane where it intersects the near clipping plane
2055
+ * @param top Y position of the top clipping plane where it intersects the near clipping plane
2056
+ * @param z_near The distance to the near clipping plane (Must be positive)
2057
+ * @param z_far The distance to the far clipping plane (Must be positive)
2058
+ */
2059
+ frustum(left: number, right: number, bottom: number, top: number, z_near: number, z_far: number): void
2060
+ /**
2061
+ * Retrieves the number of alpha bits of `framebuffer`
2062
+ * @returns the number of bits
2063
+ */
2064
+ get_alpha_bits(): number
2065
+ /**
2066
+ * Retrieves the number of blue bits of `framebuffer`
2067
+ * @returns the number of bits
2068
+ */
2069
+ get_blue_bits(): number
2070
+ /**
2071
+ * Can be used to query the #CoglContext a given `framebuffer` was
2072
+ * instantiated within. This is the #CoglContext that was passed to
2073
+ * cogl_onscreen_new() for example.
2074
+ * @returns The #CoglContext that the given @framebuffer was instantiated within.
2075
+ */
2076
+ get_context(): Context
2077
+ /**
2078
+ * Retrieves the number of depth bits of `framebuffer`
2079
+ * @returns the number of bits
2080
+ */
2081
+ get_depth_bits(): number
2082
+ /**
2083
+ * Queries whether depth buffer writing is enabled for `framebuffer`. This
2084
+ * can be controlled via cogl_framebuffer_set_depth_write_enabled().
2085
+ * @returns %TRUE if depth writing is enabled or %FALSE if not.
2086
+ */
2087
+ get_depth_write_enabled(): boolean
2088
+ /**
2089
+ * Returns whether dithering has been requested for the given `framebuffer`.
2090
+ * See cogl_framebuffer_set_dither_enabled() for more details about dithering.
2091
+ *
2092
+ * <note>This may return %TRUE even when the underlying `framebuffer`
2093
+ * display pipeline does not support dithering. This value only represents
2094
+ * the user's request for dithering.</note>
2095
+ * @returns %TRUE if dithering has been requested or %FALSE if not.
2096
+ */
2097
+ get_dither_enabled(): boolean
2098
+ /**
2099
+ * Retrieves the number of green bits of `framebuffer`
2100
+ * @returns the number of bits
2101
+ */
2102
+ get_green_bits(): number
2103
+ /**
2104
+ * Queries the current height of the given `framebuffer`.
2105
+ * @returns The height of @framebuffer.
2106
+ */
2107
+ get_height(): number
2108
+ get_is_stereo(): boolean
2109
+ /**
2110
+ * Stores the current model-view matrix in `matrix`.
2111
+ */
2112
+ get_modelview_matrix(): /* matrix */ Graphene.Matrix
2113
+ /**
2114
+ * Stores the current projection matrix in `matrix`.
2115
+ */
2116
+ get_projection_matrix(): /* matrix */ Graphene.Matrix
2117
+ /**
2118
+ * Retrieves the number of red bits of `framebuffer`
2119
+ * @returns the number of bits
2120
+ */
2121
+ get_red_bits(): number
2122
+ /**
2123
+ * Gets the number of points that are sampled per-pixel when
2124
+ * rasterizing geometry. Usually by default this will return 0 which
2125
+ * means that single-sample not multisample rendering has been chosen.
2126
+ * When using a GPU supporting multisample rendering it's possible to
2127
+ * increase the number of samples per pixel using
2128
+ * cogl_framebuffer_set_samples_per_pixel().
2129
+ *
2130
+ * Calling cogl_framebuffer_get_samples_per_pixel() before the
2131
+ * framebuffer has been allocated will simply return the value set
2132
+ * using cogl_framebuffer_set_samples_per_pixel(). After the
2133
+ * framebuffer has been allocated the value will reflect the actual
2134
+ * number of samples that will be made by the GPU.
2135
+ * @returns The number of point samples made per pixel when rasterizing geometry or 0 if single-sample rendering has been chosen.
2136
+ */
2137
+ get_samples_per_pixel(): number
2138
+ /**
2139
+ * Gets the current #CoglStereoMode, which defines which stereo buffers
2140
+ * should be drawn to. See cogl_framebuffer_set_stereo_mode().
2141
+ * @returns A #CoglStereoMode
2142
+ */
2143
+ get_stereo_mode(): StereoMode
2144
+ /**
2145
+ * Queries the x, y, width and height components of the current viewport as set
2146
+ * using cogl_framebuffer_set_viewport() or the default values which are 0, 0,
2147
+ * framebuffer_width and framebuffer_height. The values are written into the
2148
+ * given `viewport` array.
2149
+ */
2150
+ get_viewport4fv(): /* viewport */ number[]
2151
+ /**
2152
+ * Queries the height of the viewport as set using cogl_framebuffer_set_viewport()
2153
+ * or the default value which is the height of the framebuffer.
2154
+ * @returns The height of the viewport.
2155
+ */
2156
+ get_viewport_height(): number
2157
+ /**
2158
+ * Queries the width of the viewport as set using cogl_framebuffer_set_viewport()
2159
+ * or the default value which is the width of the framebuffer.
2160
+ * @returns The width of the viewport.
2161
+ */
2162
+ get_viewport_width(): number
2163
+ /**
2164
+ * Queries the x coordinate of the viewport origin as set using cogl_framebuffer_set_viewport()
2165
+ * or the default value which is 0.
2166
+ * @returns The x coordinate of the viewport origin.
2167
+ */
2168
+ get_viewport_x(): number
2169
+ /**
2170
+ * Queries the y coordinate of the viewport origin as set using cogl_framebuffer_set_viewport()
2171
+ * or the default value which is 0.
2172
+ * @returns The y coordinate of the viewport origin.
2173
+ */
2174
+ get_viewport_y(): number
2175
+ /**
2176
+ * Queries the current width of the given `framebuffer`.
2177
+ * @returns The width of @framebuffer.
2178
+ */
2179
+ get_width(): number
2180
+ /**
2181
+ * Resets the current model-view matrix to the identity matrix.
2182
+ */
2183
+ identity_matrix(): void
2184
+ /**
2185
+ * Replaces the current projection matrix with an orthographic projection
2186
+ * matrix.
2187
+ * @param x_1 The x coordinate for the first vertical clipping plane
2188
+ * @param y_1 The y coordinate for the first horizontal clipping plane
2189
+ * @param x_2 The x coordinate for the second vertical clipping plane
2190
+ * @param y_2 The y coordinate for the second horizontal clipping plane
2191
+ * @param near The <emphasis>distance</emphasis> to the near clipping plane (will be <emphasis>negative</emphasis> if the plane is behind the viewer)
2192
+ * @param far The <emphasis>distance</emphasis> to the far clipping plane (will be <emphasis>negative</emphasis> if the plane is behind the viewer)
2193
+ */
2194
+ orthographic(x_1: number, y_1: number, x_2: number, y_2: number, near: number, far: number): void
2195
+ /**
2196
+ * Replaces the current projection matrix with a perspective matrix
2197
+ * based on the provided values.
2198
+ *
2199
+ * <note>You should be careful not to have to great a `z_far` / `z_near`
2200
+ * ratio since that will reduce the effectiveness of depth testing
2201
+ * since there won't be enough precision to identify the depth of
2202
+ * objects near to each other.</note>
2203
+ * @param fov_y Vertical field of view angle in degrees.
2204
+ * @param aspect The (width over height) aspect ratio for display
2205
+ * @param z_near The distance to the near clipping plane (Must be positive, and must not be 0)
2206
+ * @param z_far The distance to the far clipping plane (Must be positive)
2207
+ */
2208
+ perspective(fov_y: number, aspect: number, z_near: number, z_far: number): void
2209
+ /**
2210
+ * Reverts the clipping region to the state before the last call to
2211
+ * cogl_framebuffer_push_scissor_clip(), cogl_framebuffer_push_rectangle_clip()
2212
+ * cogl_framebuffer_push_path_clip(), or cogl_framebuffer_push_primitive_clip().
2213
+ */
2214
+ pop_clip(): void
2215
+ /**
2216
+ * Restores the model-view matrix on the top of the matrix stack.
2217
+ */
2218
+ pop_matrix(): void
2219
+ /**
2220
+ * Copies the current model-view matrix onto the matrix stack. The matrix
2221
+ * can later be restored with cogl_framebuffer_pop_matrix().
2222
+ */
2223
+ push_matrix(): void
2224
+ /**
2225
+ * Specifies a modelview transformed rectangular clipping area for all
2226
+ * subsequent drawing operations. Any drawing commands that extend
2227
+ * outside the rectangle will be clipped so that only the portion
2228
+ * inside the rectangle will be displayed. The rectangle dimensions
2229
+ * are transformed by the current model-view matrix.
2230
+ *
2231
+ * The rectangle is intersected with the current clip region. To undo
2232
+ * the effect of this function, call cogl_framebuffer_pop_clip().
2233
+ * @param x_1 x coordinate for top left corner of the clip rectangle
2234
+ * @param y_1 y coordinate for top left corner of the clip rectangle
2235
+ * @param x_2 x coordinate for bottom right corner of the clip rectangle
2236
+ * @param y_2 y coordinate for bottom right corner of the clip rectangle
2237
+ */
2238
+ push_rectangle_clip(x_1: number, y_1: number, x_2: number, y_2: number): void
2239
+ push_region_clip(region: cairo.Region): void
2240
+ /**
2241
+ * Specifies a rectangular clipping area for all subsequent drawing
2242
+ * operations. Any drawing commands that extend outside the rectangle
2243
+ * will be clipped so that only the portion inside the rectangle will
2244
+ * be displayed. The rectangle dimensions are not transformed by the
2245
+ * current model-view matrix.
2246
+ *
2247
+ * The rectangle is intersected with the current clip region. To undo
2248
+ * the effect of this function, call cogl_framebuffer_pop_clip().
2249
+ * @param x left edge of the clip rectangle in window coordinates
2250
+ * @param y top edge of the clip rectangle in window coordinates
2251
+ * @param width width of the clip rectangle
2252
+ * @param height height of the clip rectangle
2253
+ */
2254
+ push_scissor_clip(x: number, y: number, width: number, height: number): void
2255
+ /**
2256
+ * This is a convenience wrapper around
2257
+ * cogl_framebuffer_read_pixels_into_bitmap() which allocates a
2258
+ * temporary #CoglBitmap to read pixel data directly into the given
2259
+ * buffer. The rowstride of the buffer is assumed to be the width of
2260
+ * the region times the bytes per pixel of the format. The source for
2261
+ * the data is always taken from the color buffer. If you want to use
2262
+ * any other rowstride or source, please use the
2263
+ * cogl_framebuffer_read_pixels_into_bitmap() function directly.
2264
+ *
2265
+ * The implementation of the function looks like this:
2266
+ *
2267
+ *
2268
+ * ```
2269
+ * bitmap = cogl_bitmap_new_for_data (context,
2270
+ * width, height,
2271
+ * format,
2272
+ * /<!-- -->* rowstride *<!-- -->/
2273
+ * bpp * width,
2274
+ * pixels);
2275
+ * cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
2276
+ * x, y,
2277
+ * COGL_READ_PIXELS_COLOR_BUFFER,
2278
+ * bitmap);
2279
+ * cogl_object_unref (bitmap);
2280
+ * ```
2281
+ *
2282
+ * @param x The x position to read from
2283
+ * @param y The y position to read from
2284
+ * @param width The width of the region of rectangles to read
2285
+ * @param height The height of the region of rectangles to read
2286
+ * @param format The pixel format to store the data in
2287
+ * @param pixels The address of the buffer to store the data in
2288
+ * @returns %TRUE if the read succeeded or %FALSE otherwise.
2289
+ */
2290
+ read_pixels(x: number, y: number, width: number, height: number, format: PixelFormat, pixels: number): boolean
2291
+ /**
2292
+ * This reads a rectangle of pixels from the given framebuffer where
2293
+ * position (0, 0) is the top left. The pixel at (x, y) is the first
2294
+ * read, and a rectangle of pixels with the same size as the bitmap is
2295
+ * read right and downwards from that point.
2296
+ *
2297
+ * Currently Cogl assumes that the framebuffer is in a premultiplied
2298
+ * format so if the format of `bitmap` is non-premultiplied it will
2299
+ * convert it. To read the pixel values without any conversion you
2300
+ * should either specify a format that doesn't use an alpha channel or
2301
+ * use one of the formats ending in PRE.
2302
+ * @param x The x position to read from
2303
+ * @param y The y position to read from
2304
+ * @param source Identifies which auxiliary buffer you want to read (only COGL_READ_PIXELS_COLOR_BUFFER supported currently)
2305
+ * @param bitmap The bitmap to store the results in.
2306
+ * @returns %TRUE if the read succeeded or %FALSE otherwise. The function is only likely to fail if the bitmap points to a pixel buffer and it could not be mapped.
2307
+ */
2308
+ read_pixels_into_bitmap(x: number, y: number, source: ReadPixelsFlags, bitmap: Bitmap): boolean
2309
+ /**
2310
+ * When point sample rendering (also known as multisample rendering)
2311
+ * has been enabled via cogl_framebuffer_set_samples_per_pixel()
2312
+ * then you can optionally call this function (or
2313
+ * cogl_framebuffer_resolve_samples_region()) to explicitly resolve
2314
+ * the point samples into values for the final color buffer.
2315
+ *
2316
+ * Some GPUs will implicitly resolve the point samples during
2317
+ * rendering and so this function is effectively a nop, but with other
2318
+ * architectures it is desirable to defer the resolve step until the
2319
+ * end of the frame.
2320
+ *
2321
+ * Since Cogl will automatically ensure samples are resolved if the
2322
+ * target color buffer is used as a source this API only needs to be
2323
+ * used if explicit control is desired - perhaps because you want to
2324
+ * ensure that the resolve is completed in advance to avoid later
2325
+ * having to wait for the resolve to complete.
2326
+ *
2327
+ * If you are performing incremental updates to a framebuffer you
2328
+ * should consider using cogl_framebuffer_resolve_samples_region()
2329
+ * instead to avoid resolving redundant pixels.
2330
+ */
2331
+ resolve_samples(): void
2332
+ /**
2333
+ * When point sample rendering (also known as multisample rendering)
2334
+ * has been enabled via cogl_framebuffer_set_samples_per_pixel()
2335
+ * then you can optionally call this function (or
2336
+ * cogl_framebuffer_resolve_samples()) to explicitly resolve the point
2337
+ * samples into values for the final color buffer.
2338
+ *
2339
+ * Some GPUs will implicitly resolve the point samples during
2340
+ * rendering and so this function is effectively a nop, but with other
2341
+ * architectures it is desirable to defer the resolve step until the
2342
+ * end of the frame.
2343
+ *
2344
+ * Use of this API is recommended if incremental, small updates to
2345
+ * a framebuffer are being made because by default Cogl will
2346
+ * implicitly resolve all the point samples of the framebuffer which
2347
+ * can result in redundant work if only a small number of samples have
2348
+ * changed.
2349
+ *
2350
+ * Because some GPUs implicitly resolve point samples this function
2351
+ * only guarantees that at-least the region specified will be resolved
2352
+ * and if you have rendered to a larger region then it's possible that
2353
+ * other samples may be implicitly resolved.
2354
+ * @param x top-left x coordinate of region to resolve
2355
+ * @param y top-left y coordinate of region to resolve
2356
+ * @param width width of region to resolve
2357
+ * @param height height of region to resolve
2358
+ */
2359
+ resolve_samples_region(x: number, y: number, width: number, height: number): void
2360
+ /**
2361
+ * Multiplies the current model-view matrix by one that rotates the
2362
+ * model around the axis-vector specified by `x,` `y` and `z`. The
2363
+ * rotation follows the right-hand thumb rule so for example rotating
2364
+ * by 10 degrees about the axis-vector (0, 0, 1) causes a small
2365
+ * counter-clockwise rotation.
2366
+ * @param angle Angle in degrees to rotate.
2367
+ * @param x X-component of vertex to rotate around.
2368
+ * @param y Y-component of vertex to rotate around.
2369
+ * @param z Z-component of vertex to rotate around.
2370
+ */
2371
+ rotate(angle: number, x: number, y: number, z: number): void
2372
+ /**
2373
+ * Multiplies the current model-view matrix by one that rotates
2374
+ * according to the rotation described by `euler`.
2375
+ * @param euler A #graphene_euler_t
2376
+ */
2377
+ rotate_euler(euler: Graphene.Euler): void
2378
+ /**
2379
+ * Multiplies the current model-view matrix by one that scales the x,
2380
+ * y and z axes by the given values.
2381
+ * @param x Amount to scale along the x-axis
2382
+ * @param y Amount to scale along the y-axis
2383
+ * @param z Amount to scale along the z-axis
2384
+ */
2385
+ scale(x: number, y: number, z: number): void
2386
+ /**
2387
+ * Enables or disables depth buffer writing when rendering to `framebuffer`.
2388
+ * If depth writing is enabled for both the framebuffer and the rendering
2389
+ * pipeline, and the framebuffer has an associated depth buffer, depth
2390
+ * information will be written to this buffer during rendering.
2391
+ *
2392
+ * Depth buffer writing is enabled by default.
2393
+ * @param depth_write_enabled %TRUE to enable depth writing or %FALSE to disable
2394
+ */
2395
+ set_depth_write_enabled(depth_write_enabled: boolean): void
2396
+ /**
2397
+ * Enables or disabled dithering if supported by the hardware.
2398
+ *
2399
+ * Dithering is a hardware dependent technique to increase the visible
2400
+ * color resolution beyond what the underlying hardware supports by playing
2401
+ * tricks with the colors placed into the framebuffer to give the illusion
2402
+ * of other colors. (For example this can be compared to half-toning used
2403
+ * by some news papers to show varying levels of grey even though their may
2404
+ * only be black and white are available).
2405
+ *
2406
+ * If the current display pipeline for `framebuffer` does not support dithering
2407
+ * then this has no affect.
2408
+ *
2409
+ * Dithering is enabled by default.
2410
+ * @param dither_enabled %TRUE to enable dithering or %FALSE to disable
2411
+ */
2412
+ set_dither_enabled(dither_enabled: boolean): void
2413
+ /**
2414
+ * Sets `matrix` as the new model-view matrix.
2415
+ * @param matrix the new model-view matrix
2416
+ */
2417
+ set_modelview_matrix(matrix: Graphene.Matrix): void
2418
+ /**
2419
+ * Sets `matrix` as the new projection matrix.
2420
+ * @param matrix the new projection matrix
2421
+ */
2422
+ set_projection_matrix(matrix: Graphene.Matrix): void
2423
+ /**
2424
+ * Requires that when rendering to `framebuffer` then `n` point samples
2425
+ * should be made per pixel which will all contribute to the final
2426
+ * resolved color for that pixel. The idea is that the hardware aims
2427
+ * to get quality similar to what you would get if you rendered
2428
+ * everything twice as big (for 4 samples per pixel) and then scaled
2429
+ * that image back down with filtering. It can effectively remove the
2430
+ * jagged edges of polygons and should be more efficient than if you
2431
+ * were to manually render at a higher resolution and downscale
2432
+ * because the hardware is often able to take some shortcuts. For
2433
+ * example the GPU may only calculate a single texture sample for all
2434
+ * points of a single pixel, and for tile based architectures all the
2435
+ * extra sample data (such as depth and stencil samples) may be
2436
+ * handled on-chip and so avoid increased demand on system memory
2437
+ * bandwidth.
2438
+ *
2439
+ * By default this value is usually set to 0 and that is referred to
2440
+ * as "single-sample" rendering. A value of 1 or greater is referred
2441
+ * to as "multisample" rendering.
2442
+ *
2443
+ * <note>There are some semantic differences between single-sample
2444
+ * rendering and multisampling with just 1 point sample such as it
2445
+ * being redundant to use the cogl_framebuffer_resolve_samples() and
2446
+ * cogl_framebuffer_resolve_samples_region() apis with single-sample
2447
+ * rendering.</note>
2448
+ *
2449
+ * <note>It's recommended that
2450
+ * cogl_framebuffer_resolve_samples_region() be explicitly used at the
2451
+ * end of rendering to a point sample buffer to minimize the number of
2452
+ * samples that get resolved. By default Cogl will implicitly resolve
2453
+ * all framebuffer samples but if only a small region of a
2454
+ * framebuffer has changed this can lead to redundant work being
2455
+ * done.</note>
2456
+ * @param samples_per_pixel The minimum number of samples per pixel
2457
+ */
2458
+ set_samples_per_pixel(samples_per_pixel: number): void
2459
+ /**
2460
+ * Sets which stereo buffers should be drawn to. The default
2461
+ * is %COGL_STEREO_BOTH, which means that both the left and
2462
+ * right buffers will be affected by drawing. For this to have
2463
+ * an effect, the display system must support stereo drawables,
2464
+ * and the framebuffer must have been created with stereo
2465
+ * enabled. (See cogl_onscreen_template_set_stereo_enabled(),
2466
+ * cogl_framebuffer_get_is_stereo().)
2467
+ * @param stereo_mode A #CoglStereoMode specifying which stereo buffers should be drawn tow.
2468
+ */
2469
+ set_stereo_mode(stereo_mode: StereoMode): void
2470
+ /**
2471
+ * Defines a scale and offset for everything rendered relative to the
2472
+ * top-left of the destination framebuffer.
2473
+ *
2474
+ * By default the viewport has an origin of (0,0) and width and height
2475
+ * that match the framebuffer's size. Assuming a default projection and
2476
+ * modelview matrix then you could translate the contents of a window
2477
+ * down and right by leaving the viewport size unchanged by moving the
2478
+ * offset to (10,10). The viewport coordinates are measured in pixels.
2479
+ * If you left the x and y origin as (0,0) you could scale the windows
2480
+ * contents down by specify and width and height that's half the real
2481
+ * size of the framebuffer.
2482
+ *
2483
+ * <note>Although the function takes floating point arguments, existing
2484
+ * drivers only allow the use of integer values. In the future floating
2485
+ * point values will be exposed via a checkable feature.</note>
2486
+ * @param x The top-left x coordinate of the viewport origin (only integers supported currently)
2487
+ * @param y The top-left y coordinate of the viewport origin (only integers supported currently)
2488
+ * @param width The width of the viewport (only integers supported currently)
2489
+ * @param height The height of the viewport (only integers supported currently)
2490
+ */
2491
+ set_viewport(x: number, y: number, width: number, height: number): void
2492
+ /**
2493
+ * Multiplies the current model-view matrix by the given matrix.
2494
+ * @param matrix the matrix to multiply with the current model-view
2495
+ */
2496
+ transform(matrix: Graphene.Matrix): void
2497
+ /**
2498
+ * Multiplies the current model-view matrix by one that translates the
2499
+ * model along all three axes according to the given values.
2500
+ * @param x Distance to translate along the x-axis
2501
+ * @param y Distance to translate along the y-axis
2502
+ * @param z Distance to translate along the z-axis
2503
+ */
2504
+ translate(x: number, y: number, z: number): void
2505
+
2506
+ // Own virtual methods of Cogl-10.Cogl.Framebuffer
2507
+
2508
+ /**
2509
+ * Explicitly allocates a configured #CoglFramebuffer allowing developers to
2510
+ * check and handle any errors that might arise from an unsupported
2511
+ * configuration so that fallback configurations may be tried.
2512
+ *
2513
+ * <note>Many applications don't support any fallback options at least when
2514
+ * they are initially developed and in that case the don't need to use this API
2515
+ * since Cogl will automatically allocate a framebuffer when it first gets
2516
+ * used. The disadvantage of relying on automatic allocation is that the
2517
+ * program will abort with an error message if there is an error during
2518
+ * automatic allocation.</note>
2519
+ * @virtual
2520
+ * @returns %TRUE if there were no error allocating the framebuffer, else %FALSE.
2521
+ */
2522
+ vfunc_allocate(): boolean
2523
+ vfunc_is_y_flipped(): boolean
2524
+
2525
+ // Own signals of Cogl-10.Cogl.Framebuffer
2526
+
2527
+ connect(sigName: "destroy", callback: Framebuffer.DestroySignalCallback): number
2528
+ connect_after(sigName: "destroy", callback: Framebuffer.DestroySignalCallback): number
2529
+ emit(sigName: "destroy", ...args: any[]): void
2530
+
2531
+ // Class property signals of Cogl-10.Cogl.Framebuffer
2532
+
2533
+ connect(sigName: "notify::driver-config", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
2534
+ connect_after(sigName: "notify::driver-config", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
2535
+ emit(sigName: "notify::driver-config", ...args: any[]): void
2536
+ connect(sigName: "notify::height", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
2537
+ connect_after(sigName: "notify::height", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
2538
+ emit(sigName: "notify::height", ...args: any[]): void
2539
+ connect(sigName: "notify::width", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
2540
+ connect_after(sigName: "notify::width", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
2541
+ emit(sigName: "notify::width", ...args: any[]): void
2542
+ connect(sigName: string, callback: (...args: any[]) => void): number
2543
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2544
+ emit(sigName: string, ...args: any[]): void
2545
+ disconnect(id: number): void
2546
+ }
2547
+
2548
+ export class Framebuffer extends GObject.Object {
2549
+
2550
+ // Own properties of Cogl-10.Cogl.Framebuffer
2551
+
2552
+ static name: string
2553
+ static $gtype: GObject.GType<Framebuffer>
2554
+
2555
+ // Constructors of Cogl-10.Cogl.Framebuffer
2556
+
2557
+ constructor(config?: Framebuffer.ConstructorProperties)
2558
+ _init(config?: Framebuffer.ConstructorProperties): void
2559
+ static error_quark(): number
2560
+ }
2561
+
2562
+ export module Object {
2563
+
2564
+ // Constructor properties interface
2565
+
2566
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2567
+ }
2568
+
2569
+ }
2570
+
2571
+ export interface Object {
2572
+
2573
+ // Class property signals of Cogl-10.Cogl.Object
2574
+
2575
+ connect(sigName: string, callback: (...args: any[]) => void): number
2576
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2577
+ emit(sigName: string, ...args: any[]): void
2578
+ disconnect(id: number): void
2579
+ }
2580
+
2581
+ export class Object extends GObject.Object {
2582
+
2583
+ // Own properties of Cogl-10.Cogl.Object
2584
+
2585
+ static name: string
2586
+ static $gtype: GObject.GType<Object>
2587
+
2588
+ // Constructors of Cogl-10.Cogl.Object
2589
+
2590
+ constructor(config?: Object.ConstructorProperties)
2591
+ _init(config?: Object.ConstructorProperties): void
2592
+ }
2593
+
2594
+ export module Offscreen {
2595
+
2596
+ // Constructor properties interface
2597
+
2598
+ export interface ConstructorProperties extends Framebuffer.ConstructorProperties {
2599
+ }
2600
+
2601
+ }
2602
+
2603
+ export interface Offscreen {
2604
+
2605
+ // Class property signals of Cogl-10.Cogl.Offscreen
2606
+
2607
+ connect(sigName: "notify::driver-config", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
2608
+ connect_after(sigName: "notify::driver-config", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
2609
+ emit(sigName: "notify::driver-config", ...args: any[]): void
2610
+ connect(sigName: "notify::height", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
2611
+ connect_after(sigName: "notify::height", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
2612
+ emit(sigName: "notify::height", ...args: any[]): void
2613
+ connect(sigName: "notify::width", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
2614
+ connect_after(sigName: "notify::width", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
2615
+ emit(sigName: "notify::width", ...args: any[]): void
2616
+ connect(sigName: string, callback: (...args: any[]) => void): number
2617
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2618
+ emit(sigName: string, ...args: any[]): void
2619
+ disconnect(id: number): void
2620
+ }
2621
+
2622
+ export class Offscreen extends Framebuffer {
2623
+
2624
+ // Own properties of Cogl-10.Cogl.Offscreen
2625
+
2626
+ static name: string
2627
+ static $gtype: GObject.GType<Offscreen>
2628
+
2629
+ // Constructors of Cogl-10.Cogl.Offscreen
2630
+
2631
+ constructor(config?: Offscreen.ConstructorProperties)
2632
+ /**
2633
+ * This creates an offscreen framebuffer object using the given
2634
+ * `texture` as the primary color buffer. It doesn't just initialize
2635
+ * the contents of the offscreen buffer with the `texture;` they are
2636
+ * tightly bound so that drawing to the offscreen buffer effectively
2637
+ * updates the contents of the given texture. You don't need to
2638
+ * destroy the offscreen buffer before you can use the `texture` again.
2639
+ *
2640
+ * <note>This api only works with low-level #CoglTexture types such as
2641
+ * #CoglTexture2D and not with meta-texture types such as
2642
+ * #CoglTexture2DSliced.</note>
2643
+ *
2644
+ * The storage for the framebuffer is actually allocated lazily
2645
+ * so this function will never return %NULL to indicate a runtime
2646
+ * error. This means it is still possible to configure the framebuffer
2647
+ * before it is really allocated.
2648
+ *
2649
+ * Simple applications without full error handling can simply rely on
2650
+ * Cogl to lazily allocate the storage of framebuffers but you should
2651
+ * be aware that if Cogl encounters an error (such as running out of
2652
+ * GPU memory) then your application will simply abort with an error
2653
+ * message. If you need to be able to catch such exceptions at runtime
2654
+ * then you can explicitly allocate your framebuffer when you have
2655
+ * finished configuring it by calling cogl_framebuffer_allocate() and
2656
+ * passing in a #GError argument to catch any exceptions.
2657
+ * @constructor
2658
+ * @param texture A #CoglTexture pointer
2659
+ * @returns a newly instantiated #CoglOffscreen framebuffer.
2660
+ */
2661
+ static new_with_texture(texture: Texture): Offscreen
2662
+ _init(config?: Offscreen.ConstructorProperties): void
2663
+ }
2664
+
2665
+ export module Onscreen {
2666
+
2667
+ // Constructor properties interface
2668
+
2669
+ export interface ConstructorProperties extends Framebuffer.ConstructorProperties {
2670
+ }
2671
+
2672
+ }
2673
+
2674
+ export interface Onscreen {
2675
+
2676
+ // Own fields of Cogl-10.Cogl.Onscreen
2677
+
2678
+ parent_instance: Framebuffer & GObject.Object
2679
+
2680
+ // Owm methods of Cogl-10.Cogl.Onscreen
2681
+
2682
+ /**
2683
+ * Installs a `callback` function that will be called whenever the
2684
+ * window system has lost the contents of a region of the onscreen
2685
+ * buffer and the application should redraw it to repair the buffer.
2686
+ * For example this may happen in a window system without a compositor
2687
+ * if a window that was previously covering up the onscreen window has
2688
+ * been moved causing a region of the onscreen to be exposed.
2689
+ *
2690
+ * The `callback` will be passed a #CoglOnscreenDirtyInfo struct which
2691
+ * describes a rectangle containing the newly dirtied region. Note that
2692
+ * this may be called multiple times to describe a non-rectangular
2693
+ * region composed of multiple smaller rectangles.
2694
+ *
2695
+ * The dirty events are separate from %COGL_FRAME_EVENT_SYNC events so
2696
+ * the application should also listen for this event before rendering
2697
+ * the dirty region to ensure that the framebuffer is actually ready
2698
+ * for rendering.
2699
+ * @param callback A callback function to call for dirty events
2700
+ * @param destroy An optional callback to destroy `user_data` when the `callback` is removed or `onscreen` is freed.
2701
+ * @returns a #CoglOnscreenDirtyClosure pointer that can be used to remove the callback and associated @user_data later.
2702
+ */
2703
+ add_dirty_callback(callback: OnscreenDirtyCallback, destroy: UserDataDestroyCallback | null): OnscreenDirtyClosure
2704
+ /**
2705
+ * Installs a `callback` function that will be called for significant
2706
+ * events relating to the given `onscreen` framebuffer.
2707
+ *
2708
+ * The `callback` will be used to notify when the system compositor is
2709
+ * ready for this application to render a new frame. In this case
2710
+ * %COGL_FRAME_EVENT_SYNC will be passed as the event argument to the
2711
+ * given `callback` in addition to the #CoglFrameInfo corresponding to
2712
+ * the frame being acknowledged by the compositor.
2713
+ *
2714
+ * The `callback` will also be called to notify when the frame has
2715
+ * ended. In this case %COGL_FRAME_EVENT_COMPLETE will be passed as
2716
+ * the event argument to the given `callback` in addition to the
2717
+ * #CoglFrameInfo corresponding to the newly presented frame. The
2718
+ * meaning of "ended" here simply means that no more timing
2719
+ * information will be collected within the corresponding
2720
+ * #CoglFrameInfo and so this is a good opportunity to analyse the
2721
+ * given info. It does not necessarily mean that the GPU has finished
2722
+ * rendering the corresponding frame.
2723
+ *
2724
+ * We highly recommend throttling your application according to
2725
+ * %COGL_FRAME_EVENT_SYNC events so that your application can avoid
2726
+ * wasting resources, drawing more frames than your system compositor
2727
+ * can display.
2728
+ * @param callback A callback function to call for frame events
2729
+ * @param destroy An optional callback to destroy `user_data` when the `callback` is removed or `onscreen` is freed.
2730
+ * @returns a #CoglFrameClosure pointer that can be used to remove the callback and associated @user_data later.
2731
+ */
2732
+ add_frame_callback(callback: FrameCallback, destroy: UserDataDestroyCallback | null): FrameClosure
2733
+ /**
2734
+ * Gets the current age of the buffer contents.
2735
+ *
2736
+ * This function allows applications to query the age of the current
2737
+ * back buffer contents for a #CoglOnscreen as the number of frames
2738
+ * elapsed since the contents were most recently defined.
2739
+ *
2740
+ * These age values exposes enough information to applications about
2741
+ * how Cogl internally manages back buffers to allow applications to
2742
+ * re-use the contents of old frames and minimize how much must be
2743
+ * redrawn for the next frame.
2744
+ *
2745
+ * The back buffer contents can either be reported as invalid (has an
2746
+ * age of 0) or it may be reported to be the same contents as from n
2747
+ * frames prior to the current frame.
2748
+ *
2749
+ * The queried value remains valid until the next buffer swap.
2750
+ *
2751
+ * <note>One caveat is that under X11 the buffer age does not reflect
2752
+ * changes to buffer contents caused by the window systems. X11
2753
+ * applications must track Expose events to determine what buffer
2754
+ * regions need to additionally be repaired each frame.</note>
2755
+ *
2756
+ * The recommended way to take advantage of this buffer age api is to
2757
+ * build up a circular buffer of length 3 for tracking damage regions
2758
+ * over the last 3 frames and when starting a new frame look at the
2759
+ * age of the buffer and combine the damage regions for the current
2760
+ * frame with the damage regions of previous `age` frames so you know
2761
+ * everything that must be redrawn to update the old contents for the
2762
+ * new frame.
2763
+ *
2764
+ * <note>If the system doesn't not support being able to track the age
2765
+ * of back buffers then this function will always return 0 which
2766
+ * implies that the contents are undefined.</note>
2767
+ *
2768
+ * <note>The %COGL_FEATURE_ID_BUFFER_AGE feature can optionally be
2769
+ * explicitly checked to determine if Cogl is currently tracking the
2770
+ * age of #CoglOnscreen back buffer contents. If this feature is
2771
+ * missing then this function will always return 0.</note>
2772
+ * @returns The age of the buffer contents or 0 when the buffer contents are undefined.
2773
+ */
2774
+ get_buffer_age(): number
2775
+ /**
2776
+ * Gets the value of the framebuffers frame counter. This is
2777
+ * a counter that increases by one each time
2778
+ * cogl_onscreen_swap_buffers() or cogl_onscreen_swap_region()
2779
+ * is called.
2780
+ * @returns the current frame counter value
2781
+ */
2782
+ get_frame_counter(): number
2783
+ /**
2784
+ * This requests to make `onscreen` invisible to the user.
2785
+ *
2786
+ * Actually the precise semantics of this function depend on the
2787
+ * window system currently in use, and if you don't have a
2788
+ * multi-windowining system this function may in-fact do nothing.
2789
+ *
2790
+ * This function does not implicitly allocate the given `onscreen`
2791
+ * framebuffer before hiding it.
2792
+ *
2793
+ * <note>Since Cogl doesn't explicitly track the visibility status of
2794
+ * onscreen framebuffers it won't try to avoid redundant window system
2795
+ * requests e.g. to show an already visible window. This also means
2796
+ * that it's acceptable to alternatively use native APIs to show and
2797
+ * hide windows without confusing Cogl.</note>
2798
+ */
2799
+ hide(): void
2800
+ /**
2801
+ * Implementation for https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_partial_update.txt
2802
+ * This immediately queues state to OpenGL that will be used for the
2803
+ * next swap.
2804
+ * This needs to be called every frame.
2805
+ * @param rectangles An array of integer 4-tuples representing damaged rectangles as (x, y, width, height) tuples.
2806
+ * @param n_rectangles The number of 4-tuples to be read from `rectangles`
2807
+ */
2808
+ queue_damage_region(rectangles: number, n_rectangles: number): void
2809
+ /**
2810
+ * Removes a callback and associated user data that were previously
2811
+ * registered using cogl_onscreen_add_dirty_callback().
2812
+ *
2813
+ * If a destroy callback was passed to
2814
+ * cogl_onscreen_add_dirty_callback() to destroy the user data then
2815
+ * this will also get called.
2816
+ * @param closure A #CoglOnscreenDirtyClosure returned from cogl_onscreen_add_dirty_callback()
2817
+ */
2818
+ remove_dirty_callback(closure: OnscreenDirtyClosure): void
2819
+ /**
2820
+ * Removes a callback and associated user data that were previously
2821
+ * registered using cogl_onscreen_add_frame_callback().
2822
+ *
2823
+ * If a destroy callback was passed to
2824
+ * cogl_onscreen_add_frame_callback() to destroy the user data then
2825
+ * this will get called.
2826
+ * @param closure A #CoglFrameClosure returned from cogl_onscreen_add_frame_callback()
2827
+ */
2828
+ remove_frame_callback(closure: FrameClosure): void
2829
+ /**
2830
+ * This requests to make `onscreen` visible to the user.
2831
+ *
2832
+ * Actually the precise semantics of this function depend on the
2833
+ * window system currently in use, and if you don't have a
2834
+ * multi-windowining system this function may in-fact do nothing.
2835
+ *
2836
+ * This function will implicitly allocate the given `onscreen`
2837
+ * framebuffer before showing it if it hasn't already been allocated.
2838
+ *
2839
+ * When using the Wayland winsys calling this will set the surface to
2840
+ * a toplevel type which will make it appear. If the application wants
2841
+ * to set a different type for the surface, it can avoid calling
2842
+ * cogl_onscreen_show() and set its own type directly with the Wayland
2843
+ * client API via cogl_wayland_onscreen_get_surface().
2844
+ *
2845
+ * <note>Since Cogl doesn't explicitly track the visibility status of
2846
+ * onscreen framebuffers it won't try to avoid redundant window system
2847
+ * requests e.g. to show an already visible window. This also means
2848
+ * that it's acceptable to alternatively use native APIs to show and
2849
+ * hide windows without confusing Cogl.</note>
2850
+ */
2851
+ show(): void
2852
+ /**
2853
+ * Swaps the current back buffer being rendered too, to the front for display.
2854
+ *
2855
+ * This function also implicitly discards the contents of the color, depth and
2856
+ * stencil buffers as if cogl_framebuffer_discard_buffers() were used. The
2857
+ * significance of the discard is that you should not expect to be able to
2858
+ * start a new frame that incrementally builds on the contents of the previous
2859
+ * frame.
2860
+ *
2861
+ * <note>It is highly recommended that applications use
2862
+ * cogl_onscreen_swap_buffers_with_damage() instead whenever possible
2863
+ * and also use the cogl_onscreen_get_buffer_age() api so they can
2864
+ * perform incremental updates to older buffers instead of having to
2865
+ * render a full buffer for every frame.</note>
2866
+ * @param frame_info
2867
+ * @param user_data
2868
+ */
2869
+ swap_buffers(frame_info: FrameInfo, user_data: any | null): void
2870
+ /**
2871
+ * Swaps the current back buffer being rendered too, to the front for
2872
+ * display and provides information to any system compositor about
2873
+ * what regions of the buffer have changed (damage) with respect to
2874
+ * the last swapped buffer.
2875
+ *
2876
+ * This function has the same semantics as
2877
+ * cogl_framebuffer_swap_buffers() except that it additionally allows
2878
+ * applications to pass a list of damaged rectangles which may be
2879
+ * passed on to a compositor so that it can minimize how much of the
2880
+ * screen is redrawn in response to this applications newly swapped
2881
+ * front buffer.
2882
+ *
2883
+ * For example if your application is only animating a small object in
2884
+ * the corner of the screen and everything else is remaining static
2885
+ * then it can help the compositor to know that only the bottom right
2886
+ * corner of your newly swapped buffer has really changed with respect
2887
+ * to your previously swapped front buffer.
2888
+ *
2889
+ * If `n_rectangles` is 0 then the whole buffer will implicitly be
2890
+ * reported as damaged as if cogl_onscreen_swap_buffers() had been
2891
+ * called.
2892
+ *
2893
+ * This function also implicitly discards the contents of the color,
2894
+ * depth and stencil buffers as if cogl_framebuffer_discard_buffers()
2895
+ * were used. The significance of the discard is that you should not
2896
+ * expect to be able to start a new frame that incrementally builds on
2897
+ * the contents of the previous frame. If you want to perform
2898
+ * incremental updates to older back buffers then please refer to the
2899
+ * cogl_onscreen_get_buffer_age() api.
2900
+ *
2901
+ * Whenever possible it is recommended that applications use this
2902
+ * function instead of cogl_onscreen_swap_buffers() to improve
2903
+ * performance when running under a compositor.
2904
+ *
2905
+ * <note>It is highly recommended to use this API in conjunction with
2906
+ * the cogl_onscreen_get_buffer_age() api so that your application can
2907
+ * perform incremental rendering based on old back buffers.</note>
2908
+ * @param rectangles An array of integer 4-tuples representing damaged rectangles as (x, y, width, height) tuples.
2909
+ * @param n_rectangles The number of 4-tuples to be read from `rectangles`
2910
+ * @param info
2911
+ * @param user_data
2912
+ */
2913
+ swap_buffers_with_damage(rectangles: number, n_rectangles: number, info: FrameInfo, user_data: any | null): void
2914
+ /**
2915
+ * Swaps a region of the back buffer being rendered too, to the front for
2916
+ * display. `rectangles` represents the region as array of `n_rectangles` each
2917
+ * defined by 4 sequential (x, y, width, height) integers.
2918
+ *
2919
+ * This function also implicitly discards the contents of the color, depth and
2920
+ * stencil buffers as if cogl_framebuffer_discard_buffers() were used. The
2921
+ * significance of the discard is that you should not expect to be able to
2922
+ * start a new frame that incrementally builds on the contents of the previous
2923
+ * frame.
2924
+ * @param rectangles An array of integer 4-tuples representing rectangles as (x, y, width, height) tuples.
2925
+ * @param n_rectangles The number of 4-tuples to be read from `rectangles`
2926
+ * @param info
2927
+ * @param user_data
2928
+ */
2929
+ swap_region(rectangles: number, n_rectangles: number, info: FrameInfo, user_data: any | null): void
2930
+
2931
+ // Own virtual methods of Cogl-10.Cogl.Onscreen
2932
+
2933
+ vfunc_bind(): void
2934
+ /**
2935
+ * Gets the current age of the buffer contents.
2936
+ *
2937
+ * This function allows applications to query the age of the current
2938
+ * back buffer contents for a #CoglOnscreen as the number of frames
2939
+ * elapsed since the contents were most recently defined.
2940
+ *
2941
+ * These age values exposes enough information to applications about
2942
+ * how Cogl internally manages back buffers to allow applications to
2943
+ * re-use the contents of old frames and minimize how much must be
2944
+ * redrawn for the next frame.
2945
+ *
2946
+ * The back buffer contents can either be reported as invalid (has an
2947
+ * age of 0) or it may be reported to be the same contents as from n
2948
+ * frames prior to the current frame.
2949
+ *
2950
+ * The queried value remains valid until the next buffer swap.
2951
+ *
2952
+ * <note>One caveat is that under X11 the buffer age does not reflect
2953
+ * changes to buffer contents caused by the window systems. X11
2954
+ * applications must track Expose events to determine what buffer
2955
+ * regions need to additionally be repaired each frame.</note>
2956
+ *
2957
+ * The recommended way to take advantage of this buffer age api is to
2958
+ * build up a circular buffer of length 3 for tracking damage regions
2959
+ * over the last 3 frames and when starting a new frame look at the
2960
+ * age of the buffer and combine the damage regions for the current
2961
+ * frame with the damage regions of previous `age` frames so you know
2962
+ * everything that must be redrawn to update the old contents for the
2963
+ * new frame.
2964
+ *
2965
+ * <note>If the system doesn't not support being able to track the age
2966
+ * of back buffers then this function will always return 0 which
2967
+ * implies that the contents are undefined.</note>
2968
+ *
2969
+ * <note>The %COGL_FEATURE_ID_BUFFER_AGE feature can optionally be
2970
+ * explicitly checked to determine if Cogl is currently tracking the
2971
+ * age of #CoglOnscreen back buffer contents. If this feature is
2972
+ * missing then this function will always return 0.</note>
2973
+ * @virtual
2974
+ * @returns The age of the buffer contents or 0 when the buffer contents are undefined.
2975
+ */
2976
+ vfunc_get_buffer_age(): number
2977
+ /**
2978
+ * Implementation for https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_partial_update.txt
2979
+ * This immediately queues state to OpenGL that will be used for the
2980
+ * next swap.
2981
+ * This needs to be called every frame.
2982
+ * @virtual
2983
+ * @param rectangles An array of integer 4-tuples representing damaged rectangles as (x, y, width, height) tuples.
2984
+ * @param n_rectangles The number of 4-tuples to be read from `rectangles`
2985
+ */
2986
+ vfunc_queue_damage_region(rectangles: number, n_rectangles: number): void
2987
+ /**
2988
+ * Swaps the current back buffer being rendered too, to the front for
2989
+ * display and provides information to any system compositor about
2990
+ * what regions of the buffer have changed (damage) with respect to
2991
+ * the last swapped buffer.
2992
+ *
2993
+ * This function has the same semantics as
2994
+ * cogl_framebuffer_swap_buffers() except that it additionally allows
2995
+ * applications to pass a list of damaged rectangles which may be
2996
+ * passed on to a compositor so that it can minimize how much of the
2997
+ * screen is redrawn in response to this applications newly swapped
2998
+ * front buffer.
2999
+ *
3000
+ * For example if your application is only animating a small object in
3001
+ * the corner of the screen and everything else is remaining static
3002
+ * then it can help the compositor to know that only the bottom right
3003
+ * corner of your newly swapped buffer has really changed with respect
3004
+ * to your previously swapped front buffer.
3005
+ *
3006
+ * If `n_rectangles` is 0 then the whole buffer will implicitly be
3007
+ * reported as damaged as if cogl_onscreen_swap_buffers() had been
3008
+ * called.
3009
+ *
3010
+ * This function also implicitly discards the contents of the color,
3011
+ * depth and stencil buffers as if cogl_framebuffer_discard_buffers()
3012
+ * were used. The significance of the discard is that you should not
3013
+ * expect to be able to start a new frame that incrementally builds on
3014
+ * the contents of the previous frame. If you want to perform
3015
+ * incremental updates to older back buffers then please refer to the
3016
+ * cogl_onscreen_get_buffer_age() api.
3017
+ *
3018
+ * Whenever possible it is recommended that applications use this
3019
+ * function instead of cogl_onscreen_swap_buffers() to improve
3020
+ * performance when running under a compositor.
3021
+ *
3022
+ * <note>It is highly recommended to use this API in conjunction with
3023
+ * the cogl_onscreen_get_buffer_age() api so that your application can
3024
+ * perform incremental rendering based on old back buffers.</note>
3025
+ * @virtual
3026
+ * @param rectangles An array of integer 4-tuples representing damaged rectangles as (x, y, width, height) tuples.
3027
+ * @param n_rectangles The number of 4-tuples to be read from `rectangles`
3028
+ * @param info
3029
+ */
3030
+ vfunc_swap_buffers_with_damage(rectangles: number, n_rectangles: number, info: FrameInfo): void
3031
+ /**
3032
+ * Swaps a region of the back buffer being rendered too, to the front for
3033
+ * display. `rectangles` represents the region as array of `n_rectangles` each
3034
+ * defined by 4 sequential (x, y, width, height) integers.
3035
+ *
3036
+ * This function also implicitly discards the contents of the color, depth and
3037
+ * stencil buffers as if cogl_framebuffer_discard_buffers() were used. The
3038
+ * significance of the discard is that you should not expect to be able to
3039
+ * start a new frame that incrementally builds on the contents of the previous
3040
+ * frame.
3041
+ * @virtual
3042
+ * @param rectangles An array of integer 4-tuples representing rectangles as (x, y, width, height) tuples.
3043
+ * @param n_rectangles The number of 4-tuples to be read from `rectangles`
3044
+ * @param info
3045
+ */
3046
+ vfunc_swap_region(rectangles: number, n_rectangles: number, info: FrameInfo): void
3047
+
3048
+ // Class property signals of Cogl-10.Cogl.Onscreen
3049
+
3050
+ connect(sigName: "notify::driver-config", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
3051
+ connect_after(sigName: "notify::driver-config", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
3052
+ emit(sigName: "notify::driver-config", ...args: any[]): void
3053
+ connect(sigName: "notify::height", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
3054
+ connect_after(sigName: "notify::height", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
3055
+ emit(sigName: "notify::height", ...args: any[]): void
3056
+ connect(sigName: "notify::width", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
3057
+ connect_after(sigName: "notify::width", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
3058
+ emit(sigName: "notify::width", ...args: any[]): void
3059
+ connect(sigName: string, callback: (...args: any[]) => void): number
3060
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
3061
+ emit(sigName: string, ...args: any[]): void
3062
+ disconnect(id: number): void
3063
+ }
3064
+
3065
+ export class Onscreen extends Framebuffer {
3066
+
3067
+ // Own properties of Cogl-10.Cogl.Onscreen
3068
+
3069
+ static name: string
3070
+ static $gtype: GObject.GType<Onscreen>
3071
+
3072
+ // Constructors of Cogl-10.Cogl.Onscreen
3073
+
3074
+ constructor(config?: Onscreen.ConstructorProperties)
3075
+ _init(config?: Onscreen.ConstructorProperties): void
3076
+ }
3077
+
3078
+ export module Pipeline {
3079
+
3080
+ // Constructor properties interface
3081
+
3082
+ export interface ConstructorProperties extends Object.ConstructorProperties {
3083
+ }
3084
+
3085
+ }
3086
+
3087
+ export interface Pipeline {
3088
+
3089
+ // Owm methods of Cogl-10.Cogl.Pipeline
3090
+
3091
+ /**
3092
+ * Creates a new pipeline with the configuration copied from the
3093
+ * source pipeline.
3094
+ *
3095
+ * We would strongly advise developers to always aim to use
3096
+ * cogl_pipeline_copy() instead of cogl_pipeline_new() whenever there will
3097
+ * be any similarity between two pipelines. Copying a pipeline helps Cogl
3098
+ * keep track of a pipelines ancestry which we may use to help minimize GPU
3099
+ * state changes.
3100
+ * @returns a pointer to the newly allocated #CoglPipeline
3101
+ */
3102
+ copy(): Pipeline
3103
+ /**
3104
+ * Iterates all the layer indices of the given `pipeline`.
3105
+ * @param callback A #CoglPipelineLayerCallback to be called for each layer index
3106
+ */
3107
+ foreach_layer(callback: PipelineLayerCallback): void
3108
+ get_alpha_test_function(): PipelineAlphaFunc
3109
+ get_alpha_test_reference(): number
3110
+ /**
3111
+ * Retrieves the current pipeline color.
3112
+ */
3113
+ get_color(): /* color */ Color
3114
+ get_cull_face_mode(): PipelineCullFaceMode
3115
+ /**
3116
+ * The order of the vertices within a primitive specifies whether it
3117
+ * is considered to be front or back facing. This function specifies
3118
+ * which order is considered to be the front
3119
+ * faces. %COGL_WINDING_COUNTER_CLOCKWISE sets the front faces to
3120
+ * primitives with vertices in a counter-clockwise order and
3121
+ * %COGL_WINDING_CLOCKWISE sets them to be clockwise. The default is
3122
+ * %COGL_WINDING_COUNTER_CLOCKWISE.
3123
+ * @returns The @pipeline front face winding Status: Unstable
3124
+ */
3125
+ get_front_face_winding(): Winding
3126
+ /**
3127
+ * Retrieves the currently set magnification #CoglPipelineFilter set on
3128
+ * the specified layer. The magnification filter determines how the
3129
+ * layer should be sampled when up-scaled.
3130
+ *
3131
+ * The default filter is %COGL_PIPELINE_FILTER_LINEAR but this can be
3132
+ * changed using cogl_pipeline_set_layer_filters().
3133
+ * @param layer_index the layer number to change.
3134
+ * @returns The magnification #CoglPipelineFilter for the specified layer.
3135
+ */
3136
+ get_layer_mag_filter(layer_index: number): PipelineFilter
3137
+ /**
3138
+ * Retrieves the currently set minification #CoglPipelineFilter set on
3139
+ * the specified layer. The miniifcation filter determines how the
3140
+ * layer should be sampled when down-scaled.
3141
+ *
3142
+ * The default filter is %COGL_PIPELINE_FILTER_LINEAR but this can be
3143
+ * changed using cogl_pipeline_set_layer_filters().
3144
+ * @param layer_index the layer number to change.
3145
+ * @returns The minification #CoglPipelineFilter for the specified layer.
3146
+ */
3147
+ get_layer_min_filter(layer_index: number): PipelineFilter
3148
+ /**
3149
+ * Gets whether point sprite coordinate generation is enabled for this
3150
+ * texture layer.
3151
+ * @param layer_index the layer number to check.
3152
+ * @returns whether the texture coordinates will be replaced with point sprite coordinates.
3153
+ */
3154
+ get_layer_point_sprite_coords_enabled(layer_index: number): boolean
3155
+ get_layer_texture(layer_index: number): Texture
3156
+ /**
3157
+ * Returns the wrap mode for the 's' coordinate of texture lookups on this
3158
+ * layer.
3159
+ * @param layer_index the layer number to change.
3160
+ * @returns the wrap mode for the 's' coordinate of texture lookups on this layer.
3161
+ */
3162
+ get_layer_wrap_mode_s(layer_index: number): PipelineWrapMode
3163
+ /**
3164
+ * Returns the wrap mode for the 't' coordinate of texture lookups on this
3165
+ * layer.
3166
+ * @param layer_index the layer number to change.
3167
+ * @returns the wrap mode for the 't' coordinate of texture lookups on this layer.
3168
+ */
3169
+ get_layer_wrap_mode_t(layer_index: number): PipelineWrapMode
3170
+ /**
3171
+ * Retrieves the number of layers defined for the given `pipeline`
3172
+ * @returns the number of layers
3173
+ */
3174
+ get_n_layers(): number
3175
+ get_per_vertex_point_size(): boolean
3176
+ /**
3177
+ * Get the size of points drawn when %COGL_VERTICES_MODE_POINTS is
3178
+ * used with the vertex buffer API.
3179
+ * @returns the point size of the @pipeline.
3180
+ */
3181
+ get_point_size(): number
3182
+ /**
3183
+ * This is used to get an integer representing the uniform with the
3184
+ * name `uniform_name`. The integer can be passed to functions such as
3185
+ * cogl_pipeline_set_uniform_1f() to set the value of a uniform.
3186
+ *
3187
+ * This function will always return a valid integer. Ie, unlike
3188
+ * OpenGL, it does not return -1 if the uniform is not available in
3189
+ * this pipeline so it can not be used to test whether uniforms are
3190
+ * present. It is not necessary to set the program on the pipeline
3191
+ * before calling this function.
3192
+ * @param uniform_name The name of a uniform
3193
+ * @returns A integer representing the location of the given uniform.
3194
+ */
3195
+ get_uniform_location(uniform_name: string | null): number
3196
+ /**
3197
+ * Queries what user program has been associated with the given
3198
+ * `pipeline` using cogl_pipeline_set_user_program().
3199
+ * @returns The current user program or %NULL.
3200
+ */
3201
+ get_user_program(): Handle
3202
+ /**
3203
+ * This function removes a layer from your pipeline
3204
+ * @param layer_index Specifies the layer you want to remove
3205
+ */
3206
+ remove_layer(layer_index: number): void
3207
+ /**
3208
+ * Before a primitive is blended with the framebuffer, it goes through an
3209
+ * alpha test stage which lets you discard fragments based on the current
3210
+ * alpha value. This function lets you change the function used to evaluate
3211
+ * the alpha channel, and thus determine which fragments are discarded
3212
+ * and which continue on to the blending stage.
3213
+ *
3214
+ * The default is %COGL_PIPELINE_ALPHA_FUNC_ALWAYS
3215
+ * @param alpha_func A `CoglPipelineAlphaFunc` constant
3216
+ * @param alpha_reference A reference point that the chosen alpha function uses to compare incoming fragments to.
3217
+ */
3218
+ set_alpha_test_function(alpha_func: PipelineAlphaFunc, alpha_reference: number): void
3219
+ /**
3220
+ * If not already familiar; please refer <link linkend="cogl-Blend-Strings">here</link>
3221
+ * for an overview of what blend strings are, and their syntax.
3222
+ *
3223
+ * Blending occurs after the alpha test function, and combines fragments with
3224
+ * the framebuffer.
3225
+ *
3226
+ * Currently the only blend function Cogl exposes is ADD(). So any valid
3227
+ * blend statements will be of the form:
3228
+ *
3229
+ *
3230
+ * ```
3231
+ * &lt;channel-mask&gt;=ADD(SRC_COLOR*(&lt;factor&gt;), DST_COLOR*(&lt;factor&gt;))
3232
+ * ```
3233
+ *
3234
+ *
3235
+ * This is the list of source-names usable as blend factors:
3236
+ * <itemizedlist>
3237
+ * <listitem><para>SRC_COLOR: The color of the incoming fragment</para></listitem>
3238
+ * <listitem><para>DST_COLOR: The color of the framebuffer</para></listitem>
3239
+ * <listitem><para>CONSTANT: The constant set via cogl_pipeline_set_blend_constant()</para></listitem>
3240
+ * </itemizedlist>
3241
+ *
3242
+ * The source names can be used according to the
3243
+ * <link linkend="cogl-Blend-String-syntax">color-source and factor syntax</link>,
3244
+ * so for example "(1-SRC_COLOR[A])" would be a valid factor, as would
3245
+ * "(CONSTANT[RGB])"
3246
+ *
3247
+ * These can also be used as factors:
3248
+ * <itemizedlist>
3249
+ * <listitem>0: (0, 0, 0, 0)</listitem>
3250
+ * <listitem>1: (1, 1, 1, 1)</listitem>
3251
+ * <listitem>SRC_ALPHA_SATURATE_FACTOR: (f,f,f,1) where f = MIN(SRC_COLOR[A],1-DST_COLOR[A])</listitem>
3252
+ * </itemizedlist>
3253
+ *
3254
+ * <note>Remember; all color components are normalized to the range [0, 1]
3255
+ * before computing the result of blending.</note>
3256
+ *
3257
+ * <example id="cogl-Blend-Strings-blend-unpremul">
3258
+ * <title>Blend Strings/1</title>
3259
+ * <para>Blend a non-premultiplied source over a destination with
3260
+ * premultiplied alpha:</para>
3261
+ * <programlisting>
3262
+ * "RGB = ADD(SRC_COLOR*(SRC_COLOR[A]), DST_COLOR*(1-SRC_COLOR[A]))"
3263
+ * "A = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
3264
+ * </programlisting>
3265
+ * </example>
3266
+ *
3267
+ * <example id="cogl-Blend-Strings-blend-premul">
3268
+ * <title>Blend Strings/2</title>
3269
+ * <para>Blend a premultiplied source over a destination with
3270
+ * premultiplied alpha</para>
3271
+ * <programlisting>
3272
+ * "RGBA = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
3273
+ * </programlisting>
3274
+ * </example>
3275
+ *
3276
+ * The default blend string is:
3277
+ *
3278
+ * ```
3279
+ * RGBA = ADD (SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))
3280
+ * ```
3281
+ *
3282
+ *
3283
+ * That gives normal alpha-blending when the calculated color for the pipeline
3284
+ * is in premultiplied form.
3285
+ * @param blend_string A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired blend function.
3286
+ * @returns %TRUE if the blend string was successfully parsed, and the described blending is supported by the underlying driver/hardware. If there was an error, %FALSE is returned and @error is set accordingly (if present).
3287
+ */
3288
+ set_blend(blend_string: string | null): boolean
3289
+ /**
3290
+ * When blending is setup to reference a CONSTANT blend factor then
3291
+ * blending will depend on the constant set with this function.
3292
+ * @param constant_color The constant color you want
3293
+ */
3294
+ set_blend_constant(constant_color: Color): void
3295
+ /**
3296
+ * Sets the basic color of the pipeline, used when no lighting is enabled.
3297
+ *
3298
+ * Note that if you don't add any layers to the pipeline then the color
3299
+ * will be blended unmodified with the destination; the default blend
3300
+ * expects premultiplied colors: for example, use (0.5, 0.0, 0.0, 0.5) for
3301
+ * semi-transparent red. See cogl_color_premultiply().
3302
+ *
3303
+ * The default value is (1.0, 1.0, 1.0, 1.0)
3304
+ * @param color The components of the color
3305
+ */
3306
+ set_color(color: Color): void
3307
+ /**
3308
+ * Sets the basic color of the pipeline, used when no lighting is enabled.
3309
+ *
3310
+ * The default value is (1.0, 1.0, 1.0, 1.0)
3311
+ * @param red The red component
3312
+ * @param green The green component
3313
+ * @param blue The blue component
3314
+ * @param alpha The alpha component
3315
+ */
3316
+ set_color4f(red: number, green: number, blue: number, alpha: number): void
3317
+ /**
3318
+ * Sets the basic color of the pipeline, used when no lighting is enabled.
3319
+ *
3320
+ * The default value is (0xff, 0xff, 0xff, 0xff)
3321
+ * @param red The red component
3322
+ * @param green The green component
3323
+ * @param blue The blue component
3324
+ * @param alpha The alpha component
3325
+ */
3326
+ set_color4ub(red: number, green: number, blue: number, alpha: number): void
3327
+ /**
3328
+ * Sets which faces will be culled when drawing. Face culling can be
3329
+ * used to increase efficiency by avoiding drawing faces that would
3330
+ * get overridden. For example, if a model has gaps so that it is
3331
+ * impossible to see the inside then faces which are facing away from
3332
+ * the screen will never be seen so there is no point in drawing
3333
+ * them. This can be achieved by setting the cull face mode to
3334
+ * %COGL_PIPELINE_CULL_FACE_MODE_BACK.
3335
+ *
3336
+ * Face culling relies on the primitives being drawn with a specific
3337
+ * order to represent which faces are facing inside and outside the
3338
+ * model. This order can be specified by calling
3339
+ * cogl_pipeline_set_front_face_winding().
3340
+ *
3341
+ * Status: Unstable
3342
+ * @param cull_face_mode The new mode to set
3343
+ */
3344
+ set_cull_face_mode(cull_face_mode: PipelineCullFaceMode): void
3345
+ /**
3346
+ * The order of the vertices within a primitive specifies whether it
3347
+ * is considered to be front or back facing. This function specifies
3348
+ * which order is considered to be the front
3349
+ * faces. %COGL_WINDING_COUNTER_CLOCKWISE sets the front faces to
3350
+ * primitives with vertices in a counter-clockwise order and
3351
+ * %COGL_WINDING_CLOCKWISE sets them to be clockwise. The default is
3352
+ * %COGL_WINDING_COUNTER_CLOCKWISE.
3353
+ *
3354
+ * Status: Unstable
3355
+ * @param front_winding the winding order
3356
+ */
3357
+ set_front_face_winding(front_winding: Winding): void
3358
+ /**
3359
+ * If not already familiar; you can refer
3360
+ * <link linkend="cogl-Blend-Strings">here</link> for an overview of what blend
3361
+ * strings are and there syntax.
3362
+ *
3363
+ * These are all the functions available for texture combining:
3364
+ * <itemizedlist>
3365
+ * <listitem>REPLACE(arg0) = arg0</listitem>
3366
+ * <listitem>MODULATE(arg0, arg1) = arg0 x arg1</listitem>
3367
+ * <listitem>ADD(arg0, arg1) = arg0 + arg1</listitem>
3368
+ * <listitem>ADD_SIGNED(arg0, arg1) = arg0 + arg1 - 0.5</listitem>
3369
+ * <listitem>INTERPOLATE(arg0, arg1, arg2) = arg0 x arg2 + arg1 x (1 - arg2)</listitem>
3370
+ * <listitem>SUBTRACT(arg0, arg1) = arg0 - arg1</listitem>
3371
+ * <listitem>
3372
+ * <programlisting>
3373
+ * DOT3_RGB(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) +
3374
+ * (arg0[G] - 0.5)) * (arg1[G] - 0.5) +
3375
+ * (arg0[B] - 0.5)) * (arg1[B] - 0.5))
3376
+ * </programlisting>
3377
+ * </listitem>
3378
+ * <listitem>
3379
+ * <programlisting>
3380
+ * DOT3_RGBA(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) +
3381
+ * (arg0[G] - 0.5)) * (arg1[G] - 0.5) +
3382
+ * (arg0[B] - 0.5)) * (arg1[B] - 0.5))
3383
+ * </programlisting>
3384
+ * </listitem>
3385
+ * </itemizedlist>
3386
+ *
3387
+ * Refer to the
3388
+ * <link linkend="cogl-Blend-String-syntax">color-source syntax</link> for
3389
+ * describing the arguments. The valid source names for texture combining
3390
+ * are:
3391
+ * <variablelist>
3392
+ * <varlistentry>
3393
+ * <term>TEXTURE</term>
3394
+ * <listitem>Use the color from the current texture layer</listitem>
3395
+ * </varlistentry>
3396
+ * <varlistentry>
3397
+ * <term>TEXTURE_0, TEXTURE_1, etc</term>
3398
+ * <listitem>Use the color from the specified texture layer</listitem>
3399
+ * </varlistentry>
3400
+ * <varlistentry>
3401
+ * <term>CONSTANT</term>
3402
+ * <listitem>Use the color from the constant given with
3403
+ * cogl_pipeline_set_layer_combine_constant()</listitem>
3404
+ * </varlistentry>
3405
+ * <varlistentry>
3406
+ * <term>PRIMARY</term>
3407
+ * <listitem>Use the color of the pipeline as set with
3408
+ * cogl_pipeline_set_color()</listitem>
3409
+ * </varlistentry>
3410
+ * <varlistentry>
3411
+ * <term>PREVIOUS</term>
3412
+ * <listitem>Either use the texture color from the previous layer, or
3413
+ * if this is layer 0, use the color of the pipeline as set with
3414
+ * cogl_pipeline_set_color()</listitem>
3415
+ * </varlistentry>
3416
+ * </variablelist>
3417
+ *
3418
+ * <refsect2 id="cogl-Layer-Combine-Examples">
3419
+ * <title>Layer Combine Examples</title>
3420
+ * <para>This is effectively what the default blending is:</para>
3421
+ * <informalexample><programlisting>
3422
+ * RGBA = MODULATE (PREVIOUS, TEXTURE)
3423
+ * </programlisting></informalexample>
3424
+ * <para>This could be used to cross-fade between two images, using
3425
+ * the alpha component of a constant as the interpolator. The constant
3426
+ * color is given by calling
3427
+ * cogl_pipeline_set_layer_combine_constant().</para>
3428
+ * <informalexample><programlisting>
3429
+ * RGBA = INTERPOLATE (PREVIOUS, TEXTURE, CONSTANT[A])
3430
+ * </programlisting></informalexample>
3431
+ * </refsect2>
3432
+ *
3433
+ * <note>You can't give a multiplication factor for arguments as you can
3434
+ * with blending.</note>
3435
+ * @param layer_index Specifies the layer you want define a combine function for
3436
+ * @param blend_string A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired texture combine function.
3437
+ * @returns %TRUE if the blend string was successfully parsed, and the described texture combining is supported by the underlying driver and or hardware. On failure, %FALSE is returned and @error is set
3438
+ */
3439
+ set_layer_combine(layer_index: number, blend_string: string | null): boolean
3440
+ /**
3441
+ * When you are using the 'CONSTANT' color source in a layer combine
3442
+ * description then you can use this function to define its value.
3443
+ * @param layer_index Specifies the layer you want to specify a constant used for texture combining
3444
+ * @param constant The constant color you want
3445
+ */
3446
+ set_layer_combine_constant(layer_index: number, constant: Color): void
3447
+ /**
3448
+ * Changes the decimation and interpolation filters used when a texture is
3449
+ * drawn at other scales than 100%.
3450
+ *
3451
+ * <note>It is an error to pass anything other than
3452
+ * %COGL_PIPELINE_FILTER_NEAREST or %COGL_PIPELINE_FILTER_LINEAR as
3453
+ * magnification filters since magnification doesn't ever need to
3454
+ * reference values stored in the mipmap chain.</note>
3455
+ * @param layer_index the layer number to change.
3456
+ * @param min_filter the filter used when scaling a texture down.
3457
+ * @param mag_filter the filter used when magnifying a texture.
3458
+ */
3459
+ set_layer_filters(layer_index: number, min_filter: PipelineFilter, mag_filter: PipelineFilter): void
3460
+ /**
3461
+ * This function lets you set a matrix that can be used to e.g. translate
3462
+ * and rotate a single layer of a pipeline used to fill your geometry.
3463
+ * @param layer_index the index for the layer inside `pipeline`
3464
+ * @param matrix the transformation matrix for the layer
3465
+ */
3466
+ set_layer_matrix(layer_index: number, matrix: Graphene.Matrix): void
3467
+ set_layer_max_mipmap_level(layer: number, max_level: number): void
3468
+ /**
3469
+ * Sets the texture for this layer to be the default texture for the
3470
+ * given type. The default texture is a 1x1 pixel white texture.
3471
+ *
3472
+ * This function is mostly useful if you want to create a base
3473
+ * pipeline that you want to create multiple copies from using
3474
+ * cogl_pipeline_copy(). In that case this function can be used to
3475
+ * specify the texture type so that any pipeline copies can share the
3476
+ * internal texture type state for efficiency.
3477
+ * @param layer_index The layer number to modify
3478
+ */
3479
+ set_layer_null_texture(layer_index: number): void
3480
+ /**
3481
+ * When rendering points, if `enable` is %TRUE then the texture
3482
+ * coordinates for this layer will be replaced with coordinates that
3483
+ * vary from 0.0 to 1.0 across the primitive. The top left of the
3484
+ * point will have the coordinates 0.0,0.0 and the bottom right will
3485
+ * have 1.0,1.0. If `enable` is %FALSE then the coordinates will be
3486
+ * fixed for the entire point.
3487
+ * @param layer_index the layer number to change.
3488
+ * @param enable whether to enable point sprite coord generation.
3489
+ * @returns %TRUE if the function succeeds, %FALSE otherwise.
3490
+ */
3491
+ set_layer_point_sprite_coords_enabled(layer_index: number, enable: boolean): boolean
3492
+ set_layer_texture(layer_index: number, texture: Texture): void
3493
+ /**
3494
+ * Sets the wrap mode for all three coordinates of texture lookups on
3495
+ * this layer. This is equivalent to calling
3496
+ * cogl_pipeline_set_layer_wrap_mode_s() and
3497
+ * cogl_pipeline_set_layer_wrap_mode_t() separately.
3498
+ * @param layer_index the layer number to change.
3499
+ * @param mode the new wrap mode
3500
+ */
3501
+ set_layer_wrap_mode(layer_index: number, mode: PipelineWrapMode): void
3502
+ /**
3503
+ * Sets the wrap mode for the 's' coordinate of texture lookups on this layer.
3504
+ * @param layer_index the layer number to change.
3505
+ * @param mode the new wrap mode
3506
+ */
3507
+ set_layer_wrap_mode_s(layer_index: number, mode: PipelineWrapMode): void
3508
+ /**
3509
+ * Sets the wrap mode for the 't' coordinate of texture lookups on this layer.
3510
+ * @param layer_index the layer number to change.
3511
+ * @param mode the new wrap mode
3512
+ */
3513
+ set_layer_wrap_mode_t(layer_index: number, mode: PipelineWrapMode): void
3514
+ /**
3515
+ * Sets whether to use a per-vertex point size or to use the value set
3516
+ * by cogl_pipeline_set_point_size(). If per-vertex point size is
3517
+ * enabled then the point size can be set for an individual point
3518
+ * either by drawing with a #CoglAttribute with the name
3519
+ * ‘cogl_point_size_in’ or by writing to the GLSL builtin
3520
+ * ‘cogl_point_size_out’ from a vertex shader snippet.
3521
+ *
3522
+ * If per-vertex point size is enabled and this attribute is not used
3523
+ * and cogl_point_size_out is not written to then the results are
3524
+ * undefined.
3525
+ * @param enable whether to enable per-vertex point size
3526
+ * @returns %TRUE if the change succeeded or %FALSE otherwise
3527
+ */
3528
+ set_per_vertex_point_size(enable: boolean): boolean
3529
+ /**
3530
+ * Changes the size of points drawn when %COGL_VERTICES_MODE_POINTS is
3531
+ * used with the attribute buffer API. Note that typically the GPU
3532
+ * will only support a limited minimum and maximum range of point
3533
+ * sizes. If the chosen point size is outside that range then the
3534
+ * nearest value within that range will be used instead. The size of a
3535
+ * point is in screen space so it will be the same regardless of any
3536
+ * transformations.
3537
+ *
3538
+ * If the point size is set to 0.0 then drawing points with the
3539
+ * pipeline will have undefined results. This is the default value so
3540
+ * if an application wants to draw points it must make sure to use a
3541
+ * pipeline that has an explicit point size set on it.
3542
+ * @param point_size the new point size.
3543
+ */
3544
+ set_point_size(point_size: number): void
3545
+ /**
3546
+ * Sets a new value for the uniform at `uniform_location`. If this
3547
+ * pipeline has a user program attached and is later used as a source
3548
+ * for drawing, the given value will be assigned to the uniform which
3549
+ * can be accessed from the shader's source. The value for
3550
+ * `uniform_location` should be retrieved from the string name of the
3551
+ * uniform by calling cogl_pipeline_get_uniform_location().
3552
+ *
3553
+ * This function should be used to set uniforms that are of type
3554
+ * float. It can also be used to set a single member of a float array
3555
+ * uniform.
3556
+ * @param uniform_location The uniform's location identifier
3557
+ * @param value The new value for the uniform
3558
+ */
3559
+ set_uniform_1f(uniform_location: number, value: number): void
3560
+ /**
3561
+ * Sets a new value for the uniform at `uniform_location`. If this
3562
+ * pipeline has a user program attached and is later used as a source
3563
+ * for drawing, the given value will be assigned to the uniform which
3564
+ * can be accessed from the shader's source. The value for
3565
+ * `uniform_location` should be retrieved from the string name of the
3566
+ * uniform by calling cogl_pipeline_get_uniform_location().
3567
+ *
3568
+ * This function should be used to set uniforms that are of type
3569
+ * int. It can also be used to set a single member of a int array
3570
+ * uniform or a sampler uniform.
3571
+ * @param uniform_location The uniform's location identifier
3572
+ * @param value The new value for the uniform
3573
+ */
3574
+ set_uniform_1i(uniform_location: number, value: number): void
3575
+ /**
3576
+ * Sets new values for the uniform at `uniform_location`. If this
3577
+ * pipeline has a user program attached and is later used as a source
3578
+ * for drawing, the given values will be assigned to the uniform which
3579
+ * can be accessed from the shader's source. The value for
3580
+ * `uniform_location` should be retrieved from the string name of the
3581
+ * uniform by calling cogl_pipeline_get_uniform_location().
3582
+ *
3583
+ * This function can be used to set any floating point type uniform,
3584
+ * including float arrays and float vectors. For example, to set a
3585
+ * single vec4 uniform you would use 4 for `n_components` and 1 for
3586
+ * `count`. To set an array of 8 float values, you could use 1 for
3587
+ * `n_components` and 8 for `count`.
3588
+ * @param uniform_location The uniform's location identifier
3589
+ * @param n_components The number of components in the corresponding uniform's type
3590
+ * @param count The number of values to set
3591
+ * @param value Pointer to the new values to set
3592
+ */
3593
+ set_uniform_float(uniform_location: number, n_components: number, count: number, value: number): void
3594
+ /**
3595
+ * Sets new values for the uniform at `uniform_location`. If this
3596
+ * pipeline has a user program attached and is later used as a source
3597
+ * for drawing, the given values will be assigned to the uniform which
3598
+ * can be accessed from the shader's source. The value for
3599
+ * `uniform_location` should be retrieved from the string name of the
3600
+ * uniform by calling cogl_pipeline_get_uniform_location().
3601
+ *
3602
+ * This function can be used to set any integer type uniform,
3603
+ * including int arrays and int vectors. For example, to set a single
3604
+ * ivec4 uniform you would use 4 for `n_components` and 1 for
3605
+ * `count`. To set an array of 8 int values, you could use 1 for
3606
+ * `n_components` and 8 for `count`.
3607
+ * @param uniform_location The uniform's location identifier
3608
+ * @param n_components The number of components in the corresponding uniform's type
3609
+ * @param count The number of values to set
3610
+ * @param value Pointer to the new values to set
3611
+ */
3612
+ set_uniform_int(uniform_location: number, n_components: number, count: number, value: number): void
3613
+ /**
3614
+ * Sets new values for the uniform at `uniform_location`. If this
3615
+ * pipeline has a user program attached and is later used as a source
3616
+ * for drawing, the given values will be assigned to the uniform which
3617
+ * can be accessed from the shader's source. The value for
3618
+ * `uniform_location` should be retrieved from the string name of the
3619
+ * uniform by calling cogl_pipeline_get_uniform_location().
3620
+ *
3621
+ * This function can be used to set any matrix type uniform, including
3622
+ * matrix arrays. For example, to set a single mat4 uniform you would
3623
+ * use 4 for `dimensions` and 1 for `count`. To set an array of 8
3624
+ * mat3 values, you could use 3 for `dimensions` and 8 for `count`.
3625
+ *
3626
+ * If `transpose` is %FALSE then the matrix is expected to be in
3627
+ * column-major order or if it is %TRUE then the matrix is in
3628
+ * row-major order. You can pass a #graphene_matrix_t by calling by passing
3629
+ * the result of graphene_matrix_to_float() in `value` and setting
3630
+ * `transpose` to %FALSE.
3631
+ * @param uniform_location The uniform's location identifier
3632
+ * @param dimensions The size of the matrix
3633
+ * @param count The number of values to set
3634
+ * @param transpose Whether to transpose the matrix
3635
+ * @param value Pointer to the new values to set
3636
+ */
3637
+ set_uniform_matrix(uniform_location: number, dimensions: number, count: number, transpose: boolean, value: number): void
3638
+ /**
3639
+ * Associates a linked CoglProgram with the given pipeline so that the
3640
+ * program can take full control of vertex and/or fragment processing.
3641
+ *
3642
+ * This is an example of how it can be used to associate an ARBfp
3643
+ * program with a #CoglPipeline:
3644
+ *
3645
+ * ```
3646
+ * CoglHandle shader;
3647
+ * CoglHandle program;
3648
+ * CoglPipeline *pipeline;
3649
+ *
3650
+ * shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
3651
+ * cogl_shader_source (shader,
3652
+ * "!!ARBfp1.0\n"
3653
+ * "MOV result.color,fragment.color;\n"
3654
+ * "END\n");
3655
+ *
3656
+ * program = cogl_create_program ();
3657
+ * cogl_program_attach_shader (program, shader);
3658
+ * cogl_program_link (program);
3659
+ *
3660
+ * pipeline = cogl_pipeline_new ();
3661
+ * cogl_pipeline_set_user_program (pipeline, program);
3662
+ *
3663
+ * cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff);
3664
+ * cogl_rectangle (0, 0, 100, 100);
3665
+ * ```
3666
+ *
3667
+ *
3668
+ * It is possibly worth keeping in mind that this API is not part of
3669
+ * the long term design for how we want to expose shaders to Cogl
3670
+ * developers (We are planning on deprecating the cogl_program and
3671
+ * cogl_shader APIs in favour of a "snippet" framework) but in the
3672
+ * meantime we hope this will handle most practical GLSL and ARBfp
3673
+ * requirements.
3674
+ * @param program A #CoglHandle to a linked CoglProgram
3675
+ */
3676
+ set_user_program(program: Handle): void
3677
+
3678
+ // Class property signals of Cogl-10.Cogl.Pipeline
3679
+
3680
+ connect(sigName: string, callback: (...args: any[]) => void): number
3681
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
3682
+ emit(sigName: string, ...args: any[]): void
3683
+ disconnect(id: number): void
3684
+ }
3685
+
3686
+ export class Pipeline extends Object {
3687
+
3688
+ // Own properties of Cogl-10.Cogl.Pipeline
3689
+
3690
+ static name: string
3691
+ static $gtype: GObject.GType<Pipeline>
3692
+
3693
+ // Constructors of Cogl-10.Cogl.Pipeline
3694
+
3695
+ constructor(config?: Pipeline.ConstructorProperties)
3696
+ /**
3697
+ * Allocates and initializes a default simple pipeline that will color
3698
+ * a primitive white.
3699
+ * @constructor
3700
+ * @param context a #CoglContext
3701
+ * @returns a pointer to a new #CoglPipeline
3702
+ */
3703
+ constructor(context: Context)
3704
+ /**
3705
+ * Allocates and initializes a default simple pipeline that will color
3706
+ * a primitive white.
3707
+ * @constructor
3708
+ * @param context a #CoglContext
3709
+ * @returns a pointer to a new #CoglPipeline
3710
+ */
3711
+ static new(context: Context): Pipeline
3712
+ _init(config?: Pipeline.ConstructorProperties): void
3713
+ }
3714
+
3715
+ export module Texture2D {
3716
+
3717
+ // Constructor properties interface
3718
+
3719
+ export interface ConstructorProperties extends Texture.ConstructorProperties, Object.ConstructorProperties {
3720
+ }
3721
+
3722
+ }
3723
+
3724
+ export interface Texture2D extends Texture {
3725
+
3726
+ // Owm methods of Cogl-10.Cogl.Texture2D
3727
+
3728
+ egl_image_external_alloc_finish(user_data: any | null, destroy: GLib.DestroyNotify): void
3729
+ egl_image_external_bind(): void
3730
+
3731
+ // Conflicting methods
3732
+
3733
+ /**
3734
+ * Copies the pixel data from a cogl texture to system memory.
3735
+ *
3736
+ * <note>Don't pass the value of cogl_texture_get_rowstride() as the
3737
+ * `rowstride` argument, the rowstride should be the rowstride you
3738
+ * want for the destination `data` buffer not the rowstride of the
3739
+ * source texture</note>
3740
+ * @param format the #CoglPixelFormat to store the texture as.
3741
+ * @param rowstride the rowstride of `data` in bytes or pass 0 to calculate from the bytes-per-pixel of `format` multiplied by the `texture` width.
3742
+ * @param data memory location to write the `texture'`s contents, or %NULL to only query the data size through the return value.
3743
+ * @returns the size of the texture data in bytes
3744
+ */
3745
+ get_data(format: PixelFormat, rowstride: number, data: Uint8Array | null): number
3746
+
3747
+ // Overloads of get_data
3748
+
3749
+ /**
3750
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
3751
+ * @param key name of the key for that association
3752
+ * @returns the data if found, or %NULL if no such data exists.
3753
+ */
3754
+ get_data(key: string | null): any | null
3755
+ /**
3756
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
3757
+ * @param key name of the key for that association
3758
+ * @returns the data if found, or %NULL if no such data exists.
3759
+ */
3760
+ get_data(key: string | null): any | null
3761
+ /**
3762
+ * `texture` a #CoglTexture.
3763
+ * Sets all the pixels for a given mipmap `level` by copying the pixel
3764
+ * data pointed to by the `data` argument into the given `texture`.
3765
+ *
3766
+ * `data` should point to the first pixel to copy corresponding
3767
+ * to the top left of the mipmap `level` being set.
3768
+ *
3769
+ * If `rowstride` equals 0 then it will be automatically calculated
3770
+ * from the width of the mipmap level and the bytes-per-pixel for the
3771
+ * given `format`.
3772
+ *
3773
+ * A mipmap `level` of 0 corresponds to the largest, base image of a
3774
+ * texture and `level` 1 is half the width and height of level 0. If
3775
+ * dividing any dimension of the previous level by two results in a
3776
+ * fraction then round the number down (floor()), but clamp to 1
3777
+ * something like this:
3778
+ *
3779
+ *
3780
+ * ```
3781
+ * next_width = MAX (1, floor (prev_width));
3782
+ * ```
3783
+ *
3784
+ *
3785
+ * You can determine the number of mipmap levels for a given texture
3786
+ * like this:
3787
+ *
3788
+ *
3789
+ * ```
3790
+ * n_levels = 1 + floor (log2 (max_dimension));
3791
+ * ```
3792
+ *
3793
+ *
3794
+ * Where %max_dimension is the larger of cogl_texture_get_width() and
3795
+ * cogl_texture_get_height().
3796
+ *
3797
+ * It is an error to pass a `level` number >= the number of levels that
3798
+ * `texture` can have according to the above calculation.
3799
+ *
3800
+ * <note>Since the storage for a #CoglTexture is allocated lazily then
3801
+ * if the given `texture` has not previously been allocated then this
3802
+ * api can return %FALSE and throw an exceptional `error` if there is
3803
+ * not enough memory to allocate storage for `texture`.</note>
3804
+ * @param format the #CoglPixelFormat used in the source `data` buffer.
3805
+ * @param rowstride rowstride of the source `data` buffer (computed from the texture width and `format` if it equals 0)
3806
+ * @param data the source data, pointing to the first top-left pixel to set
3807
+ * @param level The mipmap level to update (Normally 0 for the largest, base texture)
3808
+ * @returns %TRUE if the data upload was successful, and %FALSE otherwise
3809
+ */
3810
+ set_data(format: PixelFormat, rowstride: number, data: Uint8Array, level: number): boolean
3811
+
3812
+ // Overloads of set_data
3813
+
3814
+ /**
3815
+ * Each object carries around a table of associations from
3816
+ * strings to pointers. This function lets you set an association.
3817
+ *
3818
+ * If the object already had an association with that name,
3819
+ * the old association will be destroyed.
3820
+ *
3821
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
3822
+ * This means a copy of `key` is kept permanently (even after `object` has been
3823
+ * finalized) — so it is recommended to only use a small, bounded set of values
3824
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
3825
+ * @param key name of the key
3826
+ * @param data data to associate with that key
3827
+ */
3828
+ set_data(key: string | null, data: any | null): void
3829
+ /**
3830
+ * Each object carries around a table of associations from
3831
+ * strings to pointers. This function lets you set an association.
3832
+ *
3833
+ * If the object already had an association with that name,
3834
+ * the old association will be destroyed.
3835
+ *
3836
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
3837
+ * This means a copy of `key` is kept permanently (even after `object` has been
3838
+ * finalized) — so it is recommended to only use a small, bounded set of values
3839
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
3840
+ * @param key name of the key
3841
+ * @param data data to associate with that key
3842
+ */
3843
+ set_data(key: string | null, data: any | null): void
3844
+
3845
+ // Class property signals of Cogl-10.Cogl.Texture2D
3846
+
3847
+ connect(sigName: string, callback: (...args: any[]) => void): number
3848
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
3849
+ emit(sigName: string, ...args: any[]): void
3850
+ disconnect(id: number): void
3851
+ }
3852
+
3853
+ export class Texture2D extends Object {
3854
+
3855
+ // Own properties of Cogl-10.Cogl.Texture2D
3856
+
3857
+ static name: string
3858
+ static $gtype: GObject.GType<Texture2D>
3859
+
3860
+ // Constructors of Cogl-10.Cogl.Texture2D
3861
+
3862
+ constructor(config?: Texture2D.ConstructorProperties)
3863
+ /**
3864
+ * Creates a low-level #CoglTexture2D texture based on data residing
3865
+ * in a #CoglBitmap.
3866
+ *
3867
+ * The storage for the texture is not allocated before this function
3868
+ * returns. You can call cogl_texture_allocate() to explicitly
3869
+ * allocate the underlying storage or preferably let Cogl
3870
+ * automatically allocate storage lazily when it may know more about
3871
+ * how the texture is being used and can optimize how it is allocated.
3872
+ *
3873
+ * The texture is still configurable until it has been allocated so
3874
+ * for example you can influence the internal format of the texture
3875
+ * using cogl_texture_set_components() and
3876
+ * cogl_texture_set_premultiplied().
3877
+ * @constructor
3878
+ * @param bitmap A #CoglBitmap
3879
+ * @returns A newly allocated #CoglTexture2D
3880
+ */
3881
+ static new_from_bitmap(bitmap: Bitmap): Texture2D
3882
+
3883
+ // Overloads of new_from_bitmap
3884
+
3885
+ /**
3886
+ * Creates a #CoglTexture from a #CoglBitmap.
3887
+ * @param bitmap A #CoglBitmap pointer
3888
+ * @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
3889
+ * @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture
3890
+ * @returns A newly created #CoglTexture or %NULL on failure
3891
+ */
3892
+ static new_from_bitmap(bitmap: Bitmap, flags: TextureFlags, internal_format: PixelFormat): Texture
3893
+ _init(config?: Texture2D.ConstructorProperties): void
3894
+ }
3895
+
3896
+ export module Texture2DSliced {
3897
+
3898
+ // Constructor properties interface
3899
+
3900
+ export interface ConstructorProperties extends Texture.ConstructorProperties, Object.ConstructorProperties {
3901
+ }
3902
+
3903
+ }
3904
+
3905
+ export interface Texture2DSliced extends Texture {
3906
+
3907
+ // Conflicting methods
3908
+
3909
+ /**
3910
+ * Copies the pixel data from a cogl texture to system memory.
3911
+ *
3912
+ * <note>Don't pass the value of cogl_texture_get_rowstride() as the
3913
+ * `rowstride` argument, the rowstride should be the rowstride you
3914
+ * want for the destination `data` buffer not the rowstride of the
3915
+ * source texture</note>
3916
+ * @param format the #CoglPixelFormat to store the texture as.
3917
+ * @param rowstride the rowstride of `data` in bytes or pass 0 to calculate from the bytes-per-pixel of `format` multiplied by the `texture` width.
3918
+ * @param data memory location to write the `texture'`s contents, or %NULL to only query the data size through the return value.
3919
+ * @returns the size of the texture data in bytes
3920
+ */
3921
+ get_data(format: PixelFormat, rowstride: number, data: Uint8Array | null): number
3922
+
3923
+ // Overloads of get_data
3924
+
3925
+ /**
3926
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
3927
+ * @param key name of the key for that association
3928
+ * @returns the data if found, or %NULL if no such data exists.
3929
+ */
3930
+ get_data(key: string | null): any | null
3931
+ /**
3932
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
3933
+ * @param key name of the key for that association
3934
+ * @returns the data if found, or %NULL if no such data exists.
3935
+ */
3936
+ get_data(key: string | null): any | null
3937
+ /**
3938
+ * `texture` a #CoglTexture.
3939
+ * Sets all the pixels for a given mipmap `level` by copying the pixel
3940
+ * data pointed to by the `data` argument into the given `texture`.
3941
+ *
3942
+ * `data` should point to the first pixel to copy corresponding
3943
+ * to the top left of the mipmap `level` being set.
3944
+ *
3945
+ * If `rowstride` equals 0 then it will be automatically calculated
3946
+ * from the width of the mipmap level and the bytes-per-pixel for the
3947
+ * given `format`.
3948
+ *
3949
+ * A mipmap `level` of 0 corresponds to the largest, base image of a
3950
+ * texture and `level` 1 is half the width and height of level 0. If
3951
+ * dividing any dimension of the previous level by two results in a
3952
+ * fraction then round the number down (floor()), but clamp to 1
3953
+ * something like this:
3954
+ *
3955
+ *
3956
+ * ```
3957
+ * next_width = MAX (1, floor (prev_width));
3958
+ * ```
3959
+ *
3960
+ *
3961
+ * You can determine the number of mipmap levels for a given texture
3962
+ * like this:
3963
+ *
3964
+ *
3965
+ * ```
3966
+ * n_levels = 1 + floor (log2 (max_dimension));
3967
+ * ```
3968
+ *
3969
+ *
3970
+ * Where %max_dimension is the larger of cogl_texture_get_width() and
3971
+ * cogl_texture_get_height().
3972
+ *
3973
+ * It is an error to pass a `level` number >= the number of levels that
3974
+ * `texture` can have according to the above calculation.
3975
+ *
3976
+ * <note>Since the storage for a #CoglTexture is allocated lazily then
3977
+ * if the given `texture` has not previously been allocated then this
3978
+ * api can return %FALSE and throw an exceptional `error` if there is
3979
+ * not enough memory to allocate storage for `texture`.</note>
3980
+ * @param format the #CoglPixelFormat used in the source `data` buffer.
3981
+ * @param rowstride rowstride of the source `data` buffer (computed from the texture width and `format` if it equals 0)
3982
+ * @param data the source data, pointing to the first top-left pixel to set
3983
+ * @param level The mipmap level to update (Normally 0 for the largest, base texture)
3984
+ * @returns %TRUE if the data upload was successful, and %FALSE otherwise
3985
+ */
3986
+ set_data(format: PixelFormat, rowstride: number, data: Uint8Array, level: number): boolean
3987
+
3988
+ // Overloads of set_data
3989
+
3990
+ /**
3991
+ * Each object carries around a table of associations from
3992
+ * strings to pointers. This function lets you set an association.
3993
+ *
3994
+ * If the object already had an association with that name,
3995
+ * the old association will be destroyed.
3996
+ *
3997
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
3998
+ * This means a copy of `key` is kept permanently (even after `object` has been
3999
+ * finalized) — so it is recommended to only use a small, bounded set of values
4000
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
4001
+ * @param key name of the key
4002
+ * @param data data to associate with that key
4003
+ */
4004
+ set_data(key: string | null, data: any | null): void
4005
+ /**
4006
+ * Each object carries around a table of associations from
4007
+ * strings to pointers. This function lets you set an association.
4008
+ *
4009
+ * If the object already had an association with that name,
4010
+ * the old association will be destroyed.
4011
+ *
4012
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
4013
+ * This means a copy of `key` is kept permanently (even after `object` has been
4014
+ * finalized) — so it is recommended to only use a small, bounded set of values
4015
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
4016
+ * @param key name of the key
4017
+ * @param data data to associate with that key
4018
+ */
4019
+ set_data(key: string | null, data: any | null): void
4020
+
4021
+ // Class property signals of Cogl-10.Cogl.Texture2DSliced
4022
+
4023
+ connect(sigName: string, callback: (...args: any[]) => void): number
4024
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
4025
+ emit(sigName: string, ...args: any[]): void
4026
+ disconnect(id: number): void
4027
+ }
4028
+
4029
+ export class Texture2DSliced extends Object {
4030
+
4031
+ // Own properties of Cogl-10.Cogl.Texture2DSliced
4032
+
4033
+ static name: string
4034
+ static $gtype: GObject.GType<Texture2DSliced>
4035
+
4036
+ // Constructors of Cogl-10.Cogl.Texture2DSliced
4037
+
4038
+ constructor(config?: Texture2DSliced.ConstructorProperties)
4039
+ /**
4040
+ * Creates a new #CoglTexture2DSliced texture based on data residing
4041
+ * in a bitmap.
4042
+ *
4043
+ * A #CoglTexture2DSliced may internally be comprised of 1 or more
4044
+ * #CoglTexture2D textures depending on GPU limitations. For example
4045
+ * if the GPU only supports power-of-two sized textures then a sliced
4046
+ * texture will turn a non-power-of-two size into a combination of
4047
+ * smaller power-of-two sized textures. If the requested texture size
4048
+ * is larger than is supported by the hardware then the texture will
4049
+ * be sliced into smaller textures that can be accessed by the
4050
+ * hardware.
4051
+ *
4052
+ * `max_waste` is used as a threshold for recursively slicing the
4053
+ * right-most or bottom-most slices into smaller sizes until the
4054
+ * wasted padding at the bottom and right of the textures is less than
4055
+ * specified. A negative `max_waste` will disable slicing.
4056
+ *
4057
+ * The storage for the texture is not allocated before this function
4058
+ * returns. You can call cogl_texture_allocate() to explicitly
4059
+ * allocate the underlying storage or let Cogl automatically allocate
4060
+ * storage lazily.
4061
+ *
4062
+ * <note>It's possible for the allocation of a sliced texture to fail
4063
+ * later due to impossible slicing constraints if a negative
4064
+ * `max_waste` value is given. If the given virtual texture size is
4065
+ * larger than is supported by the hardware but slicing is disabled
4066
+ * the texture size would be too large to handle.</note>
4067
+ * @constructor
4068
+ * @param bmp A #CoglBitmap
4069
+ * @param max_waste The threshold of how wide a strip of wasted texels are allowed along the right and bottom textures before they must be sliced to reduce the amount of waste. A negative can be passed to disable slicing.
4070
+ * @returns A newly created #CoglTexture2DSliced or %NULL on failure and @error will be updated.
4071
+ */
4072
+ static new_from_bitmap(bmp: Bitmap, max_waste: number): Texture2DSliced
4073
+
4074
+ // Overloads of new_from_bitmap
4075
+
4076
+ /**
4077
+ * Creates a #CoglTexture from a #CoglBitmap.
4078
+ * @param bitmap A #CoglBitmap pointer
4079
+ * @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
4080
+ * @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture
4081
+ * @returns A newly created #CoglTexture or %NULL on failure
4082
+ */
4083
+ static new_from_bitmap(bitmap: Bitmap, flags: TextureFlags, internal_format: PixelFormat): Texture
4084
+ _init(config?: Texture2DSliced.ConstructorProperties): void
4085
+ }
4086
+
4087
+ export interface Color {
4088
+
4089
+ // Owm methods of Cogl-10.Cogl.Color
4090
+
4091
+ /**
4092
+ * Creates a copy of `color`
4093
+ * @returns a newly-allocated #CoglColor. Use cogl_color_free() to free the allocate resources
4094
+ */
4095
+ copy(): Color
4096
+ /**
4097
+ * Frees the resources allocated by cogl_color_new() and cogl_color_copy()
4098
+ */
4099
+ free(): void
4100
+ /**
4101
+ * Retrieves the alpha channel of `color` as a fixed point
4102
+ * value between 0 and 1.0.
4103
+ * @returns the alpha channel of the passed color
4104
+ */
4105
+ get_alpha(): number
4106
+ /**
4107
+ * Retrieves the alpha channel of `color` as a byte value
4108
+ * between 0 and 255
4109
+ * @returns the alpha channel of the passed color
4110
+ */
4111
+ get_alpha_byte(): number
4112
+ /**
4113
+ * Retrieves the alpha channel of `color` as a floating point
4114
+ * value between 0.0 and 1.0
4115
+ * @returns the alpha channel of the passed color
4116
+ */
4117
+ get_alpha_float(): number
4118
+ /**
4119
+ * Retrieves the blue channel of `color` as a fixed point
4120
+ * value between 0 and 1.0.
4121
+ * @returns the blue channel of the passed color
4122
+ */
4123
+ get_blue(): number
4124
+ /**
4125
+ * Retrieves the blue channel of `color` as a byte value
4126
+ * between 0 and 255
4127
+ * @returns the blue channel of the passed color
4128
+ */
4129
+ get_blue_byte(): number
4130
+ /**
4131
+ * Retrieves the blue channel of `color` as a floating point
4132
+ * value between 0.0 and 1.0
4133
+ * @returns the blue channel of the passed color
4134
+ */
4135
+ get_blue_float(): number
4136
+ /**
4137
+ * Retrieves the green channel of `color` as a fixed point
4138
+ * value between 0 and 1.0.
4139
+ * @returns the green channel of the passed color
4140
+ */
4141
+ get_green(): number
4142
+ /**
4143
+ * Retrieves the green channel of `color` as a byte value
4144
+ * between 0 and 255
4145
+ * @returns the green channel of the passed color
4146
+ */
4147
+ get_green_byte(): number
4148
+ /**
4149
+ * Retrieves the green channel of `color` as a floating point
4150
+ * value between 0.0 and 1.0
4151
+ * @returns the green channel of the passed color
4152
+ */
4153
+ get_green_float(): number
4154
+ /**
4155
+ * Retrieves the red channel of `color` as a fixed point
4156
+ * value between 0 and 1.0.
4157
+ * @returns the red channel of the passed color
4158
+ */
4159
+ get_red(): number
4160
+ /**
4161
+ * Retrieves the red channel of `color` as a byte value
4162
+ * between 0 and 255
4163
+ * @returns the red channel of the passed color
4164
+ */
4165
+ get_red_byte(): number
4166
+ /**
4167
+ * Retrieves the red channel of `color` as a floating point
4168
+ * value between 0.0 and 1.0
4169
+ * @returns the red channel of the passed color
4170
+ */
4171
+ get_red_float(): number
4172
+ /**
4173
+ * Sets the values of the passed channels into a #CoglColor
4174
+ * @param red value of the red channel, between 0 and 1.0
4175
+ * @param green value of the green channel, between 0 and 1.0
4176
+ * @param blue value of the blue channel, between 0 and 1.0
4177
+ * @param alpha value of the alpha channel, between 0 and 1.0
4178
+ */
4179
+ init_from_4f(red: number, green: number, blue: number, alpha: number): void
4180
+ /**
4181
+ * Sets the values of the passed channels into a #CoglColor
4182
+ * @param color_array a pointer to an array of 4 float color components
4183
+ */
4184
+ init_from_4fv(color_array: number): void
4185
+ /**
4186
+ * Sets the values of the passed channels into a #CoglColor.
4187
+ * @param red value of the red channel, between 0 and 255
4188
+ * @param green value of the green channel, between 0 and 255
4189
+ * @param blue value of the blue channel, between 0 and 255
4190
+ * @param alpha value of the alpha channel, between 0 and 255
4191
+ */
4192
+ init_from_4ub(red: number, green: number, blue: number, alpha: number): void
4193
+ /**
4194
+ * Converts a non-premultiplied color to a pre-multiplied color. For
4195
+ * example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied
4196
+ * and (0.5, 0, 0, 0.5) when premultiplied.
4197
+ */
4198
+ premultiply(): void
4199
+ /**
4200
+ * Sets the alpha channel of `color` to `alpha`.
4201
+ * @param alpha a float value between 0.0f and 1.0f
4202
+ */
4203
+ set_alpha(alpha: number): void
4204
+ /**
4205
+ * Sets the alpha channel of `color` to `alpha`.
4206
+ * @param alpha a byte value between 0 and 255
4207
+ */
4208
+ set_alpha_byte(alpha: number): void
4209
+ /**
4210
+ * Sets the alpha channel of `color` to `alpha`.
4211
+ * @param alpha a float value between 0.0f and 1.0f
4212
+ */
4213
+ set_alpha_float(alpha: number): void
4214
+ /**
4215
+ * Sets the blue channel of `color` to `blue`.
4216
+ * @param blue a float value between 0.0f and 1.0f
4217
+ */
4218
+ set_blue(blue: number): void
4219
+ /**
4220
+ * Sets the blue channel of `color` to `blue`.
4221
+ * @param blue a byte value between 0 and 255
4222
+ */
4223
+ set_blue_byte(blue: number): void
4224
+ /**
4225
+ * Sets the blue channel of `color` to `blue`.
4226
+ * @param blue a float value between 0.0f and 1.0f
4227
+ */
4228
+ set_blue_float(blue: number): void
4229
+ /**
4230
+ * Sets the green channel of `color` to `green`.
4231
+ * @param green a float value between 0.0f and 1.0f
4232
+ */
4233
+ set_green(green: number): void
4234
+ /**
4235
+ * Sets the green channel of `color` to `green`.
4236
+ * @param green a byte value between 0 and 255
4237
+ */
4238
+ set_green_byte(green: number): void
4239
+ /**
4240
+ * Sets the green channel of `color` to `green`.
4241
+ * @param green a float value between 0.0f and 1.0f
4242
+ */
4243
+ set_green_float(green: number): void
4244
+ /**
4245
+ * Sets the red channel of `color` to `red`.
4246
+ * @param red a float value between 0.0f and 1.0f
4247
+ */
4248
+ set_red(red: number): void
4249
+ /**
4250
+ * Sets the red channel of `color` to `red`.
4251
+ * @param red a byte value between 0 and 255
4252
+ */
4253
+ set_red_byte(red: number): void
4254
+ /**
4255
+ * Sets the red channel of `color` to `red`.
4256
+ * @param red a float value between 0.0f and 1.0f
4257
+ */
4258
+ set_red_float(red: number): void
4259
+ /**
4260
+ * Converts `color` to the HLS format.
4261
+ *
4262
+ * The `hue` value is in the 0 .. 360 range. The `luminance` and
4263
+ * `saturation` values are in the 0 .. 1 range.
4264
+ */
4265
+ to_hsl(): [ /* hue */ number, /* saturation */ number, /* luminance */ number ]
4266
+ /**
4267
+ * Converts a pre-multiplied color to a non-premultiplied color. For
4268
+ * example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied
4269
+ * and (1.0, 0, 0, 0.5) when non-premultiplied.
4270
+ */
4271
+ unpremultiply(): void
4272
+ }
4273
+
4274
+ /**
4275
+ * A structure for holding a color definition. The contents of
4276
+ * the CoglColor structure are private and should never by accessed
4277
+ * directly.
4278
+ * @record
4279
+ */
4280
+ export class Color {
4281
+
4282
+ // Own properties of Cogl-10.Cogl.Color
4283
+
4284
+ static name: string
4285
+
4286
+ // Constructors of Cogl-10.Cogl.Color
4287
+
4288
+ /**
4289
+ * Creates a new (empty) color
4290
+ * @constructor
4291
+ * @returns a newly-allocated #CoglColor. Use cogl_color_free() to free the allocated resources
4292
+ */
4293
+ constructor()
4294
+ /**
4295
+ * Creates a new (empty) color
4296
+ * @constructor
4297
+ * @returns a newly-allocated #CoglColor. Use cogl_color_free() to free the allocated resources
4298
+ */
4299
+ static new(): Color
4300
+ /**
4301
+ * Compares two #CoglColor<!-- -->s and checks if they are the same.
4302
+ *
4303
+ * This function can be passed to g_hash_table_new() as the `key_equal_func`
4304
+ * parameter, when using #CoglColor<!-- -->s as keys in a #GHashTable.
4305
+ * @param v1 a #CoglColor
4306
+ * @param v2 a #CoglColor
4307
+ * @returns %TRUE if the two colors are the same.
4308
+ */
4309
+ static equal(v1: any | null, v2: any | null): boolean
4310
+ /**
4311
+ * Converts a color expressed in HLS (hue, luminance and saturation)
4312
+ * values into a #CoglColor.
4313
+ * @param hue hue value, in the 0 .. 360 range
4314
+ * @param saturation saturation value, in the 0 .. 1 range
4315
+ * @param luminance luminance value, in the 0 .. 1 range
4316
+ */
4317
+ static init_from_hsl(hue: number, saturation: number, luminance: number): /* color */ Color
4318
+ }
4319
+
4320
+ export interface DebugObjectTypeInfo {
4321
+
4322
+ // Own fields of Cogl-10.Cogl.DebugObjectTypeInfo
4323
+
4324
+ /**
4325
+ * A human readable name for the type.
4326
+ * @field
4327
+ */
4328
+ name: string | null
4329
+ /**
4330
+ * The number of objects of this type that are
4331
+ * currently in use
4332
+ * @field
4333
+ */
4334
+ instance_count: number
4335
+ }
4336
+
4337
+ /**
4338
+ * This struct is used to pass information to the callback when
4339
+ * cogl_debug_object_foreach_type() is called.
4340
+ * @record
4341
+ */
4342
+ export class DebugObjectTypeInfo {
4343
+
4344
+ // Own properties of Cogl-10.Cogl.DebugObjectTypeInfo
4345
+
4346
+ static name: string
4347
+ }
4348
+
4349
+ export interface DmaBufHandle {
4350
+ }
4351
+
4352
+ /**
4353
+ * An opaque type that tracks the lifetime of a DMA buffer fd. Release
4354
+ * with cogl_dma_buf_handle_free().
4355
+ * @record
4356
+ */
4357
+ export class DmaBufHandle {
4358
+
4359
+ // Own properties of Cogl-10.Cogl.DmaBufHandle
4360
+
4361
+ static name: string
4362
+ }
4363
+
4364
+ export interface FrameClosure {
4365
+ }
4366
+
4367
+ /**
4368
+ * An opaque type that tracks a #CoglFrameCallback and associated user
4369
+ * data. A #CoglFrameClosure pointer will be returned from
4370
+ * cogl_onscreen_add_frame_callback() and it allows you to remove a
4371
+ * callback later using cogl_onscreen_remove_frame_callback().
4372
+ * @record
4373
+ */
4374
+ export class FrameClosure {
4375
+
4376
+ // Own properties of Cogl-10.Cogl.FrameClosure
4377
+
4378
+ static name: string
4379
+ }
4380
+
4381
+ export interface FramebufferClass {
4382
+
4383
+ // Own fields of Cogl-10.Cogl.FramebufferClass
4384
+
4385
+ allocate: (framebuffer: Framebuffer) => boolean
4386
+ is_y_flipped: (framebuffer: Framebuffer) => boolean
4387
+ }
4388
+
4389
+ export abstract class FramebufferClass {
4390
+
4391
+ // Own properties of Cogl-10.Cogl.FramebufferClass
4392
+
4393
+ static name: string
4394
+ }
4395
+
4396
+ export interface FramebufferDriverConfig {
4397
+ }
4398
+
4399
+ export class FramebufferDriverConfig {
4400
+
4401
+ // Own properties of Cogl-10.Cogl.FramebufferDriverConfig
4402
+
4403
+ static name: string
4404
+ }
4405
+
4406
+ export interface OffscreenClass {
4407
+
4408
+ // Own fields of Cogl-10.Cogl.OffscreenClass
4409
+
4410
+ parent_class: FramebufferClass
4411
+ }
4412
+
4413
+ export abstract class OffscreenClass {
4414
+
4415
+ // Own properties of Cogl-10.Cogl.OffscreenClass
4416
+
4417
+ static name: string
4418
+ }
4419
+
4420
+ export interface OnscreenClass {
4421
+
4422
+ // Own fields of Cogl-10.Cogl.OnscreenClass
4423
+
4424
+ bind: (onscreen: Onscreen) => void
4425
+ swap_buffers_with_damage: (onscreen: Onscreen, rectangles: number, n_rectangles: number, info: FrameInfo) => void
4426
+ swap_region: (onscreen: Onscreen, rectangles: number, n_rectangles: number, info: FrameInfo) => void
4427
+ queue_damage_region: (onscreen: Onscreen, rectangles: number, n_rectangles: number) => void
4428
+ direct_scanout: (onscreen: Onscreen, scanout: Scanout, info: FrameInfo) => boolean
4429
+ get_buffer_age: (onscreen: Onscreen) => number
4430
+ }
4431
+
4432
+ export abstract class OnscreenClass {
4433
+
4434
+ // Own properties of Cogl-10.Cogl.OnscreenClass
4435
+
4436
+ static name: string
4437
+ }
4438
+
4439
+ export interface OnscreenDirtyClosure {
4440
+ }
4441
+
4442
+ /**
4443
+ * An opaque type that tracks a #CoglOnscreenDirtyCallback and associated
4444
+ * user data. A #CoglOnscreenDirtyClosure pointer will be returned from
4445
+ * cogl_onscreen_add_dirty_callback() and it allows you to remove a
4446
+ * callback later using cogl_onscreen_remove_dirty_callback().
4447
+ * @record
4448
+ */
4449
+ export class OnscreenDirtyClosure {
4450
+
4451
+ // Own properties of Cogl-10.Cogl.OnscreenDirtyClosure
4452
+
4453
+ static name: string
4454
+ }
4455
+
4456
+ export interface OnscreenDirtyInfo {
4457
+
4458
+ // Own fields of Cogl-10.Cogl.OnscreenDirtyInfo
4459
+
4460
+ /**
4461
+ * Left edge of the dirty rectangle
4462
+ * @field
4463
+ */
4464
+ x: number
4465
+ /**
4466
+ * Top edge of the dirty rectangle, measured from the top of the window
4467
+ * @field
4468
+ */
4469
+ y: number
4470
+ /**
4471
+ * Width of the dirty rectangle
4472
+ * @field
4473
+ */
4474
+ width: number
4475
+ /**
4476
+ * Height of the dirty rectangle
4477
+ * @field
4478
+ */
4479
+ height: number
4480
+ }
4481
+
4482
+ /**
4483
+ * A structure passed to callbacks registered using
4484
+ * cogl_onscreen_add_dirty_callback(). The members describe a
4485
+ * rectangle within the onscreen buffer that should be redrawn.
4486
+ * @record
4487
+ */
4488
+ export class OnscreenDirtyInfo {
4489
+
4490
+ // Own properties of Cogl-10.Cogl.OnscreenDirtyInfo
4491
+
4492
+ static name: string
4493
+ }
4494
+
4495
+ export interface Scanout {
4496
+ }
4497
+
4498
+ export class Scanout {
4499
+
4500
+ // Own properties of Cogl-10.Cogl.Scanout
4501
+
4502
+ static name: string
4503
+
4504
+ // Constructors of Cogl-10.Cogl.Scanout
4505
+
4506
+ static error_quark(): GLib.Quark
4507
+ }
4508
+
4509
+ export interface TextureVertex {
4510
+
4511
+ // Own fields of Cogl-10.Cogl.TextureVertex
4512
+
4513
+ /**
4514
+ * Model x-coordinate
4515
+ * @field
4516
+ */
4517
+ x: number
4518
+ /**
4519
+ * Model y-coordinate
4520
+ * @field
4521
+ */
4522
+ y: number
4523
+ /**
4524
+ * Model z-coordinate
4525
+ * @field
4526
+ */
4527
+ z: number
4528
+ /**
4529
+ * Texture x-coordinate
4530
+ * @field
4531
+ */
4532
+ tx: number
4533
+ /**
4534
+ * Texture y-coordinate
4535
+ * @field
4536
+ */
4537
+ ty: number
4538
+ /**
4539
+ * The color to use at this vertex. This is ignored if
4540
+ * use_color is %FALSE when calling cogl_polygon()
4541
+ * @field
4542
+ */
4543
+ color: Color
4544
+ }
4545
+
4546
+ /**
4547
+ * Used to specify vertex information when calling cogl_polygon()
4548
+ * @record
4549
+ */
4550
+ export class TextureVertex {
4551
+
4552
+ // Own properties of Cogl-10.Cogl.TextureVertex
4553
+
4554
+ static name: string
4555
+ }
4556
+
4557
+ export interface TimestampQuery {
4558
+ }
4559
+
4560
+ export class TimestampQuery {
4561
+
4562
+ // Own properties of Cogl-10.Cogl.TimestampQuery
4563
+
4564
+ static name: string
4565
+ }
4566
+
4567
+ export interface TraceContext {
4568
+ }
4569
+
4570
+ export class TraceContext {
4571
+
4572
+ // Own properties of Cogl-10.Cogl.TraceContext
4573
+
4574
+ static name: string
4575
+ }
4576
+
4577
+ export interface TraceHead {
4578
+
4579
+ // Own fields of Cogl-10.Cogl.TraceHead
4580
+
4581
+ begin_time: number
4582
+ name: string | null
4583
+ description: string | null
4584
+ }
4585
+
4586
+ export class TraceHead {
4587
+
4588
+ // Own properties of Cogl-10.Cogl.TraceHead
4589
+
4590
+ static name: string
4591
+ }
4592
+
4593
+ export interface UserDataKey {
4594
+
4595
+ // Own fields of Cogl-10.Cogl.UserDataKey
4596
+
4597
+ /**
4598
+ * ignored.
4599
+ * @field
4600
+ */
4601
+ unused: number
4602
+ }
4603
+
4604
+ /**
4605
+ * A #CoglUserDataKey is used to declare a key for attaching data to a
4606
+ * #CoglObject using cogl_object_set_user_data. The typedef only exists as a
4607
+ * formality to make code self documenting since only the unique address of a
4608
+ * #CoglUserDataKey is used.
4609
+ *
4610
+ * Typically you would declare a static #CoglUserDataKey and set private data
4611
+ * on an object something like this:
4612
+ *
4613
+ *
4614
+ * ```
4615
+ * static CoglUserDataKey path_private_key;
4616
+ *
4617
+ * static void
4618
+ * destroy_path_private_cb (void *data)
4619
+ * {
4620
+ * g_free (data);
4621
+ * }
4622
+ *
4623
+ * static void
4624
+ * my_path_set_data (CoglPipeline *pipeline, void *data)
4625
+ * {
4626
+ * cogl_object_set_user_data (COGL_OBJECT (pipeline),
4627
+ * &private_key,
4628
+ * data,
4629
+ * destroy_pipeline_private_cb);
4630
+ * }
4631
+ * ```
4632
+ *
4633
+ * @record
4634
+ */
4635
+ export class UserDataKey {
4636
+
4637
+ // Own properties of Cogl-10.Cogl.UserDataKey
4638
+
4639
+ static name: string
4640
+ }
4641
+
4642
+ export interface _ColorSizeCheck {
4643
+
4644
+ // Own fields of Cogl-10.Cogl._ColorSizeCheck
4645
+
4646
+ compile_time_assert_CoglColor_size: number[]
4647
+ }
4648
+
4649
+ export class _ColorSizeCheck {
4650
+
4651
+ // Own properties of Cogl-10.Cogl._ColorSizeCheck
4652
+
4653
+ static name: string
4654
+ }
4655
+
4656
+ export interface _TextureVertexSizeCheck {
4657
+
4658
+ // Own fields of Cogl-10.Cogl._TextureVertexSizeCheck
4659
+
4660
+ compile_time_assert_CoglTextureVertex_size: number[]
4661
+ }
4662
+
4663
+ export class _TextureVertexSizeCheck {
4664
+
4665
+ // Own properties of Cogl-10.Cogl._TextureVertexSizeCheck
4666
+
4667
+ static name: string
4668
+ }
4669
+
4670
+ export type Angle = number
4671
+ export type Handle = any
4672
+ export type PipelineKey = string
4673
+ export type UserDataDestroyCallback = GLib.DestroyNotify
4674
+ /**
4675
+ * Name of the imported GIR library
4676
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
4677
+ */
4678
+ export const __name__: string
4679
+ /**
4680
+ * Version of the imported GIR library
4681
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
4682
+ */
4683
+ export const __version__: string
4684
+ // END