2000-05-28 08:00:28 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2000-02-26 11:41:06 +08:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimpmatrix.h
|
2006-01-12 08:50:44 +08:00
|
|
|
* Copyright (C) 1998 Jay Cox <jaycox@gimp.org>
|
1998-10-14 10:54:02 +08:00
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
1999-11-18 05:13:50 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-10-14 10:54:02 +08:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
1998-10-14 10:54:02 +08:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
1999-12-26 15:54:39 +08:00
|
|
|
* Lesser General Public License for more details.
|
1998-10-14 10:54:02 +08:00
|
|
|
*
|
1999-11-18 05:13:50 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
1998-10-14 10:54:02 +08:00
|
|
|
*/
|
|
|
|
|
2000-02-15 00:29:41 +08:00
|
|
|
#ifndef __GIMP_MATRIX_H__
|
|
|
|
#define __GIMP_MATRIX_H__
|
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_BEGIN_DECLS
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2001-01-24 07:56:18 +08:00
|
|
|
/* For information look into the C source or the html documentation */
|
2000-05-31 07:38:46 +08:00
|
|
|
|
2003-07-08 00:22:45 +08:00
|
|
|
struct _GimpMatrix2
|
|
|
|
{
|
|
|
|
gdouble coeff[2][2];
|
|
|
|
};
|
|
|
|
|
2003-07-07 21:50:48 +08:00
|
|
|
struct _GimpMatrix3
|
|
|
|
{
|
|
|
|
gdouble coeff[3][3];
|
|
|
|
};
|
2000-02-15 00:29:41 +08:00
|
|
|
|
2003-07-07 21:50:48 +08:00
|
|
|
struct _GimpMatrix4
|
|
|
|
{
|
|
|
|
gdouble coeff[4][4];
|
|
|
|
};
|
2000-02-15 00:29:41 +08:00
|
|
|
|
2005-01-22 08:43:31 +08:00
|
|
|
#define GIMP_TYPE_MATRIX2 (gimp_matrix2_get_type ())
|
|
|
|
#define GIMP_VALUE_HOLDS_MATRIX2(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_MATRIX2))
|
|
|
|
|
|
|
|
GType gimp_matrix2_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
|
|
|
|
#define GIMP_TYPE_PARAM_MATRIX2 (gimp_param_matrix2_get_type ())
|
|
|
|
#define GIMP_IS_PARAM_SPEC_MATRIX2(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_MATRIX2))
|
|
|
|
|
|
|
|
GType gimp_param_matrix2_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
GParamSpec * gimp_param_spec_matrix2 (const gchar *name,
|
|
|
|
const gchar *nick,
|
|
|
|
const gchar *blurb,
|
|
|
|
const GimpMatrix2 *default_value,
|
|
|
|
GParamFlags flags);
|
|
|
|
|
2000-02-15 00:29:41 +08:00
|
|
|
|
2003-07-08 00:22:45 +08:00
|
|
|
void gimp_matrix2_identity (GimpMatrix2 *matrix);
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix2_mult (const GimpMatrix2 *matrix1,
|
2003-09-28 07:02:39 +08:00
|
|
|
GimpMatrix2 *matrix2);
|
2003-07-08 00:22:45 +08:00
|
|
|
|
2003-07-08 02:36:00 +08:00
|
|
|
void gimp_matrix3_identity (GimpMatrix3 *matrix);
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix3_mult (const GimpMatrix3 *matrix1,
|
2003-09-28 07:02:39 +08:00
|
|
|
GimpMatrix3 *matrix2);
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix3_translate (GimpMatrix3 *matrix,
|
2003-09-28 07:02:39 +08:00
|
|
|
gdouble x,
|
|
|
|
gdouble y);
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix3_scale (GimpMatrix3 *matrix,
|
2003-09-28 07:02:39 +08:00
|
|
|
gdouble x,
|
|
|
|
gdouble y);
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix3_rotate (GimpMatrix3 *matrix,
|
2003-09-28 07:02:39 +08:00
|
|
|
gdouble theta);
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix3_xshear (GimpMatrix3 *matrix,
|
2003-09-28 07:02:39 +08:00
|
|
|
gdouble amount);
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix3_yshear (GimpMatrix3 *matrix,
|
2003-09-28 07:02:39 +08:00
|
|
|
gdouble amount);
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix3_affine (GimpMatrix3 *matrix,
|
|
|
|
gdouble a,
|
|
|
|
gdouble b,
|
|
|
|
gdouble c,
|
|
|
|
gdouble d,
|
|
|
|
gdouble e,
|
|
|
|
gdouble f);
|
|
|
|
|
2003-07-07 21:50:48 +08:00
|
|
|
gdouble gimp_matrix3_determinant (const GimpMatrix3 *matrix);
|
|
|
|
void gimp_matrix3_invert (GimpMatrix3 *matrix);
|
2000-02-15 00:29:41 +08:00
|
|
|
|
2003-07-07 21:50:48 +08:00
|
|
|
gboolean gimp_matrix3_is_identity (const GimpMatrix3 *matrix);
|
2005-03-20 08:09:29 +08:00
|
|
|
gboolean gimp_matrix3_is_diagonal (const GimpMatrix3 *matrix);
|
|
|
|
gboolean gimp_matrix3_is_affine (const GimpMatrix3 *matrix);
|
2003-07-07 21:50:48 +08:00
|
|
|
gboolean gimp_matrix3_is_simple (const GimpMatrix3 *matrix);
|
|
|
|
|
2003-09-12 21:23:01 +08:00
|
|
|
void gimp_matrix3_transform_point (const GimpMatrix3 *matrix,
|
2003-09-28 07:02:39 +08:00
|
|
|
gdouble x,
|
|
|
|
gdouble y,
|
|
|
|
gdouble *newx,
|
|
|
|
gdouble *newy);
|
2003-07-07 21:50:48 +08:00
|
|
|
|
|
|
|
void gimp_matrix4_to_deg (const GimpMatrix4 *matrix,
|
2003-09-28 07:02:39 +08:00
|
|
|
gdouble *a,
|
|
|
|
gdouble *b,
|
|
|
|
gdouble *c);
|
1998-10-14 10:54:02 +08:00
|
|
|
|
2000-05-31 07:38:46 +08:00
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_END_DECLS
|
1998-10-14 10:54:02 +08:00
|
|
|
|
2000-05-31 07:38:46 +08:00
|
|
|
#endif /* __GIMP_MATRIX_H__ */
|