gimp/libgimpmath/gimpvector.h

161 lines
8.7 KiB
C
Raw Normal View History

/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
added a note about apptype.h and about not including headers in headers. 2001-02-14 Michael Natterer <mitch@gimp.org> * HACKING: added a note about apptype.h and about not including headers in headers. * app/apptypes.h: added GimpTool and BitmapCursor. * app/cursorutil.h * app/devices.h * app/draw_core.h * app/tools/color_picker.h * app/tools/tool.h * app/tools/tool_options.h * app/gimpcontext.h: removed includes of "tools/tool.h" * app/gimprc.[ch]: indentadion cleanup, added "module_db_load_inhibit". * app/module_db.c: removed the above variable here. * app/gimpdata.[ch]: added a vitrual "duplicate" method. * app/gimpbrush.[ch] * app/gimpbrushgenerated.[ch] * app/gimpbrushpipe.[ch] * app/gimpgradient.[ch] * app/gimppalette.[ch] * app/gimppattern.[ch]: all "load", "new" and "get_standard" functions return a GimpData pointer now. * app/gimpdatafactory.[ch]: made some stuff const. * app/gimpdatafactoryview.c: activate the "duplicate" button and set the initial button sensitivity correctly. * app/brush_select.c * app/gradient_select.c * app/pattern_select.c: use the new GimpDataFactoryView. * libgimp/Makefile.am: grouped the file to sort out what _may_ go to subdirs or separate libs. * libgimp/gimpenv.[ch]: added many "const". * app/app_procs.c * app/brush_edit.c * app/gimpcontext.c * app/gimpdnd.c * app/gradient_editor.c * app/palette.c * app/palette_import.c * app/user_install.c: many related changes. * libgimpmath/gimpmathtypes.h * libgimpmath/gimpvector.[ch]: minor cleanups. * plug-ins/script-fu/script-fu.c: gimp_data_directory() is const now.
2001-02-14 22:57:14 +08:00
* gimpvector.h
*
* The gimp_vector* functions were taken from:
* GCK - The General Convenience Kit
* Copyright (C) 1996 Tom Bech
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#if !defined (__GIMP_MATH_H_INSIDE__) && !defined (GIMP_MATH_COMPILATION)
#error "Only <libgimpmath/gimpmath.h> can be included directly."
#endif
#ifndef __GIMP_VECTOR_H__
#define __GIMP_VECTOR_H__
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
/* Two dimensional vector functions */
/* ================================ */
GimpVector2 gimp_vector2_new (gdouble x,
gdouble y);
void gimp_vector2_set (GimpVector2 *vector,
gdouble x,
gdouble y);
2003-09-28 07:02:39 +08:00
gdouble gimp_vector2_length (const GimpVector2 *vector);
gdouble gimp_vector2_length_val (GimpVector2 vector);
void gimp_vector2_mul (GimpVector2 *vector,
gdouble factor);
GimpVector2 gimp_vector2_mul_val (GimpVector2 vector,
gdouble factor);
void gimp_vector2_normalize (GimpVector2 *vector);
GimpVector2 gimp_vector2_normalize_val (GimpVector2 vector);
void gimp_vector2_neg (GimpVector2 *vector);
GimpVector2 gimp_vector2_neg_val (GimpVector2 vector);
void gimp_vector2_add (GimpVector2 *result,
const GimpVector2 *vector1,
const GimpVector2 *vector2);
GimpVector2 gimp_vector2_add_val (GimpVector2 vector1,
GimpVector2 vector2);
2003-09-28 07:02:39 +08:00
void gimp_vector2_sub (GimpVector2 *result,
const GimpVector2 *vector1,
const GimpVector2 *vector2);
GimpVector2 gimp_vector2_sub_val (GimpVector2 vector1,
GimpVector2 vector2);
gdouble gimp_vector2_inner_product (const GimpVector2 *vector1,
2003-09-28 07:02:39 +08:00
const GimpVector2 *vector2);
gdouble gimp_vector2_inner_product_val (GimpVector2 vector1,
GimpVector2 vector2);
GimpVector2 gimp_vector2_cross_product (const GimpVector2 *vector1,
const GimpVector2 *vector2);
GimpVector2 gimp_vector2_cross_product_val (GimpVector2 vector1,
2003-09-28 07:02:39 +08:00
GimpVector2 vector2);
void gimp_vector2_rotate (GimpVector2 *vector,
gdouble alpha);
GimpVector2 gimp_vector2_rotate_val (GimpVector2 vector,
gdouble alpha);
GimpVector2 gimp_vector2_normal (GimpVector2 *vector);
GimpVector2 gimp_vector2_normal_val (GimpVector2 vector);
/* Three dimensional vector functions */
/* ================================== */
GimpVector3 gimp_vector3_new (gdouble x,
gdouble y,
gdouble z);
void gimp_vector3_set (GimpVector3 *vector,
gdouble x,
gdouble y,
gdouble z);
2003-09-28 07:02:39 +08:00
gdouble gimp_vector3_length (const GimpVector3 *vector);
gdouble gimp_vector3_length_val (GimpVector3 vector);
2003-09-28 07:02:39 +08:00
void gimp_vector3_mul (GimpVector3 *vector,
gdouble factor);
GimpVector3 gimp_vector3_mul_val (GimpVector3 vector,
gdouble factor);
void gimp_vector3_normalize (GimpVector3 *vector);
GimpVector3 gimp_vector3_normalize_val (GimpVector3 vector);
void gimp_vector3_neg (GimpVector3 *vector);
GimpVector3 gimp_vector3_neg_val (GimpVector3 vector);
void gimp_vector3_add (GimpVector3 *result,
const GimpVector3 *vector1,
const GimpVector3 *vector2);
GimpVector3 gimp_vector3_add_val (GimpVector3 vector1,
GimpVector3 vector2);
2003-09-28 07:02:39 +08:00
void gimp_vector3_sub (GimpVector3 *result,
const GimpVector3 *vector1,
const GimpVector3 *vector2);
GimpVector3 gimp_vector3_sub_val (GimpVector3 vector1,
GimpVector3 vector2);
gdouble gimp_vector3_inner_product (const GimpVector3 *vector1,
2003-09-28 07:02:39 +08:00
const GimpVector3 *vector2);
gdouble gimp_vector3_inner_product_val (GimpVector3 vector1,
GimpVector3 vector2);
GimpVector3 gimp_vector3_cross_product (const GimpVector3 *vector1,
const GimpVector3 *vector2);
GimpVector3 gimp_vector3_cross_product_val (GimpVector3 vector1,
2003-09-28 07:02:39 +08:00
GimpVector3 vector2);
void gimp_vector3_rotate (GimpVector3 *vector,
gdouble alpha,
gdouble beta,
gdouble gamma);
GimpVector3 gimp_vector3_rotate_val (GimpVector3 vector,
gdouble alpha,
gdouble beta,
gdouble gamma);
/* 2d <-> 3d Vector projection functions */
/* ===================================== */
2003-09-28 07:02:39 +08:00
void gimp_vector_2d_to_3d (gint sx,
gint sy,
gint w,
gint h,
gint x,
gint y,
const GimpVector3 *vp,
GimpVector3 *p);
GimpVector3 gimp_vector_2d_to_3d_val (gint sx,
gint sy,
gint w,
gint h,
gint x,
gint y,
GimpVector3 vp,
GimpVector3 p);
void gimp_vector_3d_to_2d (gint sx,
gint sy,
gint w,
gint h,
gdouble *x,
gdouble *y,
const GimpVector3 *vp,
const GimpVector3 *p);
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
G_END_DECLS
#endif /* __GIMP_VECTOR_H__ */