Tizen Native API  3.0
3x3 Matrices in floating point

Matrix definition and operations.

Functions

Eina_Matrix_Type eina_matrix3_type_get (const Eina_Matrix3 *m)
 Returns the type of the given floating point matrix.
void eina_matrix3_values_set (Eina_Matrix3 *m, double xx, double xy, double xz, double yx, double yy, double yz, double zx, double zy, double zz)
 Sets the values of the coefficients of the given floating point matrix.
void eina_matrix3_values_get (const Eina_Matrix3 *m, double *xx, double *xy, double *xz, double *yx, double *yy, double *yz, double *zx, double *zy, double *zz)
 Gets the values of the coefficients of the given floating point matrix.
void eina_matrix3_fixed_values_get (const Eina_Matrix3 *m, Eina_F16p16 *xx, Eina_F16p16 *xy, Eina_F16p16 *xz, Eina_F16p16 *yx, Eina_F16p16 *yy, Eina_F16p16 *yz, Eina_F16p16 *zx, Eina_F16p16 *zy, Eina_F16p16 *zz)
 Gets the values of the coefficients of the given fixed point matrix.
void eina_matrix3_matrix3_f16p16_to (const Eina_Matrix3 *m, Eina_Matrix3_F16p16 *fm)
 Transforms the given floating point matrix to the given fixed point matrix.
Eina_Bool eina_matrix3_equal (const Eina_Matrix3 *m1, const Eina_Matrix3 *m2)
 Checks whether the two given matrices are equal or not.
void eina_matrix3_compose (const Eina_Matrix3 *m1, const Eina_Matrix3 *m2, Eina_Matrix3 *dst)
void eina_matrix3_translate (Eina_Matrix3 *t, double tx, double ty)
 Sets the matrix values for a translation.
void eina_matrix3_scale (Eina_Matrix3 *t, double sx, double sy)
 Sets the matrix values for a scale.
void eina_matrix3_rotate (Eina_Matrix3 *t, double rad)
 Sets the matrix values for a rotation.
void eina_matrix3_identity (Eina_Matrix3 *t)
 Sets the given floating point matrix to the identity matrix.
double eina_matrix3_determinant (const Eina_Matrix3 *m)
 Returns the determinant of the given matrix.
void eina_matrix3_divide (Eina_Matrix3 *m, double scalar)
 Divides the given matrix by the given scalar.
void eina_matrix3_inverse (const Eina_Matrix3 *m, Eina_Matrix3 *m2)
 Computes the inverse of the given matrix.
void eina_matrix3_transpose (const Eina_Matrix3 *m, Eina_Matrix3 *a)
void eina_matrix3_cofactor (const Eina_Matrix3 *m, Eina_Matrix3 *a)
void eina_matrix3_adjoint (const Eina_Matrix3 *m, Eina_Matrix3 *a)
void eina_matrix3_point_transform (const Eina_Matrix3 *m, double x, double y, double *xr, double *yr)
void eina_matrix3_rectangle_transform (const Eina_Matrix3 *m, const Eina_Rectangle *r, const Eina_Quad *q)
Eina_Bool eina_matrix3_quad_quad_map (Eina_Matrix3 *m, const Eina_Quad *src, const Eina_Quad *dst)
 Creates a projective matrix that maps a quadrangle to a quadrangle.
Eina_Bool eina_matrix3_square_quad_map (Eina_Matrix3 *m, const Eina_Quad *q)
Eina_Bool eina_matrix3_quad_square_map (Eina_Matrix3 *m, const Eina_Quad *q)
void eina_matrix3_array_set (Eina_Matrix3 *m, const double *v)
 Sets array to matrix.
void eina_matrix3_copy (Eina_Matrix3 *dst, const Eina_Matrix3 *src)
 Copies matrix.
void eina_matrix3_multiply (Eina_Matrix3 *out, const Eina_Matrix3 *mat_a, const Eina_Matrix3 *mat_b)
 Multiplies two matrix.
void eina_matrix3_multiply_copy (Eina_Matrix3 *out, const Eina_Matrix3 *mat_a, const Eina_Matrix3 *mat_b)
 Multiplies two matrix.
void eina_matrix3_scale_transform_set (Eina_Matrix3 *out, double s_x, double s_y)
 Transforms scale of matrix.
void eina_matrix3_position_transform_set (Eina_Matrix3 *out, const double p_x, const double p_y)
 Transforms position of matrix.
void eina_normal3_matrix_get (Eina_Matrix3 *out, const Eina_Matrix4 *m)
 Sets normal of the given matrix.
void eina_matrix3_matrix4_to (Eina_Matrix4 *m4, const Eina_Matrix3 *m3)
 Converts an Eina_Matrix3 into an Eina_Matrix4.

Typedefs

typedef struct _Eina_Matrix3 Eina_Matrix3

Defines

#define EINA_MATRIX3_FORMAT   "g %g %g | %g %g %g | %g %g %g"
#define EINA_MATRIX3_ARGS(m)

Define Documentation

#define EINA_MATRIX3_ARGS (   m)
Value:
(m)->xx, (m)->xy, (m)->xz, \
    (m)->yx, (m)->yy, (m)->yz,                          \
    (m)->zx, (m)->zy, (m)->zz

Helper macro for printf formatting arg

#define EINA_MATRIX3_FORMAT   "g %g %g | %g %g %g | %g %g %g"

Helper macro for printf formatting


Typedef Documentation

Floating point matrix3 handler


Function Documentation

void eina_matrix3_adjoint ( const Eina_Matrix3 m,
Eina_Matrix3 a 
)
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_array_set ( Eina_Matrix3 m,
const double *  v 
)

Sets array to matrix.

Parameters:
mThe result matrix
vThe the array[9] for set

Set to matrix first 9 elements from array

Since (EFL) :
1.17
Since :
3.0
void eina_matrix3_cofactor ( const Eina_Matrix3 m,
Eina_Matrix3 a 
)
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_compose ( const Eina_Matrix3 m1,
const Eina_Matrix3 m2,
Eina_Matrix3 dst 
)
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_copy ( Eina_Matrix3 dst,
const Eina_Matrix3 src 
)

Copies matrix.

Parameters:
dstThe matrix copy
srcThe matrix for copy.
Since (EFL) :
1.16
Since :
3.0
double eina_matrix3_determinant ( const Eina_Matrix3 m)

Returns the determinant of the given matrix.

Parameters:
mThe matrix.
Returns:
The determinant.

This function returns the determinant of the matrix m. No check is done on m.

Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_divide ( Eina_Matrix3 m,
double  scalar 
)

Divides the given matrix by the given scalar.

Parameters:
mThe matrix.
scalarThe scalar number.

This function divides the matrix m by scalar. No check is done on m.

Since (EFL) :
1.14
Since :
3.0
Eina_Bool eina_matrix3_equal ( const Eina_Matrix3 m1,
const Eina_Matrix3 m2 
)

Checks whether the two given matrices are equal or not.

Parameters:
m1The first matrix.
m2The second matrix.
Returns:
EINA_TRUE if the two matrices are equal, 0 otherwise.

This function return EINA_TRUE if thematrices m1 and m2 are equal, EINA_FALSE otherwise. No check is done on the matrices.

Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_fixed_values_get ( const Eina_Matrix3 m,
Eina_F16p16 xx,
Eina_F16p16 xy,
Eina_F16p16 xz,
Eina_F16p16 yx,
Eina_F16p16 yy,
Eina_F16p16 yz,
Eina_F16p16 zx,
Eina_F16p16 zy,
Eina_F16p16 zz 
)

Gets the values of the coefficients of the given fixed point matrix.

Parameters:
mThe fixed point matrix.
xxThe first coefficient value.
xyThe second coefficient value.
xzThe third coefficient value.
yxThe fourth coefficient value.
yyThe fifth coefficient value.
yzThe sixth coefficient value.
zxThe seventh coefficient value.
zyThe heighth coefficient value.
zzThe nineth coefficient value.

This function gets the values of the coefficients of the matrix m. No check is done on m.

See also:
eina_matrix3_values_set()
Since (EFL) :
1.14
Since :
3.0

Sets the given floating point matrix to the identity matrix.

Parameters:
tThe floating point matrix to set

This function sets m to the identity matrix. No check is done on m.

Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_inverse ( const Eina_Matrix3 m,
Eina_Matrix3 m2 
)

Computes the inverse of the given matrix.

Parameters:
mThe matrix to inverse.
m2The inverse matrix.

This function inverse the matrix m and stores the result in m2. No check is done on m or m2. If m can not be invertible, then m2 is set to the identity matrix.

Since (EFL) :
1.14
Since :
3.0

Transforms the given floating point matrix to the given fixed point matrix.

Parameters:
mThe floating point matrix.
fmThe fixed point matrix.

This function transforms the floating point matrix m to a fixed point matrix and store the coefficients into the fixed point matrix fm.

Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_matrix4_to ( Eina_Matrix4 m4,
const Eina_Matrix3 m3 
)

Converts an Eina_Matrix3 into an Eina_Matrix4.

Parameters:
m3The destination Eina_Matrix3.
m4The source Eina_Matrix4.
Since (EFL) :
1.15
Since :
3.0
void eina_matrix3_multiply ( Eina_Matrix3 out,
const Eina_Matrix3 mat_a,
const Eina_Matrix3 mat_b 
)

Multiplies two matrix.

Parameters:
outThe resulting matrix
mat_aThe first member of the multiplication
mat_bThe second member of the multiplication
Since (EFL) :
1.17
Since :
3.0
void eina_matrix3_multiply_copy ( Eina_Matrix3 out,
const Eina_Matrix3 mat_a,
const Eina_Matrix3 mat_b 
)

Multiplies two matrix.

Parameters:
outThe resulting matrix
mat_aThe first member of the multiplication
mat_bThe second member of the multiplication
Since (EFL) :
1.17
Since :
3.0
void eina_matrix3_point_transform ( const Eina_Matrix3 m,
double  x,
double  y,
double *  xr,
double *  yr 
)
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_position_transform_set ( Eina_Matrix3 out,
const double  p_x,
const double  p_y 
)

Transforms position of matrix.

Parameters:
outThe resulting matrix
p_xThe position value for x
p_yThe position value for y
Since (EFL) :
1.17
Since :
3.0
Eina_Bool eina_matrix3_quad_quad_map ( Eina_Matrix3 m,
const Eina_Quad src,
const Eina_Quad dst 
)

Creates a projective matrix that maps a quadrangle to a quadrangle.

Since :
3.0
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_rectangle_transform ( const Eina_Matrix3 m,
const Eina_Rectangle r,
const Eina_Quad q 
)
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_rotate ( Eina_Matrix3 t,
double  rad 
)

Sets the matrix values for a rotation.

Parameters:
[in]tThe matrix to set the rotation values
[in]radThe radius to rotate the matrix
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_scale ( Eina_Matrix3 t,
double  sx,
double  sy 
)

Sets the matrix values for a scale.

Parameters:
[in]tThe matrix to set the scale values
[in]sxThe X coordinate scale
[in]syThe Y coordinate scale
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_scale_transform_set ( Eina_Matrix3 out,
double  s_x,
double  s_y 
)

Transforms scale of matrix.

Parameters:
outThe resulting matrix
s_xThe scale value for x
s_yThe scale value for y
Since (EFL) :
1.17
Since :
3.0
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_translate ( Eina_Matrix3 t,
double  tx,
double  ty 
)

Sets the matrix values for a translation.

Parameters:
[in]tThe matrix to set the translation values
[in]txThe X coordinate translate
[in]tyThe Y coordinate translate
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_transpose ( const Eina_Matrix3 m,
Eina_Matrix3 a 
)
Since (EFL) :
1.14
Since :
3.0

Returns the type of the given floating point matrix.

Parameters:
mThe floating point matrix.
Returns:
The type of the matrix.

This function returns the type of the matrix m. No check is done on m.

Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_values_get ( const Eina_Matrix3 m,
double *  xx,
double *  xy,
double *  xz,
double *  yx,
double *  yy,
double *  yz,
double *  zx,
double *  zy,
double *  zz 
)

Gets the values of the coefficients of the given floating point matrix.

Parameters:
mThe floating point matrix.
xxThe first coefficient value.
xyThe second coefficient value.
xzThe third coefficient value.
yxThe fourth coefficient value.
yyThe fifth coefficient value.
yzThe sixth coefficient value.
zxThe seventh coefficient value.
zyThe heighth coefficient value.
zzThe nineth coefficient value.

This function gets the values of the coefficients of the matrix m. No check is done on m.

See also:
eina_matrix3_values_set()
Since (EFL) :
1.14
Since :
3.0
void eina_matrix3_values_set ( Eina_Matrix3 m,
double  xx,
double  xy,
double  xz,
double  yx,
double  yy,
double  yz,
double  zx,
double  zy,
double  zz 
)

Sets the values of the coefficients of the given floating point matrix.

Parameters:
mThe floating point matrix.
xxThe first coefficient value.
xyThe second coefficient value.
xzThe third coefficient value.
yxThe fourth coefficient value.
yyThe fifth coefficient value.
yzThe sixth coefficient value.
zxThe seventh coefficient value.
zyThe heighth coefficient value.
zzThe nineth coefficient value.

This function sets the values of the coefficients of the matrix m. No check is done on m.

See also:
eina_matrix3_values_get()
Since (EFL) :
1.14
Since :
3.0
void eina_normal3_matrix_get ( Eina_Matrix3 out,
const Eina_Matrix4 m 
)

Sets normal of the given matrix.

Parameters:
outThe result mtrix of normal
mThe matrix
Since (EFL) :
1.17
Since :
3.0