forked from Gr3q/types-gjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCogl-1.0.d.ts
4295 lines (4062 loc) · 148 KB
/
Cogl-1.0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** Generated with https://github.com/Gr3q/GIR2TS - If possible do not modify. */
declare namespace imports.gi.Cogl {
/** This construct is only for enabling class multi-inheritance,
* use {@link Bitmap} instead.
*/
interface IBitmap {
}
type BitmapInitOptionsMixin = {};
export interface BitmapInitOptions extends BitmapInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Bitmap} instead.
*/
type BitmapMixin = IBitmap;
interface Bitmap extends BitmapMixin {}
class Bitmap {
public constructor(options?: Partial<BitmapInitOptions>);
/**
* Loads an image file from disk. This function can be safely called from
* within a thread.
* @param filename the file to load.
* @returns a {@link Bitmap} to the new loaded
* image data, or %NULL if loading the image failed.
*/
public static new_from_file(filename: string): Bitmap;
/**
* Parses an image file enough to extract the width and height
* of the bitmap.
* @param filename the file to check
* @returns %TRUE if the image was successfully parsed
*
* return location for the bitmap width, or %NULL
*
* return location for the bitmap height, or %NULL
*/
public static get_size_from_file(filename: string): [ Bool, number, number ];
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Fixed} instead.
*/
interface IFixed {
/**
* Computes the arc tangent of #a.
* @returns the arc tangent of the passed value, in fixed point notation
*/
atan(): Fixed;
/**
* Computes the arc tangent of #a / #b but uses the sign of both
* arguments to return the angle in right quadrant.
* @param b the denominator as a {@link Fixed} number
* @returns the arc tangent of the passed fraction, in fixed point
* notation
*/
atan2(b: Fixed): Fixed;
/**
* Computes the cosine of #angle.
* @returns the cosine of the passed angle, in fixed point notation
*/
cos(): Fixed;
/**
* Calculates 2 to the #x power.
*
* This function is around 11 times faster on x86, and around 22 times faster
* on fpu-less arm than libc pow(2, x).
* @returns the power of 2 to the passed value
*/
pow2(): number;
/**
* Computes the sine of #angle.
* @returns the sine of the passed angle, in fixed point notation
*/
sin(): Fixed;
/**
* Computes the square root of #x.
* @returns the square root of the passed value, in floating point
* notation
*/
sqrt(): Fixed;
/**
* Computes the tangent of #angle.
* @returns the tangent of the passed angle, in fixed point notation
*/
tan(): Fixed;
}
type FixedInitOptionsMixin = {};
export interface FixedInitOptions extends FixedInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Fixed} instead.
*/
type FixedMixin = IFixed;
/**
* Fixed point number using a (16.16) notation.
*/
interface Fixed extends FixedMixin {}
class Fixed {
public constructor(options?: Partial<FixedInitOptions>);
/**
* Calculates base 2 logarithm.
*
* This function is some 2.5 times faster on x86, and over 12 times faster on
* fpu-less arm, than using libc log().
* @param x value to calculate base 2 logarithm from
* @returns base 2 logarithm.
*/
public static log2(x: number): Fixed;
/**
* Calculates #x to the #y power.
* @param x base
* @param y {@link Fixed} exponent
* @returns the power of #x to the #y
*/
public static pow(x: number, y: Fixed): number;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Offscreen} instead.
*/
interface IOffscreen {
}
type OffscreenInitOptionsMixin = {};
export interface OffscreenInitOptions extends OffscreenInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Offscreen} instead.
*/
type OffscreenMixin = IOffscreen;
interface Offscreen extends OffscreenMixin {}
class Offscreen {
public constructor(options?: Partial<OffscreenInitOptions>);
/**
* @deprecated
* Use cogl_offscreen_new_with_texture instead.
*
* This creates an offscreen buffer object using the given #texture as the
* primary color buffer. It doesn't just initialize the contents of the
* offscreen buffer with the #texture; they are tightly bound so that
* drawing to the offscreen buffer effectivly updates the contents of the
* given texture. You don't need to destroy the offscreen buffer before
* you can use the #texture again.
*
* <note>This only works with low-level {@link Texture} types such as
* #CoglTexture2D, #CoglTexture3D and #CoglTextureRectangle, and not
* with meta-texture types such as #CoglTexture2DSliced.</note>
* @param texture A {@link Texture} pointer
* @returns a newly instantiated {@link Offscreen}
* framebuffer or %NULL if it wasn't possible to create the
* buffer.
*/
public static new_to_texture(texture: Texture): Offscreen;
/**
* This creates an offscreen framebuffer object using the given
* #texture as the primary color buffer. It doesn't just initialize
* the contents of the offscreen buffer with the #texture; they are
* tightly bound so that drawing to the offscreen buffer effectively
* updates the contents of the given texture. You don't need to
* destroy the offscreen buffer before you can use the #texture again.
*
* <note>This api only works with low-level {@link Texture} types such as
* #CoglTexture2D, #CoglTexture3D and #CoglTextureRectangle, and not
* with meta-texture types such as #CoglTexture2DSliced.</note>
*
* The storage for the framebuffer is actually allocated lazily
* so this function will never return %NULL to indicate a runtime
* error. This means it is still possible to configure the framebuffer
* before it is really allocated.
*
* Simple applications without full error handling can simply rely on
* Cogl to lazily allocate the storage of framebuffers but you should
* be aware that if Cogl encounters an error (such as running out of
* GPU memory) then your application will simply abort with an error
* message. If you need to be able to catch such exceptions at runtime
* then you can explicitly allocate your framebuffer when you have
* finished configuring it by calling {@link Cogl.framebuffer_allocate} and
* passing in a #CoglError argument to catch any exceptions.
* @param texture A {@link Texture} pointer
* @returns a newly instantiated {@link Offscreen}
* framebuffer.
*/
public static new_with_texture(texture: Texture): Offscreen;
/**
* @deprecated
* {@link Cogl.object_ref} should be used in new code.
*
* Increments the reference count on the #offscreen framebuffer.
* @param offscreen A pointer to a {@link Offscreen} framebuffer
* @returns For convenience it returns the
* given #offscreen
*/
public static ref(offscreen: any | null): any | null;
/**
* @deprecated
* {@link Cogl.object_unref} should be used in new code.
*
* Decreases the reference count for the #offscreen buffer and frees it when
* the count reaches 0.
* @param offscreen A pointer to a {@link Offscreen} framebuffer
*/
public static unref(offscreen: any | null): void;
}
export interface ColorInitOptions {}
/**
* A structure for holding a color definition. The contents of
* the CoglColor structure are private and should never by accessed
* directly.
*/
interface Color {}
class Color {
public constructor(options?: Partial<ColorInitOptions>);
/**
* Creates a new (empty) color
* @returns a newly-allocated {@link Color}. Use {@link Cogl.Color.free}
* to free the allocated resources
*/
public static new(): Color;
public readonly private_member_red: number;
public readonly private_member_green: number;
public readonly private_member_blue: number;
public readonly private_member_alpha: number;
public readonly private_member_padding0: number;
public readonly private_member_padding1: number;
public readonly private_member_padding2: number;
/**
* Creates a copy of #color
* @returns a newly-allocated {@link Color}. Use {@link Cogl.Color.free}
* to free the allocate resources
*/
public copy(): Color;
/**
* Frees the resources allocated by {@link Cogl.Color.new} and cogl_color_copy()
*/
public free(): void;
/**
* Retrieves the alpha channel of #color as a fixed point
* value between 0 and 1.0.
* @returns the alpha channel of the passed color
*/
public get_alpha(): number;
/**
* Retrieves the alpha channel of #color as a byte value
* between 0 and 255
* @returns the alpha channel of the passed color
*/
public get_alpha_byte(): number;
/**
* Retrieves the alpha channel of #color as a floating point
* value between 0.0 and 1.0
* @returns the alpha channel of the passed color
*/
public get_alpha_float(): number;
/**
* Retrieves the blue channel of #color as a fixed point
* value between 0 and 1.0.
* @returns the blue channel of the passed color
*/
public get_blue(): number;
/**
* Retrieves the blue channel of #color as a byte value
* between 0 and 255
* @returns the blue channel of the passed color
*/
public get_blue_byte(): number;
/**
* Retrieves the blue channel of #color as a floating point
* value between 0.0 and 1.0
* @returns the blue channel of the passed color
*/
public get_blue_float(): number;
/**
* Retrieves the green channel of #color as a fixed point
* value between 0 and 1.0.
* @returns the green channel of the passed color
*/
public get_green(): number;
/**
* Retrieves the green channel of #color as a byte value
* between 0 and 255
* @returns the green channel of the passed color
*/
public get_green_byte(): number;
/**
* Retrieves the green channel of #color as a floating point
* value between 0.0 and 1.0
* @returns the green channel of the passed color
*/
public get_green_float(): number;
/**
* Retrieves the red channel of #color as a fixed point
* value between 0 and 1.0.
* @returns the red channel of the passed color
*/
public get_red(): number;
/**
* Retrieves the red channel of #color as a byte value
* between 0 and 255
* @returns the red channel of the passed color
*/
public get_red_byte(): number;
/**
* Retrieves the red channel of #color as a floating point
* value between 0.0 and 1.0
* @returns the red channel of the passed color
*/
public get_red_float(): number;
/**
* Sets the values of the passed channels into a {@link Color}
* @param red value of the red channel, between 0 and 1.0
* @param green value of the green channel, between 0 and 1.0
* @param blue value of the blue channel, between 0 and 1.0
* @param alpha value of the alpha channel, between 0 and 1.0
*/
public init_from_4f(red: number, green: number, blue: number, alpha: number): void;
/**
* Sets the values of the passed channels into a {@link Color}
* @param color_array a pointer to an array of 4 float color components
*/
public init_from_4fv(color_array: number): void;
/**
* Sets the values of the passed channels into a {@link Color}.
* @param red value of the red channel, between 0 and 255
* @param green value of the green channel, between 0 and 255
* @param blue value of the blue channel, between 0 and 255
* @param alpha value of the alpha channel, between 0 and 255
*/
public init_from_4ub(red: number, green: number, blue: number, alpha: number): void;
/**
* Converts a non-premultiplied color to a pre-multiplied color. For
* example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied
* and (0.5, 0, 0, 0.5) when premultiplied.
*/
public premultiply(): void;
/**
* Sets the alpha channel of #color to #alpha.
* @param alpha a float value between 0.0f and 1.0f
*/
public set_alpha(alpha: number): void;
/**
* Sets the alpha channel of #color to #alpha.
* @param alpha a byte value between 0 and 255
*/
public set_alpha_byte(alpha: number): void;
/**
* Sets the alpha channel of #color to #alpha.
* @param alpha a float value between 0.0f and 1.0f
*/
public set_alpha_float(alpha: number): void;
/**
* Sets the blue channel of #color to #blue.
* @param blue a float value between 0.0f and 1.0f
*/
public set_blue(blue: number): void;
/**
* Sets the blue channel of #color to #blue.
* @param blue a byte value between 0 and 255
*/
public set_blue_byte(blue: number): void;
/**
* Sets the blue channel of #color to #blue.
* @param blue a float value between 0.0f and 1.0f
*/
public set_blue_float(blue: number): void;
/**
* @deprecated
* Use cogl_color_init_from_4f instead.
*
* Sets the values of the passed channels into a {@link Color}
* @param red value of the red channel, between 0 and %1.0
* @param green value of the green channel, between 0 and %1.0
* @param blue value of the blue channel, between 0 and %1.0
* @param alpha value of the alpha channel, between 0 and %1.0
*/
public set_from_4f(red: number, green: number, blue: number, alpha: number): void;
/**
* @deprecated
* Use cogl_color_init_from_4ub instead.
*
* Sets the values of the passed channels into a {@link Color}.
* @param red value of the red channel, between 0 and 255
* @param green value of the green channel, between 0 and 255
* @param blue value of the blue channel, between 0 and 255
* @param alpha value of the alpha channel, between 0 and 255
*/
public set_from_4ub(red: number, green: number, blue: number, alpha: number): void;
/**
* Sets the green channel of #color to #green.
* @param green a float value between 0.0f and 1.0f
*/
public set_green(green: number): void;
/**
* Sets the green channel of #color to #green.
* @param green a byte value between 0 and 255
*/
public set_green_byte(green: number): void;
/**
* Sets the green channel of #color to #green.
* @param green a float value between 0.0f and 1.0f
*/
public set_green_float(green: number): void;
/**
* Sets the red channel of #color to #red.
* @param red a float value between 0.0f and 1.0f
*/
public set_red(red: number): void;
/**
* Sets the red channel of #color to #red.
* @param red a byte value between 0 and 255
*/
public set_red_byte(red: number): void;
/**
* Sets the red channel of #color to #red.
* @param red a float value between 0.0f and 1.0f
*/
public set_red_float(red: number): void;
/**
* Converts #color to the HLS format.
*
* The #hue value is in the 0 .. 360 range. The #luminance and
* #saturation values are in the 0 .. 1 range.
* @returns return location for the hue value or %NULL
*
* return location for the saturation value or %NULL
*
* return location for the luminance value or %NULL
*/
public to_hsl(): [ hue: number, saturation: number, luminance: number ];
/**
* Converts a pre-multiplied color to a non-premultiplied color. For
* example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied
* and (1.0, 0, 0, 0.5) when non-premultiplied.
*/
public unpremultiply(): void;
}
export interface EulerInitOptions {}
interface Euler {}
class Euler {
public constructor(options?: Partial<EulerInitOptions>);
}
export interface MaterialInitOptions {}
interface Material {}
class Material {
public constructor(options?: Partial<MaterialInitOptions>);
/**
* @deprecated
* Use {@link Cogl.pipeline_copy} instead
*
* Creates a new material with the configuration copied from the
* source material.
*
* We would strongly advise developers to always aim to use
* {@link Cogl.Material.copy} instead of cogl_material_new() whenever there will
* be any similarity between two materials. Copying a material helps Cogl
* keep track of a materials ancestry which we may use to help minimize GPU
* state changes.
* @returns a pointer to the newly allocated {@link Material}
*/
public copy(): Material;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Retrieves the current ambient color for #material
* @param ambient The location to store the ambient color
*/
public get_ambient(ambient: Color): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_get_color} instead
*
* Retrieves the current material color.
* @returns The location to store the color
*/
public get_color(): Color;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Retrieves the current diffuse color for #material
* @param diffuse The location to store the diffuse color
*/
public get_diffuse(diffuse: Color): void;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Retrieves the materials current emission color.
* @param emission The location to store the emission color
*/
public get_emission(emission: Color): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_get_layer_point_sprite_coords_enabled}
* instead
*
* Gets whether point sprite coordinate generation is enabled for this
* texture layer.
* @param layer_index the layer number to check.
* @returns whether the texture coordinates will be replaced with
* point sprite coordinates.
*/
public get_layer_point_sprite_coords_enabled(layer_index: number): Bool;
/**
* @deprecated
* Use {@link Cogl.pipeline_get_layer_wrap_mode_p} instead
*
* Returns the wrap mode for the 'p' coordinate of texture lookups on this
* layer.
* @param layer_index the layer number to change.
* @returns the wrap mode for the 'p' coordinate of texture lookups on
* this layer.
*/
public get_layer_wrap_mode_p(layer_index: number): MaterialWrapMode;
/**
* @deprecated
* Use {@link Cogl.pipeline_get_layer_wrap_mode_s} instead
*
* Returns the wrap mode for the 's' coordinate of texture lookups on this
* layer.
* @param layer_index the layer number to change.
* @returns the wrap mode for the 's' coordinate of texture lookups on
* this layer.
*/
public get_layer_wrap_mode_s(layer_index: number): MaterialWrapMode;
/**
* @deprecated
* Use {@link Cogl.pipeline_get_layer_wrap_mode_t} instead
*
* Returns the wrap mode for the 't' coordinate of texture lookups on this
* layer.
* @param layer_index the layer number to change.
* @returns the wrap mode for the 't' coordinate of texture lookups on
* this layer.
*/
public get_layer_wrap_mode_t(layer_index: number): MaterialWrapMode;
/**
* This function lets you access a material's internal list of layers
* for iteration.
*
* <note>You should avoid using this API if possible since it was only
* made public by mistake and will be deprecated when we have
* suitable alternative.</note>
*
* <note>It's important to understand that the list returned may not
* remain valid if you modify the material or any of the layers in any
* way and so you would have to re-get the list in that
* situation.</note>
* @returns A
* list of {@link MaterialLayer}<!-- -->'s that can be passed to the
* cogl_material_layer_* functions. The list is owned by Cogl and it
* should not be modified or freed
* Deprecated: 1.16: Use {@link Cogl.pipeline_get_layers} instead
*/
public get_layers(): GLib.List;
/**
* @deprecated
* Use {@link Cogl.pipeline_get_n_layers} instead
*
* Retrieves the number of layers defined for the given #material
* @returns the number of layers
*/
public get_n_layers(): number;
/**
* @deprecated
* Use {@link Cogl.pipeline_get_point_size} instead
*
* Get the size of points drawn when %COGL_VERTICES_MODE_POINTS is
* used with the vertex buffer API.
* @returns the point size of the material.
*/
public get_point_size(): number;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Retrieves the materials current emission color.
* @returns The materials current shininess value
*/
public get_shininess(): number;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Retrieves the materials current specular color.
* @param specular The location to store the specular color
*/
public get_specular(specular: Color): void;
/**
* @deprecated
* Use {@link Snippet} api instead instead
*
* Queries what user program has been associated with the given
* #material using {@link Cogl.Material.set_user_program}.
* @returns The current user program
* or %COGL_INVALID_HANDLE.
*/
public get_user_program(): Handle;
/**
* @deprecated
* Use {@link Cogl.pipeline_remove_layer} instead
*
* This function removes a layer from your material
* @param layer_index Specifies the layer you want to remove
*/
public remove_layer(layer_index: number): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_alpha_test_function} instead
*
* Before a primitive is blended with the framebuffer, it goes through an
* alpha test stage which lets you discard fragments based on the current
* alpha value. This function lets you change the function used to evaluate
* the alpha channel, and thus determine which fragments are discarded
* and which continue on to the blending stage.
*
* The default is %COGL_MATERIAL_ALPHA_FUNC_ALWAYS
* @param alpha_func A {@link MaterialAlphaFunc} constant
* @param alpha_reference A reference point that the chosen alpha function uses
* to compare incoming fragments to.
*/
public set_alpha_test_function(alpha_func: MaterialAlphaFunc, alpha_reference: number): void;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Sets the material's ambient color, in the standard OpenGL lighting
* model. The ambient color affects the overall color of the object.
*
* Since the diffuse color will be intense when the light hits the surface
* directly, the ambient will be most apparent where the light hits at a
* slant.
*
* The default value is (0.2, 0.2, 0.2, 1.0)
* @param ambient The components of the desired ambient color
*/
public set_ambient(ambient: Color): void;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Conveniently sets the diffuse and ambient color of #material at the same
* time. See {@link Cogl.Material.set_ambient} and cogl_material_set_diffuse().
*
* The default ambient color is (0.2, 0.2, 0.2, 1.0)
*
* The default diffuse color is (0.8, 0.8, 0.8, 1.0)
* @param color The components of the desired ambient and diffuse colors
*/
public set_ambient_and_diffuse(color: Color): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_blend} instead
*
* If not already familiar; please refer <link linkend="cogl-Blend-Strings">here</link>
* for an overview of what blend strings are, and their syntax.
*
* Blending occurs after the alpha test function, and combines fragments with
* the framebuffer.
*
* Currently the only blend function Cogl exposes is ADD(). So any valid
* blend statements will be of the form:
*
* |[
* <channel-mask>=ADD(SRC_COLOR*(<factor>), DST_COLOR*(<factor>))
* ]|
*
* <warning>The brackets around blend factors are currently not
* optional!</warning>
*
* This is the list of source-names usable as blend factors:
* <itemizedlist>
* <listitem><para>SRC_COLOR: The color of the in comming fragment</para></listitem>
* <listitem><para>DST_COLOR: The color of the framebuffer</para></listitem>
* <listitem><para>CONSTANT: The constant set via cogl_material_set_blend_constant()</para></listitem>
* </itemizedlist>
*
* The source names can be used according to the
* <link linkend="cogl-Blend-String-syntax">color-source and factor syntax</link>,
* so for example "(1-SRC_COLOR[A])" would be a valid factor, as would
* "(CONSTANT[RGB])"
*
* These can also be used as factors:
* <itemizedlist>
* <listitem>0: (0, 0, 0, 0)</listitem>
* <listitem>1: (1, 1, 1, 1)</listitem>
* <listitem>SRC_ALPHA_SATURATE_FACTOR: (f,f,f,1) where f = MIN(SRC_COLOR[A],1-DST_COLOR[A])</listitem>
* </itemizedlist>
*
* <note>Remember; all color components are normalized to the range [0, 1]
* before computing the result of blending.</note>
*
* <example id="cogl-Blend-Strings-blend-unpremul">
* <title>Blend Strings/1</title>
* <para>Blend a non-premultiplied source over a destination with
* premultiplied alpha:</para>
* <programlisting>
* "RGB = ADD(SRC_COLOR*(SRC_COLOR[A]), DST_COLOR*(1-SRC_COLOR[A]))"
* "A = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
* </programlisting>
* </example>
*
* <example id="cogl-Blend-Strings-blend-premul">
* <title>Blend Strings/2</title>
* <para>Blend a premultiplied source over a destination with
* premultiplied alpha</para>
* <programlisting>
* "RGBA = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
* </programlisting>
* </example>
*
* The default blend string is:
* |[
* RGBA = ADD (SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))
* ]|
*
* That gives normal alpha-blending when the calculated color for the material
* is in premultiplied form.
* @param blend_string A <link linkend="cogl-Blend-Strings">Cogl blend string</link>
* describing the desired blend function.
* @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).
*/
public set_blend(blend_string: string): Bool;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_blend_constant} instead
*
* When blending is setup to reference a CONSTANT blend factor then
* blending will depend on the constant set with this function.
* @param constant_color The constant color you want
*/
public set_blend_constant(constant_color: Color): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_color} instead
*
* Sets the basic color of the material, used when no lighting is enabled.
*
* Note that if you don't add any layers to the material then the color
* will be blended unmodified with the destination; the default blend
* expects premultiplied colors: for example, use (0.5, 0.0, 0.0, 0.5) for
* semi-transparent red. See {@link Cogl.Color.premultiply}.
*
* The default value is (1.0, 1.0, 1.0, 1.0)
* @param color The components of the color
*/
public set_color(color: Color): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_color4f} instead
*
* Sets the basic color of the material, used when no lighting is enabled.
*
* The default value is (1.0, 1.0, 1.0, 1.0)
* @param red The red component
* @param green The green component
* @param blue The blue component
* @param alpha The alpha component
*/
public set_color4f(red: number, green: number, blue: number, alpha: number): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_color4ub} instead
*
* Sets the basic color of the material, used when no lighting is enabled.
*
* The default value is (0xff, 0xff, 0xff, 0xff)
* @param red The red component
* @param green The green component
* @param blue The blue component
* @param alpha The alpha component
*/
public set_color4ub(red: number, green: number, blue: number, alpha: number): void;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Sets the material's diffuse color, in the standard OpenGL lighting
* model. The diffuse color is most intense where the light hits the
* surface directly - perpendicular to the surface.
*
* The default value is (0.8, 0.8, 0.8, 1.0)
* @param diffuse The components of the desired diffuse color
*/
public set_diffuse(diffuse: Color): void;
/**
* @deprecated
* Use the {@link Snippet} shader api for lighting
*
* Sets the material's emissive color, in the standard OpenGL lighting
* model. It will look like the surface is a light source emitting this
* color.
*
* The default value is (0.0, 0.0, 0.0, 1.0)
* @param emission The components of the desired emissive color
*/
public set_emission(emission: Color): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer} instead
*
* In addition to the standard OpenGL lighting model a Cogl material may have
* one or more layers comprised of textures that can be blended together in
* order, with a number of different texture combine modes. This function
* defines a new texture layer.
*
* The index values of multiple layers do not have to be consecutive; it is
* only their relative order that is important.
*
* <note>In the future, we may define other types of material layers, such
* as purely GLSL based layers.</note>
* @param layer_index the index of the layer
* @param texture a {@link Handle} for the layer object
*/
public set_layer(layer_index: number, texture: Handle): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer_combine} instead
*
* If not already familiar; you can refer
* <link linkend="cogl-Blend-Strings">here</link> for an overview of what blend
* strings are and there syntax.
*
* These are all the functions available for texture combining:
* <itemizedlist>
* <listitem>REPLACE(arg0) = arg0</listitem>
* <listitem>MODULATE(arg0, arg1) = arg0 x arg1</listitem>
* <listitem>ADD(arg0, arg1) = arg0 + arg1</listitem>
* <listitem>ADD_SIGNED(arg0, arg1) = arg0 + arg1 - 0.5</listitem>
* <listitem>INTERPOLATE(arg0, arg1, arg2) = arg0 x arg2 + arg1 x (1 - arg2)</listitem>
* <listitem>SUBTRACT(arg0, arg1) = arg0 - arg1</listitem>
* <listitem>
* <programlisting>
* DOT3_RGB(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) +
* (arg0[G] - 0.5)) * (arg1[G] - 0.5) +
* (arg0[B] - 0.5)) * (arg1[B] - 0.5))
* </programlisting>
* </listitem>
* <listitem>
* <programlisting>
* DOT3_RGBA(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) +
* (arg0[G] - 0.5)) * (arg1[G] - 0.5) +
* (arg0[B] - 0.5)) * (arg1[B] - 0.5))
* </programlisting>
* </listitem>
* </itemizedlist>
*
* Refer to the
* <link linkend="cogl-Blend-String-syntax">color-source syntax</link> for
* describing the arguments. The valid source names for texture combining
* are:
* <variablelist>
* <varlistentry>
* <term>TEXTURE</term>
* <listitem>Use the color from the current texture layer</listitem>
* </varlistentry>
* <varlistentry>
* <term>TEXTURE_0, TEXTURE_1, etc</term>
* <listitem>Use the color from the specified texture layer</listitem>
* </varlistentry>
* <varlistentry>
* <term>CONSTANT</term>
* <listitem>Use the color from the constant given with
* {@link Cogl.Material.set_layer_constant}</listitem>
* </varlistentry>
* <varlistentry>
* <term>PRIMARY</term>
* <listitem>Use the color of the material as set with
* cogl_material_set_color()</listitem>
* </varlistentry>
* <varlistentry>
* <term>PREVIOUS</term>
* <listitem>Either use the texture color from the previous layer, or
* if this is layer 0, use the color of the material as set with
* cogl_material_set_color()</listitem>
* </varlistentry>
* </variablelist>
*
* <refsect2 id="cogl-Layer-Combine-Examples">
* <title>Layer Combine Examples</title>
* <para>This is effectively what the default blending is:</para>
* <informalexample><programlisting>
* RGBA = MODULATE (PREVIOUS, TEXTURE)
* </programlisting></informalexample>
* <para>This could be used to cross-fade between two images, using
* the alpha component of a constant as the interpolator. The constant
* color is given by calling cogl_material_set_layer_constant.</para>
* <informalexample><programlisting>
* RGBA = INTERPOLATE (PREVIOUS, TEXTURE, CONSTANT[A])
* </programlisting></informalexample>
* </refsect2>
*
* <note>You can't give a multiplication factor for arguments as you can
* with blending.</note>
* @param layer_index Specifies the layer you want define a combine function for
* @param blend_string A <link linkend="cogl-Blend-Strings">Cogl blend string</link>
* describing the desired texture combine function.
* @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
*/
public set_layer_combine(layer_index: number, blend_string: string): Bool;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer_combine_constant}
* instead
*
* When you are using the 'CONSTANT' color source in a layer combine
* description then you can use this function to define its value.
* @param layer_index Specifies the layer you want to specify a constant used
* for texture combining
* @param constant The constant color you want
*/
public set_layer_combine_constant(layer_index: number, constant: Color): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer_filters} instead
*
* Changes the decimation and interpolation filters used when a texture is
* drawn at other scales than 100%.
* @param layer_index the layer number to change.
* @param min_filter the filter used when scaling a texture down.
* @param mag_filter the filter used when magnifying a texture.
*/
public set_layer_filters(layer_index: number, min_filter: MaterialFilter, mag_filter: MaterialFilter): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer_matrix} instead
*
* This function lets you set a matrix that can be used to e.g. translate
* and rotate a single layer of a material used to fill your geometry.
* @param layer_index the index for the layer inside #material
* @param matrix the transformation matrix for the layer
*/
public set_layer_matrix(layer_index: number, matrix: Matrix): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer_point_sprite_coords_enabled}
* instead
*
* When rendering points, if #enable is %TRUE then the texture
* coordinates for this layer will be replaced with coordinates that
* vary from 0.0 to 1.0 across the primitive. The top left of the
* point will have the coordinates 0.0,0.0 and the bottom right will
* have 1.0,1.0. If #enable is %FALSE then the coordinates will be
* fixed for the entire point.
*
* This function will only work if %COGL_FEATURE_POINT_SPRITE is
* available. If the feature is not available then the function will
* return %FALSE and set #error.
* @param layer_index the layer number to change.
* @param enable whether to enable point sprite coord generation.
* @returns %TRUE if the function succeeds, %FALSE otherwise.
*/
public set_layer_point_sprite_coords_enabled(layer_index: number, enable: Bool): Bool;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer_wrap_mode} instead
*
* Sets the wrap mode for all three coordinates of texture lookups on
* this layer. This is equivalent to calling
* {@link Cogl.Material.set_layer_wrap_mode_s},
* cogl_material_set_layer_wrap_mode_t() and
* cogl_material_set_layer_wrap_mode_p() separately.
* @param layer_index the layer number to change.
* @param mode the new wrap mode
*/
public set_layer_wrap_mode(layer_index: number, mode: MaterialWrapMode): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer_wrap_mode_p} instead
*
* Sets the wrap mode for the 'p' coordinate of texture lookups on
* this layer. 'p' is the third coordinate.
* @param layer_index the layer number to change.
* @param mode the new wrap mode
*/
public set_layer_wrap_mode_p(layer_index: number, mode: MaterialWrapMode): void;
/**
* @deprecated
* Use {@link Cogl.pipeline_set_layer_wrap_mode_s} instead
*
* Sets the wrap mode for the 's' coordinate of texture lookups on this layer.
* @param layer_index the layer number to change.
* @param mode the new wrap mode