Specifies a transfer function for a color component to be applied while rendering.
The available functions include linear, piecewise-linear, gamma and step functions.
Note that the transfer function is applied to un-premultiplied values, and all results are clamped to the [0, 1] range.
function Copy
(Self : Gsk_Component_Transfer) return Gsk_Component_Transfer
Creates a copy of Other. Since: gtk+ 4.20
a newly allocated copy of Other. Has transfer-ownership='full'.
function Equal
(Self : System.Address;
Other : System.Address) return Boolean
Compares two component transfers for equality. Since: gtk+ 4.20
a component transfer
another component transfer
true if Self and Other are equal
procedure Free (Self : Gsk_Component_Transfer)
Frees a component transfer. Since: gtk+ 4.20
function From_Object (Object : System.Address) return Gsk_Component_Transfer
function From_Object_Free (B : access Gsk_Component_Transfer'Class) return Gsk_Component_Transfer
function Get_Type return Glib.GType
type Gsk_Component_Transfer is new Glib.C_Boxed with null record;
function Gsk_Component_Transfer_New_Discrete
(N : Guint;
Values : Gfloat_Array) return Gsk_Component_Transfer
Creates a new component transfer that applies a step function. The new value is computed as C' = values[k] where k is the smallest value such that k / n <= C < (k + 1) / n <figure> <picture> <source srcset="discrete-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: discrete" src="discrete-light.png"> </picture> </figure> Since: gtk+ 4.20
Number of values
Values
function Gsk_Component_Transfer_New_Gamma
(Amp : Interfaces.C.C_float;
Exp : Interfaces.C.C_float;
Ofs : Interfaces.C.C_float) return Gsk_Component_Transfer
Creates a new component transfer that applies a gamma transform. The new value is computed as C' = amp * pow (C, exp) + ofs <figure> <picture> <source srcset="gamma-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: gamma" src="gamma-light.png"> </picture> </figure> Since: gtk+ 4.20
Amplitude
Exponent
Offset
function Gsk_Component_Transfer_New_Identity return Gsk_Component_Transfer
Creates a new component transfer that doesn't change the component value. <figure> <picture> <source srcset="identity-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: identity" src="identity-light.png"> </picture> </figure> Since: gtk+ 4.20
function Gsk_Component_Transfer_New_Levels
(N : Interfaces.C.C_float) return Gsk_Component_Transfer
Creates a new component transfer that limits the values of the component to n levels. The new value is computed as C' = (floor (C * n) + 0.5) / n <figure> <picture> <source srcset="levels-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: levels" src="levels-light.png"> </picture> </figure> Since: gtk+ 4.20
Number of levels
function Gsk_Component_Transfer_New_Linear
(M : Interfaces.C.C_float;
B : Interfaces.C.C_float) return Gsk_Component_Transfer
Creates a new component transfer that applies a linear transform. The new value is computed as C' = C * m + b <figure> <picture> <source srcset="linear-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: linear" src="linear-light.png"> </picture> </figure> Since: gtk+ 4.20
Slope
Offset
function Gsk_Component_Transfer_New_Table
(N : Guint;
Values : Gfloat_Array) return Gsk_Component_Transfer
Creates a new component transfer that applies a piecewise linear function. The new value is computed as C' = values[k] + (C - k / (n - 1)) * n * (values[k + 1] - values[k]) where k is the smallest value such that k / (n - 1) <= C < (k + 1) / (n - 1) <figure> <picture> <source srcset="table-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: table" src="table-light.png"> </picture> </figure> Since: gtk+ 4.20
Number of values
Values
procedure Gtk_New_Discrete
(Self : out Gsk_Component_Transfer;
N : Guint;
Values : Gfloat_Array)
Creates a new component transfer that applies a step function. The new value is computed as C' = values[k] where k is the smallest value such that k / n <= C < (k + 1) / n <figure> <picture> <source srcset="discrete-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: discrete" src="discrete-light.png"> </picture> </figure> Since: gtk+ 4.20
Number of values
Values
procedure Gtk_New_Gamma
(Self : out Gsk_Component_Transfer;
Amp : Interfaces.C.C_float;
Exp : Interfaces.C.C_float;
Ofs : Interfaces.C.C_float)
Creates a new component transfer that applies a gamma transform. The new value is computed as C' = amp * pow (C, exp) + ofs <figure> <picture> <source srcset="gamma-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: gamma" src="gamma-light.png"> </picture> </figure> Since: gtk+ 4.20
Amplitude
Exponent
Offset
procedure Gtk_New_Identity (Self : out Gsk_Component_Transfer)
Creates a new component transfer that doesn't change the component value. <figure> <picture> <source srcset="identity-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: identity" src="identity-light.png"> </picture> </figure> Since: gtk+ 4.20
procedure Gtk_New_Levels
(Self : out Gsk_Component_Transfer;
N : Interfaces.C.C_float)
Creates a new component transfer that limits the values of the component to n levels. The new value is computed as C' = (floor (C * n) + 0.5) / n <figure> <picture> <source srcset="levels-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: levels" src="levels-light.png"> </picture> </figure> Since: gtk+ 4.20
Number of levels
procedure Gtk_New_Linear
(Self : out Gsk_Component_Transfer;
M : Interfaces.C.C_float;
B : Interfaces.C.C_float)
Creates a new component transfer that applies a linear transform. The new value is computed as C' = C * m + b <figure> <picture> <source srcset="linear-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: linear" src="linear-light.png"> </picture> </figure> Since: gtk+ 4.20
Slope
Offset
procedure Gtk_New_Table
(Self : out Gsk_Component_Transfer;
N : Guint;
Values : Gfloat_Array)
Creates a new component transfer that applies a piecewise linear function. The new value is computed as C' = values[k] + (C - k / (n - 1)) * n * (values[k + 1] - values[k]) where k is the smallest value such that k / (n - 1) <= C < (k + 1) / (n - 1) <figure> <picture> <source srcset="table-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Component transfer: table" src="table-light.png"> </picture> </figure> Since: gtk+ 4.20
Number of values
Values
Null_Gsk_Component_Transfer : constant Gsk_Component_Transfer;