| colord Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
CdMat3x3; CdVec3; void cd_mat33_clear (const CdMat3x3 *src); void cd_mat33_copy (const CdMat3x3 *src,CdMat3x3 *dest); gdouble cd_mat33_determinant (const CdMat3x3 *src); gdouble * cd_mat33_get_data (const CdMat3x3 *src); void cd_mat33_matrix_multiply (const CdMat3x3 *mat_src1,const CdMat3x3 *mat_src2,CdMat3x3 *mat_dest); gboolean cd_mat33_reciprocal (const CdMat3x3 *src,CdMat3x3 *dest); void cd_mat33_scalar_multiply (const CdMat3x3 *mat_src,gdouble value,CdMat3x3 *mat_dest); void cd_mat33_set_identity (CdMat3x3 *src); gchar * cd_mat33_to_string (const CdMat3x3 *src); void cd_mat33_vector_multiply (const CdMat3x3 *mat_src,const CdVec3 *vec_src,CdVec3 *vec_dest); void cd_vec3_add (const CdVec3 *src1,const CdVec3 *src2,CdVec3 *dest); void cd_vec3_clear (CdVec3 *src); void cd_vec3_copy (const CdVec3 *src,CdVec3 *dest); gdouble * cd_vec3_get_data (const CdVec3 *src); void cd_vec3_init (CdVec3 *dest,gdouble v0,gdouble v1,gdouble v2); void cd_vec3_scalar_multiply (const CdVec3 *src,gdouble value,CdVec3 *dest); gdouble cd_vec3_squared_error (const CdVec3 *src1,const CdVec3 *src2); void cd_vec3_subtract (const CdVec3 *src1,const CdVec3 *src2,CdVec3 *dest); gchar * cd_vec3_to_string (const CdVec3 *src);
typedef struct {
gdouble m00, m01, m02;
gdouble m10, m11, m12;
gdouble m20, m21, m22;
/* any addition fields go *after* the data */
} CdMat3x3;
void cd_mat33_clear (const CdMat3x3 *src);
Clears a matrix value, setting all it's values to zero.
|
the source |
void cd_mat33_copy (const CdMat3x3 *src,CdMat3x3 *dest);
Copies the matrix.
The arguments src and dest cannot be the same value.
|
the source |
|
the destination |
gdouble cd_mat33_determinant (const CdMat3x3 *src);
Gets the determinant of the matrix.
|
the source |
gdouble * cd_mat33_get_data (const CdMat3x3 *src);
Gets the raw data for the matrix.
|
the matrix source |
Returns : |
the pointer to the data segment. |
void cd_mat33_matrix_multiply (const CdMat3x3 *mat_src1,const CdMat3x3 *mat_src2,CdMat3x3 *mat_dest);
Multiply (convolve) one matrix with another.
The arguments mat_src1 cannot be the same as mat_dest, and
mat_src2 cannot be the same as mat_dest.
|
the matrix source |
|
the other matrix source |
|
the destination |
gboolean cd_mat33_reciprocal (const CdMat3x3 *src,CdMat3x3 *dest);
Inverts the matrix.
The arguments src and dest cannot be the same value.
|
the source |
|
the destination |
Returns : |
FALSE if det is zero (singular). |
void cd_mat33_scalar_multiply (const CdMat3x3 *mat_src,gdouble value,CdMat3x3 *mat_dest);
Multiplies a matrix with a scalar.
The arguments vec_src and vec_dest can be the same value.
|
the source |
|
the scalar |
|
the destination |
void cd_mat33_set_identity (CdMat3x3 *src);
Sets the matrix to an identity value.
|
the source |
gchar * cd_mat33_to_string (const CdMat3x3 *src);
Obtains a string representaton of a matrix.
|
the source |
Returns : |
the string. Free with g_free()
|
void cd_mat33_vector_multiply (const CdMat3x3 *mat_src,const CdVec3 *vec_src,CdVec3 *vec_dest);
Multiplies a matrix with a vector.
The arguments vec_src and vec_dest cannot be the same value.
|
the matrix source |
|
the vector source |
|
the destination vector |
void cd_vec3_add (const CdVec3 *src1,const CdVec3 *src2,CdVec3 *dest);
Adds two vector quantaties
The arguments src and dest can be the same value.
|
the source |
|
the other source |
|
the destination |
void cd_vec3_clear (CdVec3 *src);
Clears a vector, setting all it's values to zero.
|
the source vector |
void cd_vec3_copy (const CdVec3 *src,CdVec3 *dest);
Copies the vector into another vector.
The arguments src and dest cannot be the same value.
|
the source |
|
the destination |
gdouble * cd_vec3_get_data (const CdVec3 *src);
Gets the raw data for the vector.
|
the vector source |
Returns : |
the pointer to the data segment. |
void cd_vec3_init (CdVec3 *dest,gdouble v0,gdouble v1,gdouble v2);
Initialises a vector.
|
the destination vector |
|
component value |
|
component value |
|
component value |
void cd_vec3_scalar_multiply (const CdVec3 *src,gdouble value,CdVec3 *dest);
Multiplies a vector with a scalar.
The arguments src and dest can be the same value.
|
the source |
|
the scalar multiplier |
|
the destination |
gdouble cd_vec3_squared_error (const CdVec3 *src1,const CdVec3 *src2);
Gets the mean squared error for a pair of vectors
|
the vector source |
Returns : |
the floating point MSE. |
void cd_vec3_subtract (const CdVec3 *src1,const CdVec3 *src2,CdVec3 *dest);
Subtracts one vector quantaty from another
The arguments src and dest can be the same value.
|
the source |
|
the other source |
|
the destination |