A structure capable of holding a vector with two dimensions, x and y.
The contents of the Graphene.Vec2.Graphene_Vec2_T structure are private and should never be accessed directly.
procedure Add
(Self : not null access Graphene_Vec2_T;
B : not null access Graphene_Vec2_T;
Res : not null access Graphene_Vec2_T)
Adds each component of the two passed vectors and places each result into the components of Res. Since: gtk+ 1.0
a Graphene.Vec2.Graphene_Vec2_T
return location for the result
procedure Divide
(Self : not null access Graphene_Vec2_T;
B : not null access Graphene_Vec2_T;
Res : not null access Graphene_Vec2_T)
Divides each component of the first operand A by the corresponding component of the second operand B, and places the results into the vector Res. Since: gtk+ 1.0
a Graphene.Vec2.Graphene_Vec2_T
return location for the result
function Dot
(Self : not null access Graphene_Vec2_T;
B : not null access Graphene_Vec2_T) return Interfaces.C.C_float
Computes the dot product of the two given vectors. Since: gtk+ 1.0
a Graphene.Vec2.Graphene_Vec2_T
the dot product of the vectors
function Equal
(Self : not null access Graphene_Vec2_T;
V2 : not null access Graphene_Vec2_T) return Boolean
Checks whether the two given Graphene.Vec2.Graphene_Vec2_T are equal. Since: gtk+ 1.2
a Graphene.Vec2.Graphene_Vec2_T
true if the two vectors are equal, and false otherwise
procedure Free (Self : not null access Graphene_Vec2_T)
Frees the resources allocated by V Since: gtk+ 1.0
function From_Object_Free
(B : not null access Graphene_Vec2_T) return Graphene_Vec2_T
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function Get_Type return Glib.GType
function Get_X
(Self : not null access Graphene_Vec2_T) return Interfaces.C.C_float
Retrieves the X component of the Graphene.Vec2.Graphene_Vec2_T. Since: gtk+ 1.0
the value of the X component
function Get_Y
(Self : not null access Graphene_Vec2_T) return Interfaces.C.C_float
Retrieves the Y component of the Graphene.Vec2.Graphene_Vec2_T. Since: gtk+ 1.0
the value of the Y component
type Graphene_Vec2_Array is array (Natural range <>) of Graphene_Vec2_T;
type Graphene_Vec2_T is record
Value : Graphene.Config.Graphene_Simd4f;
end record;
A structure capable of holding a vector with two dimensions, x and y.
The contents of the Graphene.Vec2.Graphene_Vec2_T structure are private and should never be accessed directly.
function Init
(Self : not null access Graphene_Vec2_T;
X : Interfaces.C.C_float;
Y : Interfaces.C.C_float) return access Graphene_Vec2_T
Initializes a Graphene.Vec2.Graphene_Vec2_T using the given values. This function can be called multiple times. Since: gtk+ 1.0
the X field of the vector
the Y field of the vector
the initialized vector
function Init_From_Vec2
(Self : not null access Graphene_Vec2_T;
Src : not null access Graphene_Vec2_T) return access Graphene_Vec2_T
Copies the contents of Src into V. Since: gtk+ 1.0
a Graphene.Vec2.Graphene_Vec2_T
the initialized vector
procedure Interpolate
(Self : not null access Graphene_Vec2_T;
V2 : not null access Graphene_Vec2_T;
Factor : Gdouble;
Res : not null access Graphene_Vec2_T)
Linearly interpolates V1 and V2 using the given Factor. Since: gtk+ 1.10
a Graphene.Vec2.Graphene_Vec2_T
the interpolation factor
the interpolated vector
function Length
(Self : not null access Graphene_Vec2_T) return Interfaces.C.C_float
Computes the length of the given vector. Since: gtk+ 1.0
the length of the vector
procedure Max
(Self : not null access Graphene_Vec2_T;
B : not null access Graphene_Vec2_T;
Res : not null access Graphene_Vec2_T)
Compares the two given vectors and places the maximum values of each component into Res. Since: gtk+ 1.0
a Graphene.Vec2.Graphene_Vec2_T
the resulting vector
procedure Min
(Self : not null access Graphene_Vec2_T;
B : not null access Graphene_Vec2_T;
Res : not null access Graphene_Vec2_T)
Compares the two given vectors and places the minimum values of each component into Res. Since: gtk+ 1.0
a Graphene.Vec2.Graphene_Vec2_T
the resulting vector
procedure Multiply
(Self : not null access Graphene_Vec2_T;
B : not null access Graphene_Vec2_T;
Res : not null access Graphene_Vec2_T)
Multiplies each component of the two passed vectors and places each result into the components of Res. Since: gtk+ 1.0
a Graphene.Vec2.Graphene_Vec2_T
return location for the result
function Near
(Self : not null access Graphene_Vec2_T;
V2 : not null access Graphene_Vec2_T;
Epsilon : Interfaces.C.C_float) return Boolean
Compares the two given Graphene.Vec2.Graphene_Vec2_T vectors and checks whether their values are within the given Epsilon. Since: gtk+ 1.2
a Graphene.Vec2.Graphene_Vec2_T
the threshold between the two vectors
true if the two vectors are near each other
procedure Negate
(Self : not null access Graphene_Vec2_T;
Res : not null access Graphene_Vec2_T)
Negates the given Graphene.Vec2.Graphene_Vec2_T. Since: gtk+ 1.2
return location for the result vector
procedure Normalize
(Self : not null access Graphene_Vec2_T;
Res : not null access Graphene_Vec2_T)
Computes the normalized vector for the given vector V. Since: gtk+ 1.0
return location for the normalized vector
function One return access constant Graphene_Vec2_T
Retrieves a constant vector with (1, 1) components. Since: gtk+ 1.0
the one vector
procedure Scale
(Self : not null access Graphene_Vec2_T;
Factor : Interfaces.C.C_float;
Res : not null access Graphene_Vec2_T)
Multiplies all components of the given vector with the given scalar Factor. Since: gtk+ 1.2
the scalar factor
return location for the result vector
procedure Subtract
(Self : not null access Graphene_Vec2_T;
B : not null access Graphene_Vec2_T;
Res : not null access Graphene_Vec2_T)
Subtracts from each component of the first operand A the corresponding component of the second operand B and places each result into the components of Res. Since: gtk+ 1.0
a Graphene.Vec2.Graphene_Vec2_T
return location for the result
function X_Axis return access constant Graphene_Vec2_T
Retrieves a constant vector with (1, 0) components. Since: gtk+ 1.0
the X axis vector
function Y_Axis return access constant Graphene_Vec2_T
Retrieves a constant vector with (0, 1) components. Since: gtk+ 1.0
the Y axis vector
function Zero return access constant Graphene_Vec2_T
Retrieves a constant vector with (0, 0) components. Since: gtk+ 1.0
the zero vector