mirror of https://github.com/GNOME/gimp.git
libgimpmath: move docs from template files to inline comments
This commit is contained in:
parent
a5e28dec57
commit
2ce4075eeb
|
@ -12,6 +12,7 @@
|
|||
/libgimpmath-undeclared.txt
|
||||
/libgimpmath-undocumented.txt
|
||||
/html
|
||||
/tmpl
|
||||
/xml
|
||||
/version
|
||||
/.libs
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
/libgimpmath-unused.sgml
|
||||
/*.bak
|
|
@ -1,78 +0,0 @@
|
|||
<!-- ##### SECTION Title ##### -->
|
||||
GimpMath
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Mathematical definitions and macros.
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
Mathematical definitions and macros. These macros should be used
|
||||
rather than the ones from math.h for enhanced portability.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### MACRO RINT ##### -->
|
||||
<para>
|
||||
This macro rounds its argument @x to an integer value in floating point
|
||||
format.
|
||||
</para>
|
||||
|
||||
@x: the value to be rounded.
|
||||
|
||||
|
||||
<!-- ##### MACRO ROUND ##### -->
|
||||
<para>
|
||||
This macro rounds its argument @x to the nearest integer.
|
||||
</para>
|
||||
|
||||
@x: the value to be rounded.
|
||||
|
||||
|
||||
<!-- ##### MACRO SQR ##### -->
|
||||
<para>
|
||||
This macro squares its argument @x.
|
||||
</para>
|
||||
|
||||
@x: the value to be squared.
|
||||
|
||||
|
||||
<!-- ##### MACRO MAX255 ##### -->
|
||||
<para>
|
||||
This macro limits it argument @a, an (0-511) int, to 255.
|
||||
</para>
|
||||
|
||||
@a: the value to be limited.
|
||||
|
||||
|
||||
<!-- ##### MACRO CLAMP0255 ##### -->
|
||||
<para>
|
||||
This macro clamps its argument @a, an int32-range int, between 0 and
|
||||
255 inclusive.
|
||||
</para>
|
||||
|
||||
@a: the value to be clamped.
|
||||
|
||||
|
||||
<!-- ##### MACRO gimp_deg_to_rad ##### -->
|
||||
<para>
|
||||
This macro converts its argument @angle from degree to radian.
|
||||
</para>
|
||||
|
||||
@angle: the angle to be converted.
|
||||
|
||||
|
||||
<!-- ##### MACRO gimp_rad_to_deg ##### -->
|
||||
<para>
|
||||
This macro converts its argument @angle from radian to degree.
|
||||
</para>
|
||||
|
||||
@angle: the angle to be converted.
|
||||
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
<!-- ##### SECTION Title ##### -->
|
||||
GimpMatrix
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Utilities to set up and manipulate 3x3 transformation matrices.
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
When doing image manipulation you will often need 3x3 transformation
|
||||
matrices that define translation, rotation, scaling, shearing and
|
||||
arbitrary perspective transformations using a 3x3 matrix. Here you'll
|
||||
find a set of utility functions to set up those matrices and to perform
|
||||
basic matrix manipulations and tests.
|
||||
</para>
|
||||
<para>
|
||||
Each matrix class has a 2 dimensional gdouble coeff member. The
|
||||
element for row r and column c of the matrix is coeff[r][c].
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GimpVector2
|
||||
</para>
|
||||
<para>
|
||||
#GimpVector3
|
||||
</para>
|
||||
<para>
|
||||
#GimpVector4
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GimpMatrix2 ##### -->
|
||||
<para>
|
||||
A two by two matrix.
|
||||
</para>
|
||||
|
||||
@coeff:
|
||||
|
||||
<!-- ##### STRUCT GimpMatrix3 ##### -->
|
||||
<para>
|
||||
A three by three matrix.
|
||||
</para>
|
||||
|
||||
@coeff:
|
||||
|
||||
<!-- ##### STRUCT GimpMatrix4 ##### -->
|
||||
<para>
|
||||
A four by four matrix.
|
||||
</para>
|
||||
|
||||
@coeff:
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix2_identity ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix2_mult ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix1:
|
||||
@matrix2:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_identity ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_mult ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix1:
|
||||
@matrix2:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_translate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@x:
|
||||
@y:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_scale ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@x:
|
||||
@y:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_rotate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@theta:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_xshear ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@amount:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_yshear ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@amount:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_affine ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@a:
|
||||
@b:
|
||||
@c:
|
||||
@d:
|
||||
@e:
|
||||
@f:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_transform_point ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@x:
|
||||
@y:
|
||||
@newx:
|
||||
@newy:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_determinant ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_invert ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_is_identity ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_is_diagonal ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_is_affine ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix3_is_simple ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_matrix4_to_deg ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@matrix:
|
||||
@a:
|
||||
@b:
|
||||
@c:
|
||||
|
||||
|
||||
<!-- ##### MACRO GIMP_TYPE_MATRIX2 ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GIMP_TYPE_PARAM_MATRIX2 ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GIMP_IS_PARAM_SPEC_MATRIX2 ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pspec:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_param_spec_matrix2 ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@name:
|
||||
@nick:
|
||||
@blurb:
|
||||
@default_value:
|
||||
@flags:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### MACRO GIMP_VALUE_HOLDS_MATRIX2 ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@value:
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<!-- ##### SECTION Title ##### -->
|
||||
GimpMD5
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
the MD5 message-digest algorithm
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_md5_get_digest ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@buffer_size:
|
||||
@digest:
|
||||
|
||||
|
|
@ -1,482 +0,0 @@
|
|||
<!-- ##### SECTION Title ##### -->
|
||||
GimpVector
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Utilities to set up and manipulate vectors.
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
Utilities to set up and manipulate vectors.
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GimpMatrix3
|
||||
</para>
|
||||
<para>
|
||||
#GimpMatrix4
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GimpVector2 ##### -->
|
||||
<para>
|
||||
A two dimensional vector.
|
||||
</para>
|
||||
|
||||
@x:
|
||||
@y:
|
||||
|
||||
<!-- ##### STRUCT GimpVector3 ##### -->
|
||||
<para>
|
||||
A three dimensional vector.
|
||||
</para>
|
||||
|
||||
@x:
|
||||
@y:
|
||||
@z:
|
||||
|
||||
<!-- ##### STRUCT GimpVector4 ##### -->
|
||||
<para>
|
||||
A four dimensional vector.
|
||||
</para>
|
||||
|
||||
@x:
|
||||
@y:
|
||||
@z:
|
||||
@w:
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@x:
|
||||
@y:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@x:
|
||||
@y:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_length_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_mul ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@factor:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_mul_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@factor:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_normalize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_normalize_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_neg ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_neg_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_add ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@result:
|
||||
@vector1:
|
||||
@vector2:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_add_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_sub ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@result:
|
||||
@vector1:
|
||||
@vector2:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_sub_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_inner_product ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_inner_product_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_cross_product ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_cross_product_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_rotate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@alpha:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector2_rotate_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@alpha:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@x:
|
||||
@y:
|
||||
@z:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@x:
|
||||
@y:
|
||||
@z:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_length_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_mul ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@factor:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_mul_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@factor:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_normalize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_normalize_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_neg ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_neg_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_add ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@result:
|
||||
@vector1:
|
||||
@vector2:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_add_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_sub ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@result:
|
||||
@vector1:
|
||||
@vector2:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_sub_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_inner_product ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_inner_product_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_cross_product ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_cross_product_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector1:
|
||||
@vector2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_rotate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@alpha:
|
||||
@beta:
|
||||
@gamma:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector3_rotate_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@vector:
|
||||
@alpha:
|
||||
@beta:
|
||||
@gamma:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector_2d_to_3d ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@sx:
|
||||
@sy:
|
||||
@w:
|
||||
@h:
|
||||
@x:
|
||||
@y:
|
||||
@vp:
|
||||
@p:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector_2d_to_3d_val ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@sx:
|
||||
@sy:
|
||||
@w:
|
||||
@h:
|
||||
@x:
|
||||
@y:
|
||||
@vp:
|
||||
@p:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_vector_3d_to_2d ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@sx:
|
||||
@sy:
|
||||
@w:
|
||||
@h:
|
||||
@x:
|
||||
@y:
|
||||
@vp:
|
||||
@p:
|
||||
|
||||
|
|
@ -39,31 +39,78 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Some portability enhancing stuff. For use both by the gimp app
|
||||
* as well as plug-ins and modules.
|
||||
*
|
||||
* Include this instead of just <math.h>.
|
||||
*/
|
||||
|
||||
/* Use RINT() instead of rint() */
|
||||
/**
|
||||
* SECTION: gimpmath
|
||||
* @title: GimpMath
|
||||
* @short_description: Mathematical definitions and macros.
|
||||
*
|
||||
* Mathematical definitions and macros for use both by the GIMP
|
||||
* application and plug-ins. These macros should be used rather than
|
||||
* the ones from <math.h> for enhanced portability.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* RINT:
|
||||
* @x: the value to be rounded
|
||||
*
|
||||
* This macro rounds its argument @x to an integer value in floating
|
||||
* point format. Use RINT() instead of rint().
|
||||
**/
|
||||
#ifdef HAVE_RINT
|
||||
#define RINT(x) rint(x)
|
||||
#else
|
||||
#define RINT(x) floor ((x) + 0.5)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ROUND:
|
||||
* @x: the value to be rounded.
|
||||
*
|
||||
* This macro rounds its argument @x to the nearest integer.
|
||||
**/
|
||||
#define ROUND(x) ((int) ((x) + 0.5))
|
||||
|
||||
/* Square */
|
||||
/**
|
||||
* SQR:
|
||||
* @x: the value to be squared.
|
||||
*
|
||||
* This macro squares its argument @x.
|
||||
**/
|
||||
#define SQR(x) ((x) * (x))
|
||||
|
||||
/* Limit a (0->511) int to 255 */
|
||||
/**
|
||||
* MAX255:
|
||||
* @a: the value to be limited.
|
||||
*
|
||||
* This macro limits it argument @a, an (0-511) int, to 255.
|
||||
**/
|
||||
#define MAX255(a) ((a) | (((a) & 256) - (((a) & 256) >> 8)))
|
||||
|
||||
/* Clamp a >>int32<<-range int between 0 and 255 inclusive */
|
||||
/**
|
||||
* CLAMP0255:
|
||||
* @a: the value to be clamped.
|
||||
*
|
||||
* This macro clamps its argument @a, an int32-range int, between 0
|
||||
* and 255 inclusive.
|
||||
**/
|
||||
#define CLAMP0255(a) CLAMP(a,0,255)
|
||||
|
||||
/**
|
||||
* gimp_deg_to_rad:
|
||||
* @angle: the angle to be converted.
|
||||
*
|
||||
* This macro converts its argument @angle from degree to radian.
|
||||
**/
|
||||
#define gimp_deg_to_rad(angle) ((angle) * (2.0 * G_PI) / 360.0)
|
||||
|
||||
/**
|
||||
* gimp_rad_to_deg:
|
||||
* @angle: the angle to be converted.
|
||||
*
|
||||
* This macro converts its argument @angle from radian to degree.
|
||||
**/
|
||||
#define gimp_rad_to_deg(angle) ((angle) * 360.0 / (2.0 * G_PI))
|
||||
|
||||
|
||||
|
|
|
@ -26,6 +26,24 @@
|
|||
#include "gimpmath.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION: gimpmatrix
|
||||
* @title: GimpMatrix
|
||||
* @short_description: Utilities to set up and manipulate 3x3
|
||||
* transformation matrices.
|
||||
* @see_also: #GimpVector2, #GimpVector3, #GimpVector4
|
||||
*
|
||||
* When doing image manipulation you will often need 3x3
|
||||
* transformation matrices that define translation, rotation, scaling,
|
||||
* shearing and arbitrary perspective transformations using a 3x3
|
||||
* matrix. Here you'll find a set of utility functions to set up those
|
||||
* matrices and to perform basic matrix manipulations and tests.
|
||||
*
|
||||
* Each matrix class has a 2 dimensional gdouble coeff member. The
|
||||
* element for row r and column c of the matrix is coeff[r][c].
|
||||
**/
|
||||
|
||||
|
||||
#define EPSILON 1e-6
|
||||
|
||||
|
||||
|
|
|
@ -26,16 +26,34 @@ G_BEGIN_DECLS
|
|||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
/**
|
||||
* GimpMatrix2
|
||||
* @coeff: the coefficients
|
||||
*
|
||||
* A two by two matrix.
|
||||
**/
|
||||
struct _GimpMatrix2
|
||||
{
|
||||
gdouble coeff[2][2];
|
||||
};
|
||||
|
||||
/**
|
||||
* GimpMatrix3
|
||||
* @coeff: the coefficients
|
||||
*
|
||||
* A three by three matrix.
|
||||
**/
|
||||
struct _GimpMatrix3
|
||||
{
|
||||
gdouble coeff[3][3];
|
||||
};
|
||||
|
||||
/**
|
||||
* GimpMatrix4
|
||||
* @coeff: the coefficients
|
||||
*
|
||||
* A four by four matrix.
|
||||
**/
|
||||
struct _GimpMatrix4
|
||||
{
|
||||
gdouble coeff[4][4];
|
||||
|
|
|
@ -13,6 +13,15 @@
|
|||
#include "gimpmd5.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION: gimpmd5
|
||||
* @title: GimpMD5
|
||||
* @short_description: The MD5 message-digest algorithm
|
||||
*
|
||||
* The MD5 message-digest algorithm
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* gimp_md5_get_digest:
|
||||
* @buffer: byte buffer
|
||||
|
|
|
@ -33,6 +33,16 @@
|
|||
#include "gimpmath.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION: gimpvector
|
||||
* @title: GimpVector
|
||||
* @short_description: Utilities to set up and manipulate vectors.
|
||||
* @see_also: #GimpMatrix2, #GimpMatrix3, #GimpMatrix4
|
||||
*
|
||||
* Utilities to set up and manipulate vectors.
|
||||
**/
|
||||
|
||||
|
||||
/*************************/
|
||||
/* Some useful constants */
|
||||
/*************************/
|
||||
|
|
|
@ -29,16 +29,40 @@ G_BEGIN_DECLS
|
|||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
/**
|
||||
* GimpVector2:
|
||||
* @x: the x axis
|
||||
* @y: the y axis
|
||||
*
|
||||
* A two dimensional vector.
|
||||
**/
|
||||
struct _GimpVector2
|
||||
{
|
||||
gdouble x, y;
|
||||
};
|
||||
|
||||
/**
|
||||
* GimpVector3:
|
||||
* @x: the x axis
|
||||
* @y: the y axis
|
||||
* @z: the z axis
|
||||
*
|
||||
* A three dimensional vector.
|
||||
**/
|
||||
struct _GimpVector3
|
||||
{
|
||||
gdouble x, y, z;
|
||||
};
|
||||
|
||||
/**
|
||||
* GimpVector4:
|
||||
* @x: the x axis
|
||||
* @y: the y axis
|
||||
* @z: the z axis
|
||||
* @w: the w axis
|
||||
*
|
||||
* A four dimensional vector.
|
||||
**/
|
||||
struct _GimpVector4
|
||||
{
|
||||
gdouble x, y, z, w;
|
||||
|
|
Loading…
Reference in New Issue