app: add the MIN4() and MAX4() macros to gimp-utils.h
instead of having them in 5 .c files.
This commit is contained in:
@ -24,6 +24,7 @@
|
|||||||
#include "core-types.h"
|
#include "core-types.h"
|
||||||
|
|
||||||
#include "gimp-transform-resize.h"
|
#include "gimp-transform-resize.h"
|
||||||
|
#include "gimp-utils.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined (HAVE_FINITE)
|
#if defined (HAVE_FINITE)
|
||||||
@ -36,9 +37,7 @@
|
|||||||
#error "no FINITE() implementation available?!"
|
#error "no FINITE() implementation available?!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EPSILON 0.00000001
|
#define EPSILON 0.00000001
|
||||||
#define MIN4(a,b,c,d) MIN(MIN((a),(b)),MIN((c),(d)))
|
|
||||||
#define MAX4(a,b,c,d) MAX(MAX((a),(b)),MAX((c),(d)))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
g_timer_destroy (_timer); }
|
g_timer_destroy (_timer); }
|
||||||
|
|
||||||
|
|
||||||
|
#define MIN4(a,b,c,d) MIN (MIN ((a), (b)), MIN ((c), (d)))
|
||||||
|
#define MAX4(a,b,c,d) MAX (MAX ((a), (b)), MAX ((c), (d)))
|
||||||
|
|
||||||
|
|
||||||
gint64 gimp_g_type_instance_get_memsize (GTypeInstance *instance);
|
gint64 gimp_g_type_instance_get_memsize (GTypeInstance *instance);
|
||||||
gint64 gimp_g_object_get_memsize (GObject *object);
|
gint64 gimp_g_object_get_memsize (GObject *object);
|
||||||
gint64 gimp_g_hash_table_get_memsize (GHashTable *hash,
|
gint64 gimp_g_hash_table_get_memsize (GHashTable *hash,
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "core/gimpchannel.h"
|
#include "core/gimpchannel.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimp-transform-utils.h"
|
#include "core/gimp-transform-utils.h"
|
||||||
|
#include "core/gimp-utils.h"
|
||||||
|
|
||||||
#include "gimpcanvas.h"
|
#include "gimpcanvas.h"
|
||||||
#include "gimpcanvastransformpreview.h"
|
#include "gimpcanvastransformpreview.h"
|
||||||
@ -46,9 +47,6 @@
|
|||||||
#define INT_MULT3(a,b,c,t) ((t) = (a) * (b) * (c) + 0x7F5B, \
|
#define INT_MULT3(a,b,c,t) ((t) = (a) * (b) * (c) + 0x7F5B, \
|
||||||
((((t) >> 7) + (t)) >> 16))
|
((((t) >> 7) + (t)) >> 16))
|
||||||
|
|
||||||
#define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d))
|
|
||||||
#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d))
|
|
||||||
|
|
||||||
#define MAX_SUB_COLS 6 /* number of columns and */
|
#define MAX_SUB_COLS 6 /* number of columns and */
|
||||||
#define MAX_SUB_ROWS 6 /* rows to use in perspective preview subdivision */
|
#define MAX_SUB_ROWS 6 /* rows to use in perspective preview subdivision */
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimppickable.h"
|
#include "core/gimppickable.h"
|
||||||
#include "core/gimp-transform-region.h"
|
#include "core/gimp-transform-region.h"
|
||||||
|
#include "core/gimp-utils.h"
|
||||||
|
|
||||||
#include "gimpperspectiveclone.h"
|
#include "gimpperspectiveclone.h"
|
||||||
#include "gimpperspectivecloneoptions.h"
|
#include "gimpperspectivecloneoptions.h"
|
||||||
@ -46,10 +47,6 @@
|
|||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
#define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d))
|
|
||||||
#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d))
|
|
||||||
|
|
||||||
|
|
||||||
static void gimp_perspective_clone_finalize (GObject *object);
|
static void gimp_perspective_clone_finalize (GObject *object);
|
||||||
|
|
||||||
static gboolean gimp_perspective_clone_start (GimpPaintCore *paint_core,
|
static gboolean gimp_perspective_clone_start (GimpPaintCore *paint_core,
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "core/gimpprogress.h"
|
#include "core/gimpprogress.h"
|
||||||
#include "core/gimptoolinfo.h"
|
#include "core/gimptoolinfo.h"
|
||||||
#include "core/gimp-transform-utils.h"
|
#include "core/gimp-transform-utils.h"
|
||||||
|
#include "core/gimp-utils.h"
|
||||||
|
|
||||||
#include "vectors/gimpvectors.h"
|
#include "vectors/gimpvectors.h"
|
||||||
#include "vectors/gimpstroke.h"
|
#include "vectors/gimpstroke.h"
|
||||||
@ -68,8 +69,6 @@
|
|||||||
|
|
||||||
#define RESPONSE_RESET 1
|
#define RESPONSE_RESET 1
|
||||||
#define MIN_HANDLE_SIZE 6
|
#define MIN_HANDLE_SIZE 6
|
||||||
#define MIN4(a,b,c,d) MIN(MIN((a),(b)),MIN((c),(d)))
|
|
||||||
#define MAX4(a,b,c,d) MAX(MAX((a),(b)),MAX((c),(d)))
|
|
||||||
|
|
||||||
|
|
||||||
static void gimp_transform_tool_finalize (GObject *object);
|
static void gimp_transform_tool_finalize (GObject *object);
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include "widgets-types.h"
|
#include "widgets-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp-utils.h"
|
||||||
|
|
||||||
#include "gimpoverlaybox.h"
|
#include "gimpoverlaybox.h"
|
||||||
#include "gimpoverlaychild.h"
|
#include "gimpoverlaychild.h"
|
||||||
|
|
||||||
@ -491,9 +493,6 @@ gimp_overlay_child_transform_bounds (GimpOverlayChild *child,
|
|||||||
cairo_matrix_transform_point (&child->matrix, &x3, &y3);
|
cairo_matrix_transform_point (&child->matrix, &x3, &y3);
|
||||||
cairo_matrix_transform_point (&child->matrix, &x4, &y4);
|
cairo_matrix_transform_point (&child->matrix, &x4, &y4);
|
||||||
|
|
||||||
#define MIN4(a,b,c,d) MIN(MIN((a),(b)),MIN((c),(d)))
|
|
||||||
#define MAX4(a,b,c,d) MAX(MAX((a),(b)),MAX((c),(d)))
|
|
||||||
|
|
||||||
bounds_box->x = (gint) floor (MIN4 (x1, x2, x3, x4));
|
bounds_box->x = (gint) floor (MIN4 (x1, x2, x3, x4));
|
||||||
bounds_box->y = (gint) floor (MIN4 (y1, y2, y3, y4));
|
bounds_box->y = (gint) floor (MIN4 (y1, y2, y3, y4));
|
||||||
bounds_box->width = (gint) ceil (MAX4 (x1, x2, x3, x4)) - bounds_box->x;
|
bounds_box->width = (gint) ceil (MAX4 (x1, x2, x3, x4)) - bounds_box->x;
|
||||||
|
Reference in New Issue
Block a user