mirror of https://github.com/GNOME/gimp.git
Bill Skaggs <weskaggs@primate.ucdavis.edu>
Merged 24584:24625 from trunk. svn path=/branches/weskaggs/; revision=24628
This commit is contained in:
parent
71a4048d1c
commit
54f562adfa
|
@ -1,3 +1,7 @@
|
|||
2008-01-16 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||
|
||||
Merged 24584:24625 from trunk.
|
||||
|
||||
2008-01-16 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||
|
||||
Preliminary experimental implementation of data chooser
|
||||
|
|
|
@ -106,6 +106,7 @@ color_balance_create_lookup_tables (ColorBalance *cb)
|
|||
(cb->magenta_green[GIMP_MIDTONES] > 0) ? midtones_add : midtones_sub;
|
||||
magenta_green_transfer[GIMP_HIGHLIGHTS] =
|
||||
(cb->magenta_green[GIMP_HIGHLIGHTS] > 0) ? highlights_add : highlights_sub;
|
||||
|
||||
yellow_blue_transfer[GIMP_SHADOWS] =
|
||||
(cb->yellow_blue[GIMP_SHADOWS] > 0) ? shadows_add : shadows_sub;
|
||||
yellow_blue_transfer[GIMP_MIDTONES] =
|
||||
|
@ -188,7 +189,7 @@ color_balance (ColorBalance *cb,
|
|||
|
||||
d[RED_PIX] = r_n;
|
||||
d[GREEN_PIX] = g_n;
|
||||
d[BLUE_PIX] = b_n;
|
||||
d[BLUE_PIX] = b_n;
|
||||
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
|
|
|
@ -190,6 +190,11 @@ struct _GimpCoords
|
|||
gdouble xtilt;
|
||||
gdouble ytilt;
|
||||
gdouble wheel;
|
||||
gdouble delta_time;
|
||||
gdouble delta_x;
|
||||
gdouble delta_y;
|
||||
gdouble distance;
|
||||
gdouble velocity;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -80,6 +80,9 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
#define DEFAULT_EVENT_SMOOTHING 0.7
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gimp_display_shell_vscrollbar_update (GtkAdjustment *adjustment,
|
||||
|
@ -600,18 +603,18 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
|||
GdkEvent *event,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
GimpDisplay *display;
|
||||
GimpImage *image;
|
||||
Gimp *gimp;
|
||||
GdkDisplay *gdk_display;
|
||||
GimpTool *active_tool;
|
||||
GimpCoords display_coords;
|
||||
GimpCoords image_coords;
|
||||
GdkModifierType state;
|
||||
guint32 time;
|
||||
gboolean device_changed = FALSE;
|
||||
gboolean return_val = FALSE;
|
||||
gboolean update_sw_cursor = FALSE;
|
||||
GimpDisplay *display;
|
||||
GimpImage *image;
|
||||
Gimp *gimp;
|
||||
GdkDisplay *gdk_display;
|
||||
GimpTool *active_tool;
|
||||
GimpCoords display_coords;
|
||||
GimpCoords image_coords;
|
||||
GdkModifierType state;
|
||||
guint32 time;
|
||||
gboolean device_changed = FALSE;
|
||||
gboolean return_val = FALSE;
|
||||
gboolean update_sw_cursor = FALSE;
|
||||
|
||||
g_return_val_if_fail (GTK_WIDGET_REALIZED (canvas), FALSE);
|
||||
|
||||
|
@ -905,7 +908,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
|||
&image_coords,
|
||||
time, state, display);
|
||||
|
||||
shell->last_motion_time = bevent->time;
|
||||
shell->last_read_motion_time = bevent->time;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1185,7 +1188,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
|||
GdkTimeCoord **history_events;
|
||||
gint n_history_events;
|
||||
|
||||
/* if the first mouse button is down, check for automatic
|
||||
/* if the first mouse button is down, check for automatic
|
||||
* scrolling...
|
||||
*/
|
||||
if ((mevent->x < 0 ||
|
||||
|
@ -1197,11 +1200,19 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
|||
gimp_display_shell_autoscroll_start (shell, state, mevent);
|
||||
}
|
||||
|
||||
if (gimp_tool_control_get_motion_mode (active_tool->control) ==
|
||||
GIMP_MOTION_MODE_EXACT &&
|
||||
/* gdk_device_get_history() has several quirks. First is
|
||||
* that events with borderline timestamps at both ends
|
||||
* are included. Because of that we need to add 1 to
|
||||
* lower border. The second is due to poor X event
|
||||
* resolution. We need to do -1 to ensure that the
|
||||
* amount of events between timestamps is final or
|
||||
* risk loosing some.
|
||||
*/
|
||||
if ((gimp_tool_control_get_motion_mode (active_tool->control) ==
|
||||
GIMP_MOTION_MODE_EXACT) &&
|
||||
gdk_device_get_history (mevent->device, mevent->window,
|
||||
shell->last_motion_time,
|
||||
mevent->time,
|
||||
shell->last_read_motion_time+1,
|
||||
mevent->time - 1,
|
||||
&history_events,
|
||||
&n_history_events))
|
||||
{
|
||||
|
@ -1209,6 +1220,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
|||
|
||||
for (i = 0; i < n_history_events; i++)
|
||||
{
|
||||
|
||||
gimp_display_shell_get_time_coords (shell,
|
||||
mevent->device,
|
||||
history_events[i],
|
||||
|
@ -1234,33 +1246,61 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
|||
x, y, width, height);
|
||||
}
|
||||
|
||||
tool_manager_motion_active (gimp,
|
||||
&image_coords,
|
||||
history_events[i]->time,
|
||||
state,
|
||||
display);
|
||||
/* Early removal of useless events saves CPU time.
|
||||
*/
|
||||
if (gimp_display_shell_eval_event (shell,
|
||||
&image_coords,
|
||||
DEFAULT_EVENT_SMOOTHING,
|
||||
history_events[i]->time))
|
||||
{
|
||||
tool_manager_motion_active (gimp,
|
||||
&image_coords,
|
||||
history_events[i]->time,
|
||||
state,
|
||||
display);
|
||||
}
|
||||
|
||||
shell->last_read_motion_time = history_events[i]->time;
|
||||
}
|
||||
|
||||
gdk_device_free_history (history_events, n_history_events);
|
||||
}
|
||||
else
|
||||
{
|
||||
tool_manager_motion_active (gimp,
|
||||
&image_coords, time, state,
|
||||
display);
|
||||
}
|
||||
/* Early removal of useless events saves CPU time.
|
||||
*/
|
||||
if (gimp_display_shell_eval_event (shell,
|
||||
&image_coords,
|
||||
DEFAULT_EVENT_SMOOTHING,
|
||||
time))
|
||||
{
|
||||
tool_manager_motion_active (gimp,
|
||||
&image_coords,
|
||||
time,
|
||||
state,
|
||||
display);
|
||||
}
|
||||
|
||||
shell->last_motion_time = mevent->time;
|
||||
shell->last_read_motion_time = time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! (state &
|
||||
(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)))
|
||||
{
|
||||
tool_manager_oper_update_active (gimp,
|
||||
&image_coords, state,
|
||||
shell->proximity,
|
||||
display);
|
||||
/* Early removal of useless events saves CPU time.
|
||||
* Smoothing is 0.0 here for coasting.
|
||||
*/
|
||||
if (gimp_display_shell_eval_event (shell, &image_coords, 0.0, time))
|
||||
{
|
||||
tool_manager_oper_update_active (gimp,
|
||||
&image_coords, state,
|
||||
shell->proximity,
|
||||
display);
|
||||
}
|
||||
|
||||
shell->last_read_motion_time = time;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "display-types.h"
|
||||
|
||||
#include "gimpdisplayshell.h"
|
||||
|
@ -131,7 +133,8 @@ gimp_display_shell_get_time_coords (GimpDisplayShell *shell,
|
|||
* requested axis does not exist.
|
||||
*/
|
||||
|
||||
if (gdk_device_get_axis (device, event->axes, GDK_AXIS_PRESSURE, &coords->pressure))
|
||||
if (gdk_device_get_axis (device,
|
||||
event->axes, GDK_AXIS_PRESSURE, &coords->pressure))
|
||||
coords->pressure = CLAMP (coords->pressure, GIMP_COORDS_MIN_PRESSURE,
|
||||
GIMP_COORDS_MAX_PRESSURE);
|
||||
else
|
||||
|
@ -177,3 +180,153 @@ gimp_display_shell_get_device_state (GimpDisplayShell *shell,
|
|||
{
|
||||
gdk_device_get_state (device, shell->canvas->window, NULL, state);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_display_shell_eval_event:
|
||||
* @shell:
|
||||
* @coords:
|
||||
* @inertia_factor:
|
||||
* @time:
|
||||
*
|
||||
* This function evaluates the event to decide if the change is
|
||||
* big enough to need handling and returns FALSE, if change is less
|
||||
* than one image pixel or when smoothed event distance covers less
|
||||
* than one pixel taking a whole lot of load off any draw tools that
|
||||
* have no use for these sub-pixel events anyway. If the event is
|
||||
* seen fit at first look, it is evaluated for speed and smoothed.
|
||||
* Due to lousy time resolution of events pretty strong smoothing is
|
||||
* applied to timestamps for sensible speed result. This function is
|
||||
* also ideal for other event adjustment like pressure curve or
|
||||
* calculating other derived dynamics factors like angular velocity
|
||||
* calculation from tilt values, to allow for even more dynamic
|
||||
* brushes. Calculated distance to last event is stored in GimpCoords
|
||||
* because its a sideproduct of velocity calculation and is currently
|
||||
* calculated in each tool. If they were to use this distance, more
|
||||
* resouces on recalculating the same value would be saved.
|
||||
*
|
||||
* Return value:
|
||||
**/
|
||||
gboolean
|
||||
gimp_display_shell_eval_event (GimpDisplayShell *shell,
|
||||
GimpCoords *coords,
|
||||
gdouble inertia_factor,
|
||||
guint32 time)
|
||||
{
|
||||
const gdouble smooth_factor = 0.3;
|
||||
guint32 thistime = time;
|
||||
gdouble dist;
|
||||
|
||||
if (shell->last_disp_motion_time == 0)
|
||||
{
|
||||
/* First pair is invalid to do any velocity calculation,
|
||||
* so we apply constant values.
|
||||
*/
|
||||
coords->velocity = 100;
|
||||
coords->delta_time = 0.001;
|
||||
coords->distance = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gdouble dx = coords->delta_x = shell->last_coords.x - coords->x;
|
||||
gdouble dy = coords->delta_y = shell->last_coords.y - coords->y;
|
||||
|
||||
/* Events with distances less than 1 in either motion direction
|
||||
* are not worth handling.
|
||||
*/
|
||||
if (fabs (dx) < 1.0 && fabs (dy) < 1.0)
|
||||
return FALSE;
|
||||
|
||||
coords->delta_time = thistime - shell->last_disp_motion_time;
|
||||
coords->delta_time = (shell->last_coords.delta_time * (1 - smooth_factor)
|
||||
+ coords->delta_time * smooth_factor);
|
||||
coords->distance = dist = sqrt (SQR (dx) + SQR (dy));
|
||||
|
||||
/* If even smoothed time resolution does not allow to guess for speed,
|
||||
* use last velocity.
|
||||
*/
|
||||
if ((coords->delta_time == 0))
|
||||
{
|
||||
coords->velocity = shell->last_coords.velocity;
|
||||
}
|
||||
else
|
||||
{
|
||||
coords->velocity =
|
||||
(coords->distance / (gdouble) coords->delta_time) / 10;
|
||||
|
||||
/* A little smooth on this too, feels better in tools this way. */
|
||||
coords->velocity = (shell->last_coords.velocity * (1 - smooth_factor)
|
||||
+ coords->velocity * smooth_factor);
|
||||
/* Speed needs upper limit */
|
||||
coords->velocity = MIN (coords->velocity, 1.0);
|
||||
}
|
||||
|
||||
if (inertia_factor > 0)
|
||||
{
|
||||
/* Apply smoothing to X and Y. */
|
||||
|
||||
/* This tells how far from the pointer can stray from the line */
|
||||
gdouble max_deviation = SQR (20 * inertia_factor);
|
||||
gdouble cur_deviation = max_deviation;
|
||||
gdouble sin_avg;
|
||||
gdouble sin_old;
|
||||
gdouble sin_new;
|
||||
gdouble cos_avg;
|
||||
gdouble cos_old;
|
||||
gdouble cos_new;
|
||||
gdouble new_x;
|
||||
gdouble new_y;
|
||||
|
||||
sin_new = coords->delta_x / coords->distance;
|
||||
sin_old = shell->last_coords.delta_x / shell->last_coords.distance;
|
||||
sin_avg = sin (asin (sin_old) * inertia_factor +
|
||||
asin (sin_new) * (1 - inertia_factor));
|
||||
|
||||
cos_new = coords->delta_y / coords->distance;
|
||||
cos_old = shell->last_coords.delta_y / shell->last_coords.distance;
|
||||
cos_avg = cos (acos (cos_old) * inertia_factor +
|
||||
acos (cos_new) * (1 - inertia_factor));
|
||||
|
||||
coords->delta_x = sin_avg * coords->distance;
|
||||
coords->delta_y = cos_avg * coords->distance;
|
||||
|
||||
new_x = (shell->last_coords.x - coords->delta_x) * 0.5 + coords->x * 0.5;
|
||||
new_y = (shell->last_coords.y - coords->delta_y) * 0.5 + coords->y * 0.5;
|
||||
|
||||
cur_deviation = SQR(coords->x-new_x) + SQR(coords->y-new_y);
|
||||
|
||||
while (cur_deviation >= max_deviation)
|
||||
{
|
||||
new_x = new_x * 0.8 + coords->x * 0.2;
|
||||
new_y = new_y * 0.8 + coords->y * 0.2;
|
||||
|
||||
cur_deviation = (SQR (coords->x - new_x) +
|
||||
SQR (coords->y - new_y));
|
||||
}
|
||||
|
||||
coords->x = new_x;
|
||||
coords->y = new_y;
|
||||
|
||||
coords->delta_x = shell->last_coords.x - coords->x;
|
||||
coords->delta_y = shell->last_coords.y - coords->y;
|
||||
|
||||
/* Recalculate distance */
|
||||
coords->distance = sqrt (SQR (coords->delta_x) +
|
||||
SQR (coords->delta_y));
|
||||
}
|
||||
|
||||
#ifdef VERBOSE
|
||||
g_printerr ("DIST: %f, DT:%f, Vel:%f, Press:%f,smooth_dd:%f, sf %f\n",
|
||||
coords->distance,
|
||||
coords->delta_time,
|
||||
shell->last_coords.velocity,
|
||||
coords->pressure,
|
||||
coords->distance - dist,
|
||||
inertia_factor);
|
||||
#endif
|
||||
}
|
||||
|
||||
shell->last_coords = *coords;
|
||||
shell->last_disp_motion_time = time;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,10 @@ gboolean gimp_display_shell_get_event_state (GimpDisplayShell *shell,
|
|||
void gimp_display_shell_get_device_state (GimpDisplayShell *shell,
|
||||
GdkDevice *device,
|
||||
GdkModifierType *state);
|
||||
gboolean gimp_display_shell_eval_event (GimpDisplayShell *shell,
|
||||
GimpCoords *coords,
|
||||
gdouble inertia_factor,
|
||||
guint32 time);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_SHELL_COORDS_H__ */
|
||||
|
|
|
@ -178,7 +178,8 @@ struct _GimpDisplayShell
|
|||
gint scroll_start_x;
|
||||
gint scroll_start_y;
|
||||
gboolean button_press_before_focus;
|
||||
guint32 last_motion_time;
|
||||
guint32 last_disp_motion_time; /* previous time of a forwarded motion event */
|
||||
guint32 last_read_motion_time;
|
||||
|
||||
GdkRectangle *highlight; /* in image coordinates, can be NULL */
|
||||
GimpDrawable *mask;
|
||||
|
|
|
@ -7,10 +7,14 @@ libappgegl_a_SOURCES = \
|
|||
gimp-gegl.h \
|
||||
gimp-gegl-utils.c \
|
||||
gimp-gegl-utils.h \
|
||||
gimpoperationcolorbalance.c \
|
||||
gimpoperationcolorbalance.h \
|
||||
gimpoperationcolorize.c \
|
||||
gimpoperationcolorize.h \
|
||||
gimpoperationdesaturate.c \
|
||||
gimpoperationdesaturate.h \
|
||||
gimpoperationhuesaturation.c \
|
||||
gimpoperationhuesaturation.h \
|
||||
gimpoperationlevels.c \
|
||||
gimpoperationlevels.h \
|
||||
gimpoperationposterize.c \
|
||||
|
|
|
@ -18,20 +18,23 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __OUR_GEGL_TYPES_H__
|
||||
#define __OUR_GEGL_TYPES_H__
|
||||
#ifndef __GEGL_TYPES_H__
|
||||
#define __GEGL_TYPES_H__
|
||||
|
||||
|
||||
#include "base/base-types.h"
|
||||
#include "gegl/gegl-types.h"
|
||||
|
||||
|
||||
typedef struct _GimpOperationColorize GimpOperationColorize;
|
||||
typedef struct _GimpOperationDesaturate GimpOperationDesaturate;
|
||||
typedef struct _GimpOperationLevels GimpOperationLevels;
|
||||
typedef struct _GimpOperationPosterize GimpOperationPosterize;
|
||||
typedef struct _GimpOperationThreshold GimpOperationThreshold;
|
||||
typedef struct _GimpOperationTileSink GimpOperationTileSink;
|
||||
typedef struct _GimpOperationTileSource GimpOperationTileSource;
|
||||
typedef struct _GimpOperationColorBalance GimpOperationColorBalance;
|
||||
typedef struct _GimpOperationColorize GimpOperationColorize;
|
||||
typedef struct _GimpOperationDesaturate GimpOperationDesaturate;
|
||||
typedef struct _GimpOperationHueSaturation GimpOperationHueSaturation;
|
||||
typedef struct _GimpOperationLevels GimpOperationLevels;
|
||||
typedef struct _GimpOperationPosterize GimpOperationPosterize;
|
||||
typedef struct _GimpOperationThreshold GimpOperationThreshold;
|
||||
typedef struct _GimpOperationTileSink GimpOperationTileSink;
|
||||
typedef struct _GimpOperationTileSource GimpOperationTileSource;
|
||||
|
||||
|
||||
#endif /* __OUR_GEGL_TYPES_H__ */
|
||||
#endif /* __GEGL_TYPES_H__ */
|
||||
|
|
|
@ -1,72 +1,30 @@
|
|||
/* This file is part of GEGL
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* GEGL 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 program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GEGL is distributed in the hope that it will be useful,
|
||||
* This program 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.
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2003 Calvin Williamson
|
||||
* 2006 Øyvind Kolås
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GEGL_TYPES_H__
|
||||
#define __GEGL_TYPES_H__
|
||||
#ifndef __UGLY_GEGL_TYPES_H__
|
||||
#define __UGLY_GEGL_TYPES_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GeglConnection GeglConnection;
|
||||
typedef struct _GeglColor GeglColor;
|
||||
typedef struct _GeglCurve GeglCurve;
|
||||
typedef struct _GeglCRVisitor GeglCRVisitor;
|
||||
typedef struct _GeglDebugRectVisitor GeglDebugRectVisitor;
|
||||
typedef struct _GeglEvalMgr GeglEvalMgr;
|
||||
typedef struct _GeglEvalVisitor GeglEvalVisitor;
|
||||
typedef struct _GeglFinishVisitor GeglFinishVisitor;
|
||||
typedef struct _GeglGraph GeglGraph;
|
||||
typedef struct _GeglHaveVisitor GeglHaveVisitor;
|
||||
typedef struct _GeglNeedVisitor GeglNeedVisitor;
|
||||
typedef struct _GeglNode GeglNode;
|
||||
typedef struct _GeglNodeContext GeglNodeContext;
|
||||
typedef struct _GeglOperation GeglOperation;
|
||||
typedef struct _GeglPad GeglPad;
|
||||
typedef struct _GeglVector GeglVector;
|
||||
typedef struct _GeglProcessor GeglProcessor;
|
||||
typedef struct _GeglPrepareVisitor GeglPrepareVisitor;
|
||||
typedef struct _GeglVisitable GeglVisitable; /* dummy typedef */
|
||||
typedef struct _GeglVisitor GeglVisitor;
|
||||
/* FIXME: typedefs needed by the headers copied here.
|
||||
* They are supposed to be removed at some point.
|
||||
*/
|
||||
typedef struct _GeglOperation GeglOperation;
|
||||
typedef struct _GeglNodeContext GeglNodeContext;
|
||||
|
||||
typedef struct _GeglRectangle GeglRectangle;
|
||||
typedef struct _GeglPoint GeglPoint;
|
||||
typedef struct _GeglDimension GeglDimension;
|
||||
|
||||
struct _GeglRectangle
|
||||
{
|
||||
gint x;
|
||||
gint y;
|
||||
gint width;
|
||||
gint height;
|
||||
};
|
||||
|
||||
struct _GeglPoint
|
||||
{
|
||||
gint x;
|
||||
gint y;
|
||||
};
|
||||
|
||||
struct _GeglDimension
|
||||
{
|
||||
gint width;
|
||||
gint height;
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GEGL_TYPES_H__ */
|
||||
#endif /* __UGLY_GEGL_TYPES_H__ */
|
||||
|
|
|
@ -21,14 +21,15 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "gegl/gegl-types.h"
|
||||
#include <gegl.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
#include "gimp-gegl.h"
|
||||
#include "gimpoperationcolorbalance.h"
|
||||
#include "gimpoperationcolorize.h"
|
||||
#include "gimpoperationdesaturate.h"
|
||||
#include "gimpoperationhuesaturation.h"
|
||||
#include "gimpoperationlevels.h"
|
||||
#include "gimpoperationposterize.h"
|
||||
#include "gimpoperationthreshold.h"
|
||||
|
@ -39,8 +40,10 @@
|
|||
void
|
||||
gimp_gegl_init (void)
|
||||
{
|
||||
g_type_class_ref (GIMP_TYPE_OPERATION_COLOR_BALANCE);
|
||||
g_type_class_ref (GIMP_TYPE_OPERATION_COLORIZE);
|
||||
g_type_class_ref (GIMP_TYPE_OPERATION_DESATURATE);
|
||||
g_type_class_ref (GIMP_TYPE_OPERATION_HUE_SATURATION);
|
||||
g_type_class_ref (GIMP_TYPE_OPERATION_LEVELS);
|
||||
g_type_class_ref (GIMP_TYPE_OPERATION_POSTERIZE);
|
||||
g_type_class_ref (GIMP_TYPE_OPERATION_THRESHOLD);
|
||||
|
|
|
@ -0,0 +1,317 @@
|
|||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimpoperationcolorbalance.c
|
||||
* Copyright (C) 2007 Michael Natterer <mitch@gimp.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
#include "gimpoperationcolorbalance.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_RANGE,
|
||||
PROP_CYAN_RED,
|
||||
PROP_MAGENTA_GREEN,
|
||||
PROP_YELLOW_BLUE,
|
||||
PROP_PRESERVE_LUMINOSITY
|
||||
};
|
||||
|
||||
|
||||
static void gimp_operation_color_balance_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gimp_operation_color_balance_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static gboolean gimp_operation_color_balance_process (GeglOperation *operation,
|
||||
void *in_buf,
|
||||
void *out_buf,
|
||||
glong samples);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpOperationColorBalance, gimp_operation_color_balance,
|
||||
GEGL_TYPE_OPERATION_POINT_FILTER)
|
||||
|
||||
#define parent_class gimp_operation_color_balance_parent_class
|
||||
|
||||
|
||||
static void
|
||||
gimp_operation_color_balance_class_init (GimpOperationColorBalanceClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
|
||||
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
|
||||
|
||||
object_class->set_property = gimp_operation_color_balance_set_property;
|
||||
object_class->get_property = gimp_operation_color_balance_get_property;
|
||||
|
||||
point_class->process = gimp_operation_color_balance_process;
|
||||
|
||||
gegl_operation_class_set_name (operation_class, "gimp-color-balance");
|
||||
|
||||
g_object_class_install_property (object_class, PROP_RANGE,
|
||||
g_param_spec_enum ("range",
|
||||
"range",
|
||||
"The affected range",
|
||||
GIMP_TYPE_TRANSFER_MODE,
|
||||
GIMP_MIDTONES,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_CYAN_RED,
|
||||
g_param_spec_double ("cyan-red",
|
||||
"Cyan-Red",
|
||||
"Cyan-Red",
|
||||
-1.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_MAGENTA_GREEN,
|
||||
g_param_spec_double ("magenta-green",
|
||||
"Magenta-Green",
|
||||
"Magenta-Green",
|
||||
-1.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_YELLOW_BLUE,
|
||||
g_param_spec_double ("yellow-blue",
|
||||
"Yellow-Blue",
|
||||
"Yellow-Blue",
|
||||
-1.0, 1.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_PRESERVE_LUMINOSITY,
|
||||
g_param_spec_boolean ("preserve-luminosity",
|
||||
"Preserve Luminosity",
|
||||
"Preserve Luminosity",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_operation_color_balance_init (GimpOperationColorBalance *self)
|
||||
{
|
||||
GimpTransferMode range;
|
||||
|
||||
self->range = GIMP_MIDTONES;
|
||||
|
||||
for (range = GIMP_SHADOWS; range <= GIMP_HIGHLIGHTS; range++)
|
||||
{
|
||||
self->cyan_red[range] = 0.0;
|
||||
self->magenta_green[range] = 0.0;
|
||||
self->yellow_blue[range] = 0.0;
|
||||
}
|
||||
|
||||
self->preserve_luminosity = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_operation_color_balance_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpOperationColorBalance *self = GIMP_OPERATION_COLOR_BALANCE (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_RANGE:
|
||||
g_value_set_enum (value, self->range);
|
||||
break;
|
||||
|
||||
case PROP_CYAN_RED:
|
||||
g_value_set_double (value, self->cyan_red[self->range]);
|
||||
break;
|
||||
|
||||
case PROP_MAGENTA_GREEN:
|
||||
g_value_set_double (value, self->magenta_green[self->range]);
|
||||
break;
|
||||
|
||||
case PROP_YELLOW_BLUE:
|
||||
g_value_set_double (value, self->yellow_blue[self->range]);
|
||||
break;
|
||||
|
||||
case PROP_PRESERVE_LUMINOSITY:
|
||||
g_value_set_boolean (value, self->preserve_luminosity);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_operation_color_balance_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpOperationColorBalance *self = GIMP_OPERATION_COLOR_BALANCE (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_RANGE:
|
||||
self->range = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
case PROP_CYAN_RED:
|
||||
self->cyan_red[self->range] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_MAGENTA_GREEN:
|
||||
self->magenta_green[self->range] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_YELLOW_BLUE:
|
||||
self->yellow_blue[self->range] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_PRESERVE_LUMINOSITY:
|
||||
self->preserve_luminosity = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static inline gfloat
|
||||
gimp_operation_color_balance_map (gfloat value,
|
||||
gdouble shadows,
|
||||
gdouble midtones,
|
||||
gdouble highlights)
|
||||
{
|
||||
gdouble low = 1.075 - 1.0 / (value / 16.0 + 1.0);
|
||||
gdouble mid = 0.667 * (1.0 - SQR (value - 0.5));
|
||||
gdouble shadows_add;
|
||||
gdouble shadows_sub;
|
||||
gdouble midtones_add;
|
||||
gdouble midtones_sub;
|
||||
gdouble highlights_add;
|
||||
gdouble highlights_sub;
|
||||
|
||||
shadows_add = low + 1.0;
|
||||
shadows_sub = 1.0 - low;
|
||||
|
||||
midtones_add = mid;
|
||||
midtones_sub = mid;
|
||||
|
||||
highlights_add = 1.0 - low;
|
||||
highlights_sub = low + 1.0;
|
||||
|
||||
value += shadows * (shadows > 0 ? shadows_add : shadows_sub);
|
||||
value = CLAMP (value, 0.0, 1.0);
|
||||
|
||||
value += midtones * (midtones > 0 ? midtones_add : midtones_sub);
|
||||
value = CLAMP (value, 0.0, 1.0);
|
||||
|
||||
value += highlights * (highlights > 0 ? highlights_add : highlights_sub);
|
||||
value = CLAMP (value, 0.0, 1.0);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_operation_color_balance_process (GeglOperation *operation,
|
||||
void *in_buf,
|
||||
void *out_buf,
|
||||
glong samples)
|
||||
{
|
||||
GimpOperationColorBalance *self = GIMP_OPERATION_COLOR_BALANCE (operation);
|
||||
gfloat *src = in_buf;
|
||||
gfloat *dest = out_buf;
|
||||
glong sample;
|
||||
|
||||
for (sample = 0; sample < samples; sample++)
|
||||
{
|
||||
gfloat r = src[RED_PIX];
|
||||
gfloat g = src[GREEN_PIX];
|
||||
gfloat b = src[BLUE_PIX];
|
||||
gfloat r_n;
|
||||
gfloat g_n;
|
||||
gfloat b_n;
|
||||
|
||||
r_n = gimp_operation_color_balance_map (r,
|
||||
self->cyan_red[GIMP_SHADOWS],
|
||||
self->cyan_red[GIMP_MIDTONES],
|
||||
self->cyan_red[GIMP_HIGHLIGHTS]);
|
||||
|
||||
g_n = gimp_operation_color_balance_map (g,
|
||||
self->magenta_green[GIMP_SHADOWS],
|
||||
self->magenta_green[GIMP_MIDTONES],
|
||||
self->magenta_green[GIMP_HIGHLIGHTS]);
|
||||
|
||||
b_n = gimp_operation_color_balance_map (b,
|
||||
self->yellow_blue[GIMP_SHADOWS],
|
||||
self->yellow_blue[GIMP_MIDTONES],
|
||||
self->yellow_blue[GIMP_HIGHLIGHTS]);
|
||||
|
||||
if (self->preserve_luminosity)
|
||||
{
|
||||
GimpRGB rgb;
|
||||
GimpHSL hsl;
|
||||
GimpHSL hsl2;
|
||||
|
||||
rgb.r = r_n;
|
||||
rgb.g = g_n;
|
||||
rgb.b = b_n;
|
||||
gimp_rgb_to_hsl (&rgb, &hsl);
|
||||
|
||||
rgb.r = r;
|
||||
rgb.g = g;
|
||||
rgb.b = b;
|
||||
gimp_rgb_to_hsl (&rgb, &hsl2);
|
||||
|
||||
hsl.l = hsl2.l;
|
||||
|
||||
gimp_hsl_to_rgb (&hsl, &rgb);
|
||||
|
||||
r_n = rgb.r;
|
||||
g_n = rgb.g;
|
||||
b_n = rgb.b;
|
||||
}
|
||||
|
||||
dest[RED_PIX] = r_n;
|
||||
dest[GREEN_PIX] = g_n;
|
||||
dest[BLUE_PIX] = b_n;
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
|
||||
src += 4;
|
||||
dest += 4;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimpoperationcolorbalance.h
|
||||
* Copyright (C) 2007 Michael Natterer <mitch@gimp.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_OPERATION_COLOR_BALANCE_H__
|
||||
#define __GIMP_OPERATION_COLOR_BALANCE_H__
|
||||
|
||||
|
||||
#include "gegl/gegl-operation-point-filter.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_OPERATION_COLOR_BALANCE (gimp_operation_color_balance_get_type ())
|
||||
#define GIMP_OPERATION_COLOR_BALANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_COLOR_BALANCE, GimpOperationColorBalance))
|
||||
#define GIMP_OPERATION_COLOR_BALANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_COLOR_BALANCE, GimpOperationColorBalanceClass))
|
||||
#define GIMP_IS_OPERATION_COLOR_BALANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_COLOR_BALANCE))
|
||||
#define GIMP_IS_OPERATION_COLOR_BALANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_COLOR_BALANCE))
|
||||
#define GIMP_OPERATION_COLOR_BALANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_COLOR_BALANCE, GimpOperationColorBalanceClass))
|
||||
|
||||
|
||||
typedef struct _GimpOperationColorBalanceClass GimpOperationColorBalanceClass;
|
||||
|
||||
struct _GimpOperationColorBalance
|
||||
{
|
||||
GeglOperationPointFilter parent_instance;
|
||||
|
||||
GimpTransferMode range;
|
||||
|
||||
gdouble cyan_red[3];
|
||||
gdouble magenta_green[3];
|
||||
gdouble yellow_blue[3];
|
||||
|
||||
gboolean preserve_luminosity;
|
||||
};
|
||||
|
||||
struct _GimpOperationColorBalanceClass
|
||||
{
|
||||
GeglOperationPointFilterClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_operation_color_balance_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
#endif /* __GIMP_OPERATION_COLOR_BALANCE_H__ */
|
|
@ -21,13 +21,10 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "gegl/gegl-types.h"
|
||||
#include <gegl/buffer/gegl-buffer.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
#include "gimpoperationcolorize.h"
|
||||
|
@ -77,32 +74,29 @@ gimp_operation_colorize_class_init (GimpOperationColorizeClass * klass)
|
|||
|
||||
gegl_operation_class_set_name (operation_class, "gimp-colorize");
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_HUE,
|
||||
g_param_spec_float ("hue",
|
||||
"Hue",
|
||||
"Hue",
|
||||
0.0, 360.0, 180.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_object_class_install_property (object_class, PROP_HUE,
|
||||
g_param_spec_double ("hue",
|
||||
"Hue",
|
||||
"Hue",
|
||||
0.0, 1.0, 0.5,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_SATURATION,
|
||||
g_param_spec_float ("saturation",
|
||||
"Saturation",
|
||||
"Saturation",
|
||||
0.0, 100.0, 50.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_object_class_install_property (object_class, PROP_SATURATION,
|
||||
g_param_spec_double ("saturation",
|
||||
"Saturation",
|
||||
"Saturation",
|
||||
0.0, 1.0, 0.5,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_LIGHTNESS,
|
||||
g_param_spec_float ("lightness",
|
||||
"Lightness",
|
||||
"Lightness",
|
||||
-100.0, 100.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_object_class_install_property (object_class, PROP_LIGHTNESS,
|
||||
g_param_spec_double ("lightness",
|
||||
"Lightness",
|
||||
"Lightness",
|
||||
-1.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -121,15 +115,15 @@ gimp_operation_colorize_get_property (GObject *object,
|
|||
switch (property_id)
|
||||
{
|
||||
case PROP_HUE:
|
||||
g_value_set_float (value, self->hue);
|
||||
g_value_set_double (value, self->hue);
|
||||
break;
|
||||
|
||||
case PROP_SATURATION:
|
||||
g_value_set_float (value, self->saturation);
|
||||
g_value_set_double (value, self->saturation);
|
||||
break;
|
||||
|
||||
case PROP_LIGHTNESS:
|
||||
g_value_set_float (value, self->lightness);
|
||||
g_value_set_double (value, self->lightness);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -149,15 +143,15 @@ gimp_operation_colorize_set_property (GObject *object,
|
|||
switch (property_id)
|
||||
{
|
||||
case PROP_HUE:
|
||||
self->hue = g_value_get_float (value);
|
||||
self->hue = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_SATURATION:
|
||||
self->saturation = g_value_get_float (value);
|
||||
self->saturation = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_LIGHTNESS:
|
||||
self->lightness = g_value_get_float (value);
|
||||
self->lightness = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -187,17 +181,17 @@ gimp_operation_colorize_process (GeglOperation *operation,
|
|||
|
||||
if (self->lightness > 0)
|
||||
{
|
||||
lum = lum * (100.0 - self->lightness) / 100.0;
|
||||
lum = lum * (1.0 - self->lightness);
|
||||
|
||||
lum += 1.0 - (100.0 - self->lightness) / 100.0;
|
||||
lum += 1.0 - (1.0 - self->lightness);
|
||||
}
|
||||
else if (self->lightness < 0)
|
||||
{
|
||||
lum = lum * (self->lightness + 100.0) / 100.0;
|
||||
lum = lum * (self->lightness + 1.0);
|
||||
}
|
||||
|
||||
hsl.h = self->hue / 360.0;
|
||||
hsl.s = self->saturation / 100.0;
|
||||
hsl.h = self->hue;
|
||||
hsl.s = self->saturation;
|
||||
hsl.l = lum;
|
||||
|
||||
gimp_hsl_to_rgb (&hsl, &rgb);
|
||||
|
|
|
@ -38,9 +38,9 @@ struct _GimpOperationColorize
|
|||
{
|
||||
GeglOperationPointFilter parent_instance;
|
||||
|
||||
gfloat hue;
|
||||
gfloat saturation;
|
||||
gfloat lightness;
|
||||
gdouble hue;
|
||||
gdouble saturation;
|
||||
gdouble lightness;
|
||||
};
|
||||
|
||||
struct _GimpOperationColorizeClass
|
||||
|
|
|
@ -21,13 +21,10 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "gegl/gegl-types.h"
|
||||
#include <gegl/buffer/gegl-buffer.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
#include "gimpoperationdesaturate.h"
|
||||
|
|
|
@ -0,0 +1,364 @@
|
|||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimpoperationhuesaturation.c
|
||||
* Copyright (C) 2007 Michael Natterer <mitch@gimp.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
#include "gimpoperationhuesaturation.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_RANGE,
|
||||
PROP_HUE,
|
||||
PROP_SATURATION,
|
||||
PROP_LIGHTNESS,
|
||||
PROP_OVERLAP
|
||||
};
|
||||
|
||||
|
||||
static void gimp_operation_hue_saturation_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gimp_operation_hue_saturation_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static gboolean gimp_operation_hue_saturation_process (GeglOperation *operation,
|
||||
void *in_buf,
|
||||
void *out_buf,
|
||||
glong samples);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpOperationHueSaturation, gimp_operation_hue_saturation,
|
||||
GEGL_TYPE_OPERATION_POINT_FILTER)
|
||||
|
||||
#define parent_class gimp_operation_hue_saturation_parent_class
|
||||
|
||||
|
||||
static void
|
||||
gimp_operation_hue_saturation_class_init (GimpOperationHueSaturationClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
|
||||
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
|
||||
|
||||
object_class->set_property = gimp_operation_hue_saturation_set_property;
|
||||
object_class->get_property = gimp_operation_hue_saturation_get_property;
|
||||
|
||||
point_class->process = gimp_operation_hue_saturation_process;
|
||||
|
||||
gegl_operation_class_set_name (operation_class, "gimp-hue-saturation");
|
||||
|
||||
g_object_class_install_property (object_class, PROP_RANGE,
|
||||
g_param_spec_enum ("range",
|
||||
"range",
|
||||
"The affected range",
|
||||
GIMP_TYPE_HUE_RANGE,
|
||||
GIMP_ALL_HUES,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_HUE,
|
||||
g_param_spec_double ("hue",
|
||||
"Hue",
|
||||
"Hue",
|
||||
-1.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_SATURATION,
|
||||
g_param_spec_double ("saturation",
|
||||
"Saturation",
|
||||
"Saturation",
|
||||
-1.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_LIGHTNESS,
|
||||
g_param_spec_double ("lightness",
|
||||
"Lightness",
|
||||
"Lightness",
|
||||
-1.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_OVERLAP,
|
||||
g_param_spec_double ("overlap",
|
||||
"Overlap",
|
||||
"Overlap",
|
||||
0.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_operation_hue_saturation_init (GimpOperationHueSaturation *self)
|
||||
{
|
||||
GimpHueRange range;
|
||||
|
||||
self->range = GIMP_ALL_HUES;
|
||||
|
||||
for (range = GIMP_ALL_HUES; range <= GIMP_MAGENTA_HUES; range++)
|
||||
{
|
||||
self->hue[range] = 0.0;
|
||||
self->saturation[range] = 0.0;
|
||||
self->lightness[range] = 0.0;
|
||||
}
|
||||
|
||||
self->overlap = 0.0;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_operation_hue_saturation_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpOperationHueSaturation *self = GIMP_OPERATION_HUE_SATURATION (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_RANGE:
|
||||
g_value_set_enum (value, self->range);
|
||||
break;
|
||||
|
||||
case PROP_HUE:
|
||||
g_value_set_double (value, self->hue[self->range]);
|
||||
break;
|
||||
|
||||
case PROP_SATURATION:
|
||||
g_value_set_double (value, self->saturation[self->range]);
|
||||
break;
|
||||
|
||||
case PROP_LIGHTNESS:
|
||||
g_value_set_double (value, self->lightness[self->range]);
|
||||
break;
|
||||
|
||||
case PROP_OVERLAP:
|
||||
g_value_set_double (value, self->overlap);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_operation_hue_saturation_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpOperationHueSaturation *self = GIMP_OPERATION_HUE_SATURATION (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_RANGE:
|
||||
self->range = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
case PROP_HUE:
|
||||
self->hue[self->range] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_SATURATION:
|
||||
self->saturation[self->range] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_LIGHTNESS:
|
||||
self->lightness[self->range] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_OVERLAP:
|
||||
self->overlap = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static inline gdouble
|
||||
map_hue (GimpOperationHueSaturation *self,
|
||||
gint hue,
|
||||
gdouble value)
|
||||
{
|
||||
value += (self->hue[0] + self->hue[hue + 1]) / 2.0;
|
||||
|
||||
if (value < 0)
|
||||
return value + 1.0;
|
||||
else if (value > 1.0)
|
||||
return value - 1.0;
|
||||
else
|
||||
return value;
|
||||
}
|
||||
|
||||
static inline gdouble
|
||||
map_saturation (GimpOperationHueSaturation *self,
|
||||
gint hue,
|
||||
gdouble value)
|
||||
{
|
||||
gdouble v = self->saturation[0] + self->saturation[hue + 1];
|
||||
|
||||
// v = CLAMP (v, -1.0, 1.0);
|
||||
|
||||
/* This change affects the way saturation is computed. With the old
|
||||
* code (different code for value < 0), increasing the saturation
|
||||
* affected muted colors very much, and bright colors less. With the
|
||||
* new code, it affects muted colors and bright colors more or less
|
||||
* evenly. For enhancing the color in photos, the new behavior is
|
||||
* exactly what you want. It's hard for me to imagine a case in
|
||||
* which the old behavior is better.
|
||||
*/
|
||||
value *= (v + 1.0);
|
||||
|
||||
return CLAMP (value, 0.0, 1.0);
|
||||
}
|
||||
|
||||
static inline gdouble
|
||||
map_lightness (GimpOperationHueSaturation *self,
|
||||
gint hue,
|
||||
gdouble value)
|
||||
{
|
||||
gdouble v = (self->lightness[0] + self->lightness[hue + 1]) / 2.0;
|
||||
|
||||
// v = CLAMP (v, -1.0, 1.0);
|
||||
|
||||
if (v < 0)
|
||||
return value * (v + 1.0);
|
||||
else
|
||||
return value + (v * (1.0 - value));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_operation_hue_saturation_process (GeglOperation *operation,
|
||||
void *in_buf,
|
||||
void *out_buf,
|
||||
glong samples)
|
||||
{
|
||||
GimpOperationHueSaturation *self = GIMP_OPERATION_HUE_SATURATION (operation);
|
||||
gfloat *src = in_buf;
|
||||
gfloat *dest = out_buf;
|
||||
glong sample;
|
||||
|
||||
for (sample = 0; sample < samples; sample++)
|
||||
{
|
||||
GimpRGB rgb;
|
||||
GimpHSL hsl;
|
||||
gdouble h;
|
||||
gint hue_counter;
|
||||
gint hue = 0;
|
||||
gint secondary_hue = 0;
|
||||
gboolean use_secondary_hue = FALSE;
|
||||
gfloat primary_intensity = 0.0;
|
||||
gfloat secondary_intensity = 0.0;
|
||||
gfloat overlap = self->overlap / 2.0;
|
||||
|
||||
rgb.r = src[RED_PIX];
|
||||
rgb.g = src[GREEN_PIX];
|
||||
rgb.b = src[BLUE_PIX];
|
||||
|
||||
gimp_rgb_to_hsl (&rgb, &hsl);
|
||||
|
||||
h = hsl.h * 6.0;
|
||||
|
||||
for (hue_counter = 0; hue_counter < 7; hue_counter++)
|
||||
{
|
||||
gdouble hue_threshold = (gdouble) hue_counter + 0.5;
|
||||
|
||||
if (h < ((gdouble) hue_threshold + overlap))
|
||||
{
|
||||
hue = hue_counter;
|
||||
|
||||
if (overlap > 0.0 && h > ((gdouble) hue_threshold - overlap))
|
||||
{
|
||||
use_secondary_hue = TRUE;
|
||||
|
||||
secondary_hue = hue_counter + 1;
|
||||
|
||||
secondary_intensity =
|
||||
(h - (gdouble) hue_threshold + overlap) / (2.0 * overlap);
|
||||
|
||||
primary_intensity = 1.0 - secondary_intensity;
|
||||
}
|
||||
else
|
||||
{
|
||||
use_secondary_hue = FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hue >= 6)
|
||||
{
|
||||
hue = 0;
|
||||
use_secondary_hue = FALSE;
|
||||
}
|
||||
|
||||
if (secondary_hue >= 6)
|
||||
{
|
||||
secondary_hue = 0;
|
||||
}
|
||||
|
||||
if (use_secondary_hue)
|
||||
{
|
||||
hsl.h = (map_hue (self, hue, hsl.h) * primary_intensity +
|
||||
map_hue (self, secondary_hue, hsl.h) * secondary_intensity);
|
||||
|
||||
hsl.s = (map_saturation (self, hue, hsl.s) * primary_intensity +
|
||||
map_saturation (self, secondary_hue, hsl.s) * secondary_intensity);
|
||||
|
||||
hsl.l = (map_lightness (self, hue, hsl.l) * primary_intensity +
|
||||
map_lightness (self, secondary_hue, hsl.l) * secondary_intensity);
|
||||
}
|
||||
else
|
||||
{
|
||||
hsl.h = map_hue (self, hue, hsl.h);
|
||||
hsl.s = map_saturation (self, hue, hsl.s);
|
||||
hsl.l = map_lightness (self, hue, hsl.l);
|
||||
}
|
||||
|
||||
gimp_hsl_to_rgb (&hsl, &rgb);
|
||||
|
||||
dest[RED_PIX] = rgb.r;
|
||||
dest[GREEN_PIX] = rgb.g;
|
||||
dest[BLUE_PIX] = rgb.b;
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
|
||||
src += 4;
|
||||
dest += 4;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimpoperationhuesaturation.h
|
||||
* Copyright (C) 2007 Michael Natterer <mitch@gimp.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_OPERATION_HUE_SATURATION_H__
|
||||
#define __GIMP_OPERATION_HUE_SATURATION_H__
|
||||
|
||||
|
||||
#include "gegl/gegl-operation-point-filter.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_OPERATION_HUE_SATURATION (gimp_operation_hue_saturation_get_type ())
|
||||
#define GIMP_OPERATION_HUE_SATURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_HUE_SATURATION, GimpOperationHueSaturation))
|
||||
#define GIMP_OPERATION_HUE_SATURATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_HUE_SATURATION, GimpOperationHueSaturationClass))
|
||||
#define GIMP_IS_OPERATION_HUE_SATURATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_HUE_SATURATION))
|
||||
#define GIMP_IS_OPERATION_HUE_SATURATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_HUE_SATURATION))
|
||||
#define GIMP_OPERATION_HUE_SATURATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_HUE_SATURATION, GimpOperationHueSaturationClass))
|
||||
|
||||
|
||||
typedef struct _GimpOperationHueSaturationClass GimpOperationHueSaturationClass;
|
||||
|
||||
struct _GimpOperationHueSaturation
|
||||
{
|
||||
GeglOperationPointFilter parent_instance;
|
||||
|
||||
GimpHueRange range;
|
||||
|
||||
gdouble hue[7];
|
||||
gdouble saturation[7];
|
||||
gdouble lightness[7];
|
||||
|
||||
gdouble overlap;
|
||||
};
|
||||
|
||||
struct _GimpOperationHueSaturationClass
|
||||
{
|
||||
GeglOperationPointFilterClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_operation_hue_saturation_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
#endif /* __GIMP_OPERATION_HUE_SATURATION_H__ */
|
|
@ -21,14 +21,11 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl/gegl-types.h"
|
||||
#include <gegl/buffer/gegl-buffer.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
#include "gimpoperationlevels.h"
|
||||
|
@ -91,44 +88,44 @@ gimp_operation_levels_class_init (GimpOperationLevelsClass * klass)
|
|||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_GAMMA,
|
||||
g_param_spec_float ("gamma",
|
||||
"Gamma",
|
||||
"Gamma",
|
||||
0.1, 10.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_param_spec_double ("gamma",
|
||||
"Gamma",
|
||||
"Gamma",
|
||||
0.1, 10.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_LOW_INPUT,
|
||||
g_param_spec_float ("low-input",
|
||||
"Low Input",
|
||||
"Low Input",
|
||||
0.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_param_spec_double ("low-input",
|
||||
"Low Input",
|
||||
"Low Input",
|
||||
0.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_HIGH_INPUT,
|
||||
g_param_spec_float ("high-input",
|
||||
"High Input",
|
||||
"High Input",
|
||||
0.0, 1.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_param_spec_double ("high-input",
|
||||
"High Input",
|
||||
"High Input",
|
||||
0.0, 1.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_LOW_OUTPUT,
|
||||
g_param_spec_float ("low-output",
|
||||
"Low Output",
|
||||
"Low Output",
|
||||
0.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_param_spec_double ("low-output",
|
||||
"Low Output",
|
||||
"Low Output",
|
||||
0.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_HIGH_OUTPUT,
|
||||
g_param_spec_float ("high-output",
|
||||
"High Output",
|
||||
"High Output",
|
||||
0.0, 1.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_param_spec_double ("high-output",
|
||||
"High Output",
|
||||
"High Output",
|
||||
0.0, 1.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -165,23 +162,23 @@ gimp_operation_levels_get_property (GObject *object,
|
|||
break;
|
||||
|
||||
case PROP_GAMMA:
|
||||
g_value_set_float (value, self->gamma[self->channel]);
|
||||
g_value_set_double (value, self->gamma[self->channel]);
|
||||
break;
|
||||
|
||||
case PROP_LOW_INPUT:
|
||||
g_value_set_float (value, self->low_input[self->channel]);
|
||||
g_value_set_double (value, self->low_input[self->channel]);
|
||||
break;
|
||||
|
||||
case PROP_HIGH_INPUT:
|
||||
g_value_set_float (value, self->high_input[self->channel]);
|
||||
g_value_set_double (value, self->high_input[self->channel]);
|
||||
break;
|
||||
|
||||
case PROP_LOW_OUTPUT:
|
||||
g_value_set_float (value, self->low_output[self->channel]);
|
||||
g_value_set_double (value, self->low_output[self->channel]);
|
||||
break;
|
||||
|
||||
case PROP_HIGH_OUTPUT:
|
||||
g_value_set_float (value, self->high_output[self->channel]);
|
||||
g_value_set_double (value, self->high_output[self->channel]);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -205,23 +202,23 @@ gimp_operation_levels_set_property (GObject *object,
|
|||
break;
|
||||
|
||||
case PROP_GAMMA:
|
||||
self->gamma[self->channel] = g_value_get_float (value);
|
||||
self->gamma[self->channel] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_LOW_INPUT:
|
||||
self->low_input[self->channel] = g_value_get_float (value);
|
||||
self->low_input[self->channel] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_HIGH_INPUT:
|
||||
self->high_input[self->channel] = g_value_get_float (value);
|
||||
self->high_input[self->channel] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_LOW_OUTPUT:
|
||||
self->low_output[self->channel] = g_value_get_float (value);
|
||||
self->low_output[self->channel] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_HIGH_OUTPUT:
|
||||
self->high_output[self->channel] = g_value_get_float (value);
|
||||
self->high_output[self->channel] = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -230,13 +227,13 @@ gimp_operation_levels_set_property (GObject *object,
|
|||
}
|
||||
}
|
||||
|
||||
static inline gfloat
|
||||
gimp_operation_levels_map (gfloat value,
|
||||
gfloat gamma,
|
||||
gfloat low_input,
|
||||
gfloat high_input,
|
||||
gfloat low_output,
|
||||
gfloat high_output)
|
||||
static inline gdouble
|
||||
gimp_operation_levels_map (gdouble value,
|
||||
gdouble gamma,
|
||||
gdouble low_input,
|
||||
gdouble high_input,
|
||||
gdouble low_output,
|
||||
gdouble high_output)
|
||||
{
|
||||
/* determine input intensity */
|
||||
if (high_input != low_input)
|
||||
|
@ -278,7 +275,7 @@ gimp_operation_levels_process (GeglOperation *operation,
|
|||
|
||||
for (channel = 0; channel < 4; channel++)
|
||||
{
|
||||
gfloat value;
|
||||
gdouble value;
|
||||
|
||||
value = gimp_operation_levels_map (src[channel],
|
||||
self->gamma[channel + 1],
|
||||
|
@ -288,7 +285,7 @@ gimp_operation_levels_process (GeglOperation *operation,
|
|||
self->high_output[channel + 1]);
|
||||
|
||||
/* don't apply the overall curve to the alpha channel */
|
||||
if (channel != 3)
|
||||
if (channel != ALPHA_PIX)
|
||||
value = gimp_operation_levels_map (value,
|
||||
self->gamma[0],
|
||||
self->low_input[0],
|
||||
|
|
|
@ -42,13 +42,13 @@ struct _GimpOperationLevels
|
|||
|
||||
GimpHistogramChannel channel;
|
||||
|
||||
gfloat gamma[5];
|
||||
gdouble gamma[5];
|
||||
|
||||
gfloat low_input[5];
|
||||
gfloat high_input[5];
|
||||
gdouble low_input[5];
|
||||
gdouble high_input[5];
|
||||
|
||||
gfloat low_output[5];
|
||||
gfloat high_output[5];
|
||||
gdouble low_output[5];
|
||||
gdouble high_output[5];
|
||||
};
|
||||
|
||||
struct _GimpOperationLevelsClass
|
||||
|
|
|
@ -21,14 +21,11 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl/gegl-types.h"
|
||||
#include <gegl/buffer/gegl-buffer.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
#include "gimpoperationposterize.h"
|
||||
|
|
|
@ -21,13 +21,10 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "gegl/gegl-types.h"
|
||||
#include <gegl/buffer/gegl-buffer.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
#include "gimpoperationthreshold.h"
|
||||
|
@ -76,23 +73,21 @@ gimp_operation_threshold_class_init (GimpOperationThresholdClass * klass)
|
|||
|
||||
gegl_operation_class_set_name (operation_class, "gimp-threshold");
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_LOW,
|
||||
g_param_spec_float ("low",
|
||||
"Low",
|
||||
"Low threshold",
|
||||
0.0, 1.0, 0.5,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_object_class_install_property (object_class, PROP_LOW,
|
||||
g_param_spec_double ("low",
|
||||
"Low",
|
||||
"Low threshold",
|
||||
0.0, 1.0, 0.5,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_HIGH,
|
||||
g_param_spec_float ("high",
|
||||
"High",
|
||||
"High threshold",
|
||||
0.0, 1.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
g_object_class_install_property (object_class, PROP_HIGH,
|
||||
g_param_spec_double ("high",
|
||||
"High",
|
||||
"High threshold",
|
||||
0.0, 1.0, 1.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -111,11 +106,11 @@ gimp_operation_threshold_get_property (GObject *object,
|
|||
switch (property_id)
|
||||
{
|
||||
case PROP_LOW:
|
||||
g_value_set_float (value, self->low);
|
||||
g_value_set_double (value, self->low);
|
||||
break;
|
||||
|
||||
case PROP_HIGH:
|
||||
g_value_set_float (value, self->high);
|
||||
g_value_set_double (value, self->high);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -135,11 +130,11 @@ gimp_operation_threshold_set_property (GObject *object,
|
|||
switch (property_id)
|
||||
{
|
||||
case PROP_LOW:
|
||||
self->low = g_value_get_float (value);
|
||||
self->low = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_HIGH:
|
||||
self->high = g_value_get_float (value);
|
||||
self->high = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -38,8 +38,8 @@ struct _GimpOperationThreshold
|
|||
{
|
||||
GeglOperationPointFilter parent_instance;
|
||||
|
||||
gfloat low;
|
||||
gfloat high;
|
||||
gdouble low;
|
||||
gdouble high;
|
||||
};
|
||||
|
||||
struct _GimpOperationThresholdClass
|
||||
|
|
|
@ -23,11 +23,8 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "gegl/gegl-types.h"
|
||||
#include "gegl/graph/gegl-node-context.h"
|
||||
#include <gegl/buffer/gegl-buffer.h>
|
||||
#include <gegl.h>
|
||||
#include "gegl/buffer/gegl-buffer.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
|
|
|
@ -23,10 +23,8 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "gegl/gegl-types.h"
|
||||
#include <gegl/buffer/gegl-buffer.h>
|
||||
#include <gegl.h>
|
||||
#include "gegl/buffer/gegl-buffer.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
|
||||
|
@ -34,7 +32,6 @@
|
|||
#include "base/pixel-region.h"
|
||||
|
||||
#include "gimp-gegl-utils.h"
|
||||
#include "gegl/graph/gegl-node-context.h"
|
||||
#include "gimpoperationtilesource.h"
|
||||
|
||||
|
||||
|
|
|
@ -77,18 +77,6 @@ static Blob * ink_pen_ellipse (GimpInkOptions *options,
|
|||
gdouble ytilt,
|
||||
gdouble velocity);
|
||||
|
||||
static void time_smoother_add (GimpInk *ink,
|
||||
guint32 value);
|
||||
static guint32 time_smoother_result (GimpInk *ink);
|
||||
static void time_smoother_init (GimpInk *ink,
|
||||
guint32 initval);
|
||||
|
||||
static void dist_smoother_add (GimpInk *ink,
|
||||
gdouble value);
|
||||
static gdouble dist_smoother_result (GimpInk *ink);
|
||||
static void dist_smoother_init (GimpInk *ink,
|
||||
gdouble initval);
|
||||
|
||||
static void render_blob (Blob *blob,
|
||||
PixelRegion *dest);
|
||||
|
||||
|
@ -270,67 +258,25 @@ gimp_ink_motion (GimpPaintCore *paint_core,
|
|||
paint_core->cur_coords.pressure,
|
||||
paint_core->cur_coords.xtilt,
|
||||
paint_core->cur_coords.ytilt,
|
||||
10.0);
|
||||
100);
|
||||
|
||||
if (ink->start_blob)
|
||||
g_free (ink->start_blob);
|
||||
|
||||
ink->start_blob = blob_duplicate (ink->last_blob);
|
||||
|
||||
time_smoother_init (ink, time);
|
||||
ink->last_time = time;
|
||||
|
||||
dist_smoother_init (ink, 0.0);
|
||||
ink->init_velocity = TRUE;
|
||||
|
||||
blob_to_render = ink->last_blob;
|
||||
}
|
||||
else
|
||||
{
|
||||
Blob *blob;
|
||||
gdouble dist;
|
||||
gdouble velocity;
|
||||
guint32 lasttime = ink->last_time;
|
||||
guint32 thistime;
|
||||
|
||||
time_smoother_add (ink, time);
|
||||
thistime = ink->last_time = time_smoother_result (ink);
|
||||
|
||||
/* The time resolution on X-based GDK motion events is bloody
|
||||
* awful, hence the use of the smoothing function. Sadly this
|
||||
* also means that there is always the chance of having an
|
||||
* indeterminite velocity since this event and the previous
|
||||
* several may still appear to issue at the same
|
||||
* instant. -ADM
|
||||
*/
|
||||
if (thistime == lasttime)
|
||||
thistime = lasttime + 1;
|
||||
|
||||
dist = sqrt ((paint_core->last_coords.x - paint_core->cur_coords.x) *
|
||||
(paint_core->last_coords.x - paint_core->cur_coords.x) +
|
||||
(paint_core->last_coords.y - paint_core->cur_coords.y) *
|
||||
(paint_core->last_coords.y - paint_core->cur_coords.y));
|
||||
|
||||
if (ink->init_velocity)
|
||||
{
|
||||
dist_smoother_init (ink, dist);
|
||||
ink->init_velocity = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
dist_smoother_add (ink, dist);
|
||||
dist = dist_smoother_result (ink);
|
||||
}
|
||||
|
||||
velocity = 10.0 * sqrt ((dist) / (gdouble) (thistime - lasttime));
|
||||
|
||||
blob = ink_pen_ellipse (options,
|
||||
paint_core->cur_coords.x,
|
||||
paint_core->cur_coords.y,
|
||||
paint_core->cur_coords.pressure,
|
||||
paint_core->cur_coords.xtilt,
|
||||
paint_core->cur_coords.ytilt,
|
||||
velocity);
|
||||
paint_core->cur_coords.velocity * 100);
|
||||
|
||||
blob_union = blob_convex_union (ink->last_blob, blob);
|
||||
g_free (ink->last_blob);
|
||||
|
@ -510,84 +456,6 @@ ink_pen_ellipse (GimpInkOptions *options,
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
time_smoother_init (GimpInk *ink,
|
||||
guint32 initval)
|
||||
{
|
||||
gint i;
|
||||
|
||||
ink->ts_index = 0;
|
||||
|
||||
for (i = 0; i < TIME_SMOOTHER_BUFFER; i++)
|
||||
ink->ts_buffer[i] = initval;
|
||||
}
|
||||
|
||||
static guint32
|
||||
time_smoother_result (GimpInk *ink)
|
||||
{
|
||||
guint64 result = 0;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < TIME_SMOOTHER_BUFFER; i++)
|
||||
result += ink->ts_buffer[i];
|
||||
|
||||
return (result / (guint64) TIME_SMOOTHER_BUFFER);
|
||||
}
|
||||
|
||||
static void
|
||||
time_smoother_add (GimpInk *ink,
|
||||
guint32 value)
|
||||
{
|
||||
guint64 long_value = (guint64) value;
|
||||
|
||||
/* handle wrap-around of time values */
|
||||
if (long_value < ink->ts_buffer[ink->ts_index])
|
||||
long_value += (guint64) + G_MAXUINT32;
|
||||
|
||||
ink->ts_buffer[ink->ts_index++] = long_value;
|
||||
|
||||
ink->ts_buffer[ink->ts_index++] = value;
|
||||
|
||||
if (ink->ts_index == TIME_SMOOTHER_BUFFER)
|
||||
ink->ts_index = 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
dist_smoother_init (GimpInk *ink,
|
||||
gdouble initval)
|
||||
{
|
||||
gint i;
|
||||
|
||||
ink->dt_index = 0;
|
||||
|
||||
for (i = 0; i < DIST_SMOOTHER_BUFFER; i++)
|
||||
ink->dt_buffer[i] = initval;
|
||||
}
|
||||
|
||||
static gdouble
|
||||
dist_smoother_result (GimpInk *ink)
|
||||
{
|
||||
gint i;
|
||||
gdouble result = 0.0;
|
||||
|
||||
for (i = 0; i < DIST_SMOOTHER_BUFFER; i++)
|
||||
result += ink->dt_buffer[i];
|
||||
|
||||
return (result / (gdouble) DIST_SMOOTHER_BUFFER);
|
||||
}
|
||||
|
||||
static void
|
||||
dist_smoother_add (GimpInk *ink,
|
||||
gdouble value)
|
||||
{
|
||||
ink->dt_buffer[ink->dt_index++] = value;
|
||||
|
||||
if (ink->dt_index == DIST_SMOOTHER_BUFFER)
|
||||
ink->dt_index = 0;
|
||||
}
|
||||
|
||||
|
||||
/*********************************/
|
||||
/* Rendering functions */
|
||||
/*********************************/
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
#include "gimpink-blob.h"
|
||||
|
||||
|
||||
#define DIST_SMOOTHER_BUFFER 10
|
||||
#define TIME_SMOOTHER_BUFFER 10
|
||||
|
||||
|
||||
#define GIMP_TYPE_INK (gimp_ink_get_type ())
|
||||
#define GIMP_INK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_INK, GimpInk))
|
||||
#define GIMP_INK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_INK, GimpInkClass))
|
||||
|
@ -46,18 +42,6 @@ struct _GimpInk
|
|||
|
||||
Blob *cur_blob; /* current blob */
|
||||
Blob *last_blob; /* blob for last cursor position */
|
||||
|
||||
/* circular distance history buffer */
|
||||
gdouble dt_buffer[DIST_SMOOTHER_BUFFER];
|
||||
gint dt_index;
|
||||
|
||||
/* circular timing history buffer */
|
||||
guint32 ts_buffer[TIME_SMOOTHER_BUFFER];
|
||||
gint ts_index;
|
||||
|
||||
guint32 last_time; /* previous time of a motion event */
|
||||
|
||||
gboolean init_velocity;
|
||||
};
|
||||
|
||||
struct _GimpInkClass
|
||||
|
|
|
@ -82,20 +82,6 @@ gimp_ink_undo_constructor (GType type,
|
|||
if (ink->start_blob)
|
||||
ink_undo->last_blob = blob_duplicate (ink->start_blob);
|
||||
|
||||
memcpy (ink_undo->dt_buffer, ink->dt_buffer,
|
||||
sizeof (ink_undo->dt_buffer));
|
||||
|
||||
ink_undo->dt_index = ink->dt_index;
|
||||
|
||||
memcpy (ink_undo->ts_buffer, ink->ts_buffer,
|
||||
sizeof (ink_undo->ts_buffer));
|
||||
|
||||
ink_undo->ts_index = ink->ts_index;
|
||||
|
||||
ink_undo->last_time = ink->last_time;
|
||||
|
||||
ink_undo->init_velocity = ink->init_velocity;
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
|
@ -112,44 +98,11 @@ gimp_ink_undo_pop (GimpUndo *undo,
|
|||
{
|
||||
GimpInk *ink = GIMP_INK (GIMP_PAINT_CORE_UNDO (ink_undo)->paint_core);
|
||||
Blob *tmp_blob;
|
||||
gint tmp_int;
|
||||
gdouble tmp_double;
|
||||
guint32 tmp_int_buf[DIST_SMOOTHER_BUFFER];
|
||||
gdouble tmp_double_buf[DIST_SMOOTHER_BUFFER];
|
||||
|
||||
tmp_blob = ink->last_blob;
|
||||
ink->last_blob = ink_undo->last_blob;
|
||||
ink_undo->last_blob = tmp_blob;
|
||||
|
||||
memcpy (tmp_double_buf, ink->dt_buffer,
|
||||
sizeof (tmp_double_buf));
|
||||
memcpy (ink->dt_buffer, ink_undo->dt_buffer,
|
||||
sizeof (tmp_double_buf));
|
||||
memcpy (ink_undo->dt_buffer, tmp_double_buf,
|
||||
sizeof (tmp_double_buf));
|
||||
|
||||
tmp_int = ink->dt_index;
|
||||
ink->dt_index = ink_undo->dt_index;
|
||||
ink_undo->dt_index = tmp_int;
|
||||
|
||||
memcpy (tmp_int_buf, ink->ts_buffer,
|
||||
sizeof (tmp_int_buf));
|
||||
memcpy (ink->ts_buffer, ink_undo->ts_buffer,
|
||||
sizeof (tmp_int_buf));
|
||||
memcpy (ink_undo->ts_buffer, tmp_int_buf,
|
||||
sizeof (tmp_int_buf));
|
||||
|
||||
tmp_int = ink->ts_index;
|
||||
ink->ts_index = ink_undo->ts_index;
|
||||
ink_undo->ts_index = tmp_int;
|
||||
|
||||
tmp_double = ink->last_time;
|
||||
ink->last_time = ink_undo->last_time;
|
||||
ink_undo->last_time = tmp_double;
|
||||
|
||||
tmp_int = ink->init_velocity;
|
||||
ink->init_velocity = ink_undo->init_velocity;
|
||||
ink_undo->init_velocity = tmp_int;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,16 +38,6 @@ struct _GimpInkUndo
|
|||
GimpPaintCoreUndo parent_instance;
|
||||
|
||||
Blob *last_blob;
|
||||
|
||||
gdouble dt_buffer[DIST_SMOOTHER_BUFFER];
|
||||
gint dt_index;
|
||||
|
||||
guint32 ts_buffer[TIME_SMOOTHER_BUFFER];
|
||||
gint ts_index;
|
||||
|
||||
gdouble last_time;
|
||||
|
||||
gboolean init_velocity;
|
||||
};
|
||||
|
||||
struct _GimpInkUndoClass
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
#define TARGET_SIZE 15
|
||||
#define TARGET_SIZE 15
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
@ -283,11 +283,11 @@ gimp_blend_tool_motion (GimpTool *tool,
|
|||
blend_tool->end_y = coords->y;
|
||||
}
|
||||
|
||||
/* Restrict to multiples of 15 degrees if ctrl is pressed */
|
||||
if (state & GDK_CONTROL_MASK)
|
||||
{
|
||||
gimp_tool_motion_constrain (blend_tool->start_x, blend_tool->start_y,
|
||||
&blend_tool->end_x, &blend_tool->end_y);
|
||||
&blend_tool->end_x, &blend_tool->end_y,
|
||||
GIMP_TOOL_CONSTRAIN_15_DEGREES);
|
||||
}
|
||||
|
||||
gimp_tool_pop_status (tool, display);
|
||||
|
@ -319,7 +319,8 @@ gimp_blend_tool_active_modifier_key (GimpTool *tool,
|
|||
if (press)
|
||||
{
|
||||
gimp_tool_motion_constrain (blend_tool->start_x, blend_tool->start_y,
|
||||
&blend_tool->end_x, &blend_tool->end_y);
|
||||
&blend_tool->end_x, &blend_tool->end_y,
|
||||
GIMP_TOOL_CONSTRAIN_15_DEGREES);
|
||||
}
|
||||
|
||||
gimp_tool_pop_status (tool, display);
|
||||
|
|
|
@ -196,22 +196,18 @@ static void
|
|||
gimp_brightness_contrast_tool_map (GimpImageMapTool *im_tool)
|
||||
{
|
||||
GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
|
||||
gdouble brightness;
|
||||
gdouble contrast;
|
||||
|
||||
if (im_tool->operation)
|
||||
{
|
||||
gdouble brightness;
|
||||
gdouble contrast;
|
||||
brightness = bc_tool->brightness / 256.0;
|
||||
contrast = (bc_tool->contrast < 0 ?
|
||||
(bc_tool->contrast + 127.0) / 127.0 :
|
||||
bc_tool->contrast * 4.0 / 127.0 + 1);
|
||||
|
||||
brightness = bc_tool->brightness / 256.0;
|
||||
contrast = (bc_tool->contrast < 0 ?
|
||||
(bc_tool->contrast + 127.0) / 127.0 :
|
||||
bc_tool->contrast * 4.0 / 127.0 + 1);
|
||||
|
||||
gegl_node_set (im_tool->operation,
|
||||
"brightness", brightness,
|
||||
"contrast", contrast,
|
||||
NULL);
|
||||
}
|
||||
gegl_node_set (im_tool->operation,
|
||||
"brightness", brightness,
|
||||
"contrast", contrast,
|
||||
NULL);
|
||||
|
||||
brightness_contrast_lut_setup (bc_tool->lut,
|
||||
bc_tool->brightness / 255.0,
|
||||
|
|
|
@ -43,15 +43,16 @@
|
|||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gimp_color_balance_tool_finalize (GObject *object);
|
||||
static void gimp_color_balance_tool_finalize (GObject *object);
|
||||
|
||||
static gboolean gimp_color_balance_tool_initialize (GimpTool *tool,
|
||||
GimpDisplay *display,
|
||||
GError **error);
|
||||
static gboolean gimp_color_balance_tool_initialize (GimpTool *tool,
|
||||
GimpDisplay *display,
|
||||
GError **error);
|
||||
|
||||
static void gimp_color_balance_tool_map (GimpImageMapTool *im_tool);
|
||||
static void gimp_color_balance_tool_dialog (GimpImageMapTool *im_tool);
|
||||
static void gimp_color_balance_tool_reset (GimpImageMapTool *im_tool);
|
||||
static GeglNode * gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool);
|
||||
static void gimp_color_balance_tool_map (GimpImageMapTool *im_tool);
|
||||
static void gimp_color_balance_tool_dialog (GimpImageMapTool *im_tool);
|
||||
static void gimp_color_balance_tool_reset (GimpImageMapTool *im_tool);
|
||||
|
||||
static void color_balance_update (GimpColorBalanceTool *cb_tool);
|
||||
static void color_balance_range_callback (GtkWidget *widget,
|
||||
|
@ -97,15 +98,16 @@ gimp_color_balance_tool_class_init (GimpColorBalanceToolClass *klass)
|
|||
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
||||
GimpImageMapToolClass *im_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
|
||||
|
||||
object_class->finalize = gimp_color_balance_tool_finalize;
|
||||
object_class->finalize = gimp_color_balance_tool_finalize;
|
||||
|
||||
tool_class->initialize = gimp_color_balance_tool_initialize;
|
||||
tool_class->initialize = gimp_color_balance_tool_initialize;
|
||||
|
||||
im_tool_class->shell_desc = _("Adjust Color Balance");
|
||||
im_tool_class->shell_desc = _("Adjust Color Balance");
|
||||
|
||||
im_tool_class->map = gimp_color_balance_tool_map;
|
||||
im_tool_class->dialog = gimp_color_balance_tool_dialog;
|
||||
im_tool_class->reset = gimp_color_balance_tool_reset;
|
||||
im_tool_class->get_operation = gimp_color_balance_tool_get_operation;
|
||||
im_tool_class->map = gimp_color_balance_tool_map;
|
||||
im_tool_class->dialog = gimp_color_balance_tool_dialog;
|
||||
im_tool_class->reset = gimp_color_balance_tool_reset;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -163,10 +165,37 @@ gimp_color_balance_tool_initialize (GimpTool *tool,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_color_balance_tool_map (GimpImageMapTool *im_tool)
|
||||
static GeglNode *
|
||||
gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool)
|
||||
{
|
||||
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
|
||||
return g_object_new (GEGL_TYPE_NODE,
|
||||
"operation", "gimp-color-balance",
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_color_balance_tool_map (GimpImageMapTool *image_map_tool)
|
||||
{
|
||||
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (image_map_tool);
|
||||
ColorBalance *cb = cb_tool->color_balance;
|
||||
GimpTransferMode range;
|
||||
|
||||
for (range = GIMP_SHADOWS; range <= GIMP_HIGHLIGHTS; range++)
|
||||
{
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"range", range,
|
||||
NULL);
|
||||
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"cyan-red", cb->cyan_red[range] / 256.0,
|
||||
"magenta-green", cb->magenta_green[range] / 256.0,
|
||||
"yellow-blue", cb->yellow_blue[range] / 256.0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"preserve-luminosity", cb->preserve_luminosity,
|
||||
NULL);
|
||||
|
||||
color_balance_create_lookup_tables (cb_tool->color_balance);
|
||||
}
|
||||
|
|
|
@ -171,14 +171,11 @@ gimp_colorize_tool_map (GimpImageMapTool *image_map_tool)
|
|||
{
|
||||
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
|
||||
|
||||
if (image_map_tool->operation)
|
||||
{
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"hue", col_tool->colorize->hue,
|
||||
"saturation", col_tool->colorize->saturation,
|
||||
"lightness", col_tool->colorize->lightness,
|
||||
NULL);
|
||||
}
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"hue", col_tool->colorize->hue / 360.0,
|
||||
"saturation", col_tool->colorize->saturation / 100.0,
|
||||
"lightness", col_tool->colorize->lightness / 100.0,
|
||||
NULL);
|
||||
|
||||
colorize_calculate (col_tool->colorize);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "gimpeditselectiontool.h"
|
||||
#include "gimptoolcontrol.h"
|
||||
#include "tool_manager.h"
|
||||
#include "tools-utils.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
@ -63,19 +64,23 @@
|
|||
#define ARROW_VELOCITY 25
|
||||
|
||||
|
||||
static void gimp_edit_selection_tool_button_release (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpButtonReleaseType release_type,
|
||||
GimpDisplay *display);
|
||||
static void gimp_edit_selection_tool_motion (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *display);
|
||||
|
||||
static void gimp_edit_selection_tool_draw (GimpDrawTool *tool);
|
||||
static void gimp_edit_selection_tool_button_release (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpButtonReleaseType release_type,
|
||||
GimpDisplay *display);
|
||||
static void gimp_edit_selection_tool_motion (GimpTool *tool,
|
||||
GimpCoords *coords,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *display);
|
||||
static void gimp_edit_selection_tool_active_modifier_key (GimpTool *tool,
|
||||
GdkModifierType key,
|
||||
gboolean press,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *display);
|
||||
static void gimp_edit_selection_tool_draw (GimpDrawTool *tool);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpEditSelectionTool, gimp_edit_selection_tool,
|
||||
|
@ -87,13 +92,14 @@ G_DEFINE_TYPE (GimpEditSelectionTool, gimp_edit_selection_tool,
|
|||
static void
|
||||
gimp_edit_selection_tool_class_init (GimpEditSelectionToolClass *klass)
|
||||
{
|
||||
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
||||
GimpDrawToolClass *draw_class = GIMP_DRAW_TOOL_CLASS (klass);
|
||||
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
||||
GimpDrawToolClass *draw_class = GIMP_DRAW_TOOL_CLASS (klass);
|
||||
|
||||
tool_class->button_release = gimp_edit_selection_tool_button_release;
|
||||
tool_class->motion = gimp_edit_selection_tool_motion;
|
||||
tool_class->button_release = gimp_edit_selection_tool_button_release;
|
||||
tool_class->motion = gimp_edit_selection_tool_motion;
|
||||
tool_class->active_modifier_key = gimp_edit_selection_tool_active_modifier_key;
|
||||
|
||||
draw_class->draw = gimp_edit_selection_tool_draw;
|
||||
draw_class->draw = gimp_edit_selection_tool_draw;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -111,6 +117,8 @@ gimp_edit_selection_tool_init (GimpEditSelectionTool *edit_selection_tool)
|
|||
edit_selection_tool->cumly = 0;
|
||||
|
||||
edit_selection_tool->first_move = TRUE;
|
||||
|
||||
edit_selection_tool->constrain = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -207,6 +215,12 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool,
|
|||
edit_select->x = edit_select->origx = coords->x - off_x;
|
||||
edit_select->y = edit_select->origy = coords->y - off_y;
|
||||
|
||||
/* Remember starting point for use in constrained movement */
|
||||
edit_select->start_x = coords->x;
|
||||
edit_select->start_y = coords->y;
|
||||
|
||||
edit_select->constrain = FALSE;
|
||||
|
||||
switch (edit_select->edit_mode)
|
||||
{
|
||||
case GIMP_TRANSLATE_MODE_CHANNEL:
|
||||
|
@ -542,6 +556,13 @@ gimp_edit_selection_tool_motion (GimpTool *tool,
|
|||
|
||||
gimp_item_offsets (active_item, &off_x, &off_y);
|
||||
|
||||
if (edit_select->constrain)
|
||||
{
|
||||
gimp_tool_motion_constrain (edit_select->start_x, edit_select->start_y,
|
||||
&coords->x, &coords->y,
|
||||
GIMP_TOOL_CONSTRAIN_45_DEGREES);
|
||||
}
|
||||
|
||||
motion_x = coords->x - off_x;
|
||||
motion_y = coords->y - off_y;
|
||||
|
||||
|
@ -676,6 +697,18 @@ gimp_edit_selection_tool_motion (GimpTool *tool,
|
|||
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_edit_selection_tool_active_modifier_key (GimpTool *tool,
|
||||
GdkModifierType key,
|
||||
gboolean press,
|
||||
GdkModifierType state,
|
||||
GimpDisplay *display)
|
||||
{
|
||||
GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (tool);
|
||||
|
||||
edit_select->constrain = state & GDK_CONTROL_MASK ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
|
||||
{
|
||||
|
|
|
@ -53,6 +53,9 @@ struct _GimpEditSelectionTool
|
|||
gboolean first_move; /* Don't push undos after the first */
|
||||
|
||||
gboolean propagate_release;
|
||||
|
||||
gboolean constrain; /* Constrain the movement */
|
||||
gdouble start_x, start_y;/* Coords when button was pressed */
|
||||
};
|
||||
|
||||
struct _GimpEditSelectionToolClass
|
||||
|
|
|
@ -49,15 +49,16 @@
|
|||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gimp_hue_saturation_tool_finalize (GObject *object);
|
||||
static void gimp_hue_saturation_tool_finalize (GObject *object);
|
||||
|
||||
static gboolean gimp_hue_saturation_tool_initialize (GimpTool *tool,
|
||||
GimpDisplay *display,
|
||||
GError **error);
|
||||
static gboolean gimp_hue_saturation_tool_initialize (GimpTool *tool,
|
||||
GimpDisplay *display,
|
||||
GError **error);
|
||||
|
||||
static void gimp_hue_saturation_tool_map (GimpImageMapTool *im_tool);
|
||||
static void gimp_hue_saturation_tool_dialog (GimpImageMapTool *im_tool);
|
||||
static void gimp_hue_saturation_tool_reset (GimpImageMapTool *im_tool);
|
||||
static GeglNode * gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool);
|
||||
static void gimp_hue_saturation_tool_map (GimpImageMapTool *im_tool);
|
||||
static void gimp_hue_saturation_tool_dialog (GimpImageMapTool *im_tool);
|
||||
static void gimp_hue_saturation_tool_reset (GimpImageMapTool *im_tool);
|
||||
|
||||
static void hue_saturation_update_sliders (GimpHueSaturationTool *hs_tool);
|
||||
static void hue_saturation_update_color_areas (GimpHueSaturationTool *hs_tool);
|
||||
|
@ -115,15 +116,16 @@ gimp_hue_saturation_tool_class_init (GimpHueSaturationToolClass *klass)
|
|||
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
||||
GimpImageMapToolClass *im_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
|
||||
|
||||
object_class->finalize = gimp_hue_saturation_tool_finalize;
|
||||
object_class->finalize = gimp_hue_saturation_tool_finalize;
|
||||
|
||||
tool_class->initialize = gimp_hue_saturation_tool_initialize;
|
||||
tool_class->initialize = gimp_hue_saturation_tool_initialize;
|
||||
|
||||
im_tool_class->shell_desc = _("Adjust Hue / Lightness / Saturation");
|
||||
im_tool_class->shell_desc = _("Adjust Hue / Lightness / Saturation");
|
||||
|
||||
im_tool_class->map = gimp_hue_saturation_tool_map;
|
||||
im_tool_class->dialog = gimp_hue_saturation_tool_dialog;
|
||||
im_tool_class->reset = gimp_hue_saturation_tool_reset;
|
||||
im_tool_class->get_operation = gimp_hue_saturation_tool_get_operation;
|
||||
im_tool_class->map = gimp_hue_saturation_tool_map;
|
||||
im_tool_class->dialog = gimp_hue_saturation_tool_dialog;
|
||||
im_tool_class->reset = gimp_hue_saturation_tool_reset;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -181,9 +183,37 @@ gimp_hue_saturation_tool_initialize (GimpTool *tool,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static GeglNode *
|
||||
gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool)
|
||||
{
|
||||
return g_object_new (GEGL_TYPE_NODE,
|
||||
"operation", "gimp-hue-saturation",
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_hue_saturation_tool_map (GimpImageMapTool *image_map_tool)
|
||||
{
|
||||
GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
|
||||
HueSaturation *hs = hs_tool->hue_saturation;
|
||||
GimpHueRange range;
|
||||
|
||||
for (range = GIMP_ALL_HUES; range <= GIMP_MAGENTA_HUES; range++)
|
||||
{
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"range", range,
|
||||
NULL);
|
||||
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"hue", hs->hue[range] / 180.0,
|
||||
"saturation", hs->saturation[range] / 100.0,
|
||||
"lightness", hs->lightness[range] / 100.0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"overlap", hs->overlap / 100.0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -468,6 +468,7 @@ static void
|
|||
gimp_image_map_tool_create_map (GimpImageMapTool *tool)
|
||||
{
|
||||
GimpCoreConfig *config = GIMP_TOOL (tool)->tool_info->gimp->config;
|
||||
gboolean use_gegl;
|
||||
|
||||
if (tool->image_map)
|
||||
{
|
||||
|
@ -475,14 +476,16 @@ gimp_image_map_tool_create_map (GimpImageMapTool *tool)
|
|||
g_object_unref (tool->image_map);
|
||||
}
|
||||
|
||||
if (config->use_gegl && ! tool->operation &&
|
||||
GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation)
|
||||
if (GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation)
|
||||
tool->operation = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation (tool);
|
||||
|
||||
g_assert (tool->operation || tool->apply_func);
|
||||
|
||||
use_gegl = (config->use_gegl || ! tool->apply_func);
|
||||
|
||||
tool->image_map = gimp_image_map_new (tool->drawable,
|
||||
GIMP_TOOL (tool)->tool_info->blurb,
|
||||
config->use_gegl ?
|
||||
tool->operation : NULL,
|
||||
use_gegl ? tool->operation : NULL,
|
||||
tool->apply_func,
|
||||
tool->apply_data);
|
||||
|
||||
|
@ -599,17 +602,17 @@ gimp_image_map_tool_notify_preview (GObject *config,
|
|||
GimpTool *tool = GIMP_TOOL (image_map_tool);
|
||||
GimpImageMapOptions *options = GIMP_IMAGE_MAP_OPTIONS (config);
|
||||
|
||||
if (options->preview)
|
||||
if (image_map_tool->image_map)
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
if (options->preview)
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_map_tool_map (image_map_tool);
|
||||
gimp_image_map_tool_map (image_map_tool);
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (image_map_tool->image_map)
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
|
||||
|
@ -634,7 +637,7 @@ gimp_image_map_tool_preview (GimpImageMapTool *image_map_tool)
|
|||
tool = GIMP_TOOL (image_map_tool);
|
||||
options = GIMP_IMAGE_MAP_TOOL_GET_OPTIONS (tool);
|
||||
|
||||
if (options->preview)
|
||||
if (image_map_tool->image_map && options->preview)
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
|
||||
|
|
|
@ -19,10 +19,12 @@
|
|||
#ifndef __GIMP_IMAGE_MAP_TOOL_H__
|
||||
#define __GIMP_IMAGE_MAP_TOOL_H__
|
||||
|
||||
#ifndef __GEGL_H__
|
||||
#ifdef __GNUC__
|
||||
#warning FIXME: dont include gegl.h here
|
||||
#endif
|
||||
#include <gegl.h>
|
||||
#endif /* __GEGL_H__ */
|
||||
|
||||
#include "gimpcolortool.h"
|
||||
|
||||
|
|
|
@ -269,39 +269,34 @@ gimp_levels_tool_get_operation (GimpImageMapTool *im_tool)
|
|||
static void
|
||||
gimp_levels_tool_map (GimpImageMapTool *image_map_tool)
|
||||
{
|
||||
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
|
||||
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
|
||||
GimpHistogramChannel channel;
|
||||
|
||||
if (image_map_tool->operation)
|
||||
for (channel = GIMP_HISTOGRAM_VALUE;
|
||||
channel <= GIMP_HISTOGRAM_ALPHA;
|
||||
channel++)
|
||||
{
|
||||
Levels *levels = tool->levels;
|
||||
GimpHistogramChannel channel;
|
||||
/* FIXME: hack */
|
||||
if (! tool->color && channel == 1)
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"channel", GIMP_HISTOGRAM_ALPHA,
|
||||
NULL);
|
||||
else
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"channel", channel,
|
||||
NULL);
|
||||
|
||||
for (channel = GIMP_HISTOGRAM_VALUE;
|
||||
channel <= GIMP_HISTOGRAM_ALPHA;
|
||||
channel++)
|
||||
{
|
||||
/* FIXME: hack */
|
||||
if (! tool->color && channel == 1)
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"channel", GIMP_HISTOGRAM_ALPHA,
|
||||
NULL);
|
||||
else
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"channel", channel,
|
||||
NULL);
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"gamma", tool->levels->gamma[channel],
|
||||
"low-input", tool->levels->low_input[channel] / 255.0,
|
||||
"high-input", tool->levels->high_input[channel] / 255.0,
|
||||
"low-output", tool->levels->low_output[channel] / 255.0,
|
||||
"high-output", tool->levels->high_output[channel] / 255.0,
|
||||
NULL);
|
||||
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"gamma", levels->gamma[channel],
|
||||
"low-input", levels->low_input[channel] / 255.0,
|
||||
"high-input", levels->high_input[channel] / 255.0,
|
||||
"low-output", levels->low_output[channel] / 255.0,
|
||||
"high-output", levels->high_output[channel] / 255.0,
|
||||
NULL);
|
||||
|
||||
/* FIXME: hack */
|
||||
if (! tool->color && channel == 1)
|
||||
break;
|
||||
}
|
||||
/* FIXME: hack */
|
||||
if (! tool->color && channel == 1)
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_lut_setup (tool->lut,
|
||||
|
|
|
@ -52,8 +52,8 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
#define TARGET 12
|
||||
#define ARC_RADIUS 30
|
||||
#define TARGET 12
|
||||
#define ARC_RADIUS 30
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
@ -434,7 +434,9 @@ gimp_measure_tool_motion (GimpTool *tool,
|
|||
gdouble x = measure->x[i];
|
||||
gdouble y = measure->y[i];
|
||||
|
||||
gimp_tool_motion_constrain (measure->x[0], measure->y[0], &x, &y);
|
||||
gimp_tool_motion_constrain (measure->x[0], measure->y[0],
|
||||
&x, &y,
|
||||
GIMP_TOOL_CONSTRAIN_15_DEGREES);
|
||||
|
||||
measure->x[i] = ROUND (x);
|
||||
measure->y[i] = ROUND (y);
|
||||
|
@ -505,7 +507,9 @@ gimp_measure_tool_active_modifier_key (GimpTool *tool,
|
|||
y = measure->mouse_y;
|
||||
|
||||
if (press)
|
||||
gimp_tool_motion_constrain (measure->x[0], measure->y[0], &x, &y);
|
||||
gimp_tool_motion_constrain (measure->x[0], measure->y[0],
|
||||
&x, &y,
|
||||
GIMP_TOOL_CONSTRAIN_15_DEGREES);
|
||||
|
||||
measure->x[measure->point] = ROUND (x);
|
||||
measure->y[measure->point] = ROUND (y);
|
||||
|
|
|
@ -253,10 +253,10 @@ gimp_paint_tool_round_line (GimpPaintCore *core,
|
|||
core->cur_coords.y = floor (core->cur_coords.y ) + 0.5;
|
||||
}
|
||||
|
||||
/* Restrict to multiples of 15 degrees if ctrl is pressed */
|
||||
if (state & GDK_CONTROL_MASK)
|
||||
gimp_tool_motion_constrain (core->last_coords.x, core->last_coords.y,
|
||||
&core->cur_coords.x, &core->cur_coords.y);
|
||||
&core->cur_coords.x, &core->cur_coords.y,
|
||||
GIMP_TOOL_CONSTRAIN_15_DEGREES);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -174,12 +174,9 @@ gimp_posterize_tool_map (GimpImageMapTool *image_map_tool)
|
|||
{
|
||||
GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (image_map_tool);
|
||||
|
||||
if (image_map_tool->operation)
|
||||
{
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"levels", posterize_tool->levels,
|
||||
NULL);
|
||||
}
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"levels", posterize_tool->levels,
|
||||
NULL);
|
||||
|
||||
posterize_lut_setup (posterize_tool->lut,
|
||||
posterize_tool->levels,
|
||||
|
|
|
@ -198,13 +198,10 @@ gimp_threshold_tool_map (GimpImageMapTool *image_map_tool)
|
|||
{
|
||||
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
|
||||
|
||||
if (image_map_tool->operation)
|
||||
{
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"low", t_tool->threshold->low_threshold / 255.0,
|
||||
"high", t_tool->threshold->high_threshold / 255.0,
|
||||
NULL);
|
||||
}
|
||||
gegl_node_set (image_map_tool->operation,
|
||||
"low", t_tool->threshold->low_threshold / 255.0,
|
||||
"high", t_tool->threshold->high_threshold / 255.0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,34 +25,46 @@
|
|||
#include "tools-utils.h"
|
||||
|
||||
|
||||
static gdouble gimp_tool_utils_point_to_line_distance (const GimpVector2 *point,
|
||||
const GimpVector2 *point_on_line,
|
||||
const GimpVector2 *normalized_line_direction,
|
||||
GimpVector2 *closest_line_point);
|
||||
|
||||
|
||||
/**
|
||||
* gimp_tool_motion_constrain_helper:
|
||||
* @dx: the (fixed) delta-x
|
||||
* @dy: a suggested delta-y
|
||||
* gimp_tool_utils_point_to_line_distance:
|
||||
* @point: The point to calculate the distance for.
|
||||
* @point_on_line: A point on the line.
|
||||
* @line_direction: Normalized line direction vector.
|
||||
* @closest_line_point: Gets set to the point on the line that is
|
||||
* closest to @point.
|
||||
*
|
||||
* Returns: An adjusted dy' near dy such that the slope (dx,dy')
|
||||
* is a multiple of 15 degrees.
|
||||
* Returns: The shortest distance from @point to the line defined by
|
||||
* @point_on_line and @normalized_line_direction.
|
||||
**/
|
||||
static gdouble
|
||||
gimp_tool_motion_constrain_helper (gdouble dx,
|
||||
gdouble dy)
|
||||
gimp_tool_utils_point_to_line_distance (const GimpVector2 *point,
|
||||
const GimpVector2 *point_on_line,
|
||||
const GimpVector2 *line_direction,
|
||||
GimpVector2 *closest_line_point)
|
||||
{
|
||||
static const gdouble slope[4] = { 0, 0.26795, 0.57735, 1 };
|
||||
static const gdouble divider[3] = { 0.13165, 0.41421, 0.76732 };
|
||||
gint i;
|
||||
GimpVector2 distance_vector;
|
||||
GimpVector2 tmp_a;
|
||||
GimpVector2 tmp_b;
|
||||
gdouble d;
|
||||
|
||||
if (dy < 0)
|
||||
return - gimp_tool_motion_constrain_helper (dx, -dy);
|
||||
gimp_vector2_sub (&tmp_a, point, point_on_line);
|
||||
|
||||
dx = fabs (dx);
|
||||
d = gimp_vector2_inner_product (&tmp_a, line_direction);
|
||||
|
||||
for (i = 0; i < 3; i ++)
|
||||
if (dy < dx * divider[i])
|
||||
break;
|
||||
tmp_b = gimp_vector2_mul_val (*line_direction, d);
|
||||
|
||||
dy = dx * slope[i];
|
||||
*closest_line_point = gimp_vector2_add_val (*point_on_line,
|
||||
tmp_b);
|
||||
|
||||
return dy;
|
||||
gimp_vector2_sub (&distance_vector, closest_line_point, point);
|
||||
|
||||
return gimp_vector2_length (&distance_vector);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,33 +73,47 @@ gimp_tool_motion_constrain_helper (gdouble dx,
|
|||
* @start_y:
|
||||
* @end_x:
|
||||
* @end_y:
|
||||
* @n_snap_lines: Number evenly disributed lines to snap to.
|
||||
*
|
||||
* Restricts the motion vector to 15 degree steps by changing the end
|
||||
* point (if necessary).
|
||||
* Projects a line onto the specified subset of evenly radially
|
||||
* distributed lines. @n_lines of 2 makes the line snap horizontally
|
||||
* or vertically. @n_lines of 4 snaps on 45 degree steps. @n_lines of
|
||||
* 12 on 15 degree steps. etc.
|
||||
**/
|
||||
void
|
||||
gimp_tool_motion_constrain (gdouble start_x,
|
||||
gdouble start_y,
|
||||
gdouble *end_x,
|
||||
gdouble *end_y)
|
||||
gimp_tool_motion_constrain (gdouble start_x,
|
||||
gdouble start_y,
|
||||
gdouble *end_x,
|
||||
gdouble *end_y,
|
||||
gint n_snap_lines)
|
||||
{
|
||||
gdouble dx = *end_x - start_x;
|
||||
gdouble dy = *end_y - start_y;
|
||||
GimpVector2 line_point = { start_x, start_y };
|
||||
GimpVector2 point = { *end_x, *end_y };
|
||||
GimpVector2 constrained_point;
|
||||
GimpVector2 line_dir;
|
||||
gdouble shortest_dist_moved = G_MAXDOUBLE;
|
||||
gdouble dist_moved;
|
||||
gdouble angle;
|
||||
gint i;
|
||||
|
||||
/* This algorithm changes only one of dx and dy, and does not try
|
||||
* to constrain the resulting dx and dy to integers. This gives
|
||||
* at least two benefits:
|
||||
* 1. gimp_tool_motion_constrain is idempotent, even if followed by
|
||||
* a rounding operation.
|
||||
* 2. For any two lines with the same starting-point and ideal
|
||||
* 15-degree direction, the points plotted by
|
||||
* gimp_paint_core_interpolate for the shorter line will always
|
||||
* be a superset of those plotted for the longer line.
|
||||
*/
|
||||
for (i = 0; i < n_snap_lines; i++)
|
||||
{
|
||||
angle = i * G_PI / n_snap_lines;
|
||||
|
||||
if (fabs (dx) > fabs (dy))
|
||||
*end_y = (start_y + gimp_tool_motion_constrain_helper (dx, dy));
|
||||
else
|
||||
*end_x = (start_x + gimp_tool_motion_constrain_helper (dy, dx));
|
||||
gimp_vector2_set (&line_dir,
|
||||
cos (angle),
|
||||
sin (angle));
|
||||
|
||||
dist_moved = gimp_tool_utils_point_to_line_distance (&point,
|
||||
&line_point,
|
||||
&line_dir,
|
||||
&constrained_point);
|
||||
if (dist_moved < shortest_dist_moved)
|
||||
{
|
||||
shortest_dist_moved = dist_moved;
|
||||
|
||||
*end_x = constrained_point.x;
|
||||
*end_y = constrained_point.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,10 +20,20 @@
|
|||
#define __TOOLS_UTILS_H__
|
||||
|
||||
|
||||
/*
|
||||
* Common values for the n_snap_lines parameter of
|
||||
* gimp_tool_motion_constrain.
|
||||
*/
|
||||
#define GIMP_TOOL_CONSTRAIN_90_DEGREES 2
|
||||
#define GIMP_TOOL_CONSTRAIN_45_DEGREES 4
|
||||
#define GIMP_TOOL_CONSTRAIN_15_DEGREES 12
|
||||
|
||||
|
||||
void gimp_tool_motion_constrain (gdouble start_x,
|
||||
gdouble start_y,
|
||||
gdouble *end_x,
|
||||
gdouble *end_y);
|
||||
gdouble *end_y,
|
||||
gint n_snap_lines);
|
||||
|
||||
|
||||
#endif /* __TOOLS_UTILS_H__ */
|
||||
|
|
|
@ -588,6 +588,9 @@ gimp_ui_manager_ui_popup (GimpUIManager *manager,
|
|||
if (GTK_IS_MENU_ITEM (widget))
|
||||
widget = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
||||
|
||||
if (! widget)
|
||||
return;
|
||||
|
||||
g_return_if_fail (GTK_IS_MENU (widget));
|
||||
|
||||
if (! position_func)
|
||||
|
|
|
@ -412,7 +412,7 @@ gimp_sysconf_directory (void)
|
|||
* gimp_user_directory:
|
||||
* @type: the type of user directory to retrieve
|
||||
*
|
||||
* This procedure is deprecated! Use gimp_image_get_colormap() instead.
|
||||
* This procedure is deprecated! Use g_get_user_special_dir() instead.
|
||||
*
|
||||
* Returns: The path to the specified user directory, or %NULL if the
|
||||
* logical ID was not found.
|
||||
|
|
|
@ -397,6 +397,7 @@ colorsel_cmyk_config_changed (ColorselCmyk *module)
|
|||
}
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (module->name_label), _("Profile: (none)"));
|
||||
gimp_help_set_help_data (module->name_label, NULL, NULL);
|
||||
|
||||
if (! config)
|
||||
goto out;
|
||||
|
@ -418,6 +419,7 @@ colorsel_cmyk_config_changed (ColorselCmyk *module)
|
|||
|
||||
text = g_strdup_printf (_("Profile: %s"), name);
|
||||
gtk_label_set_text (GTK_LABEL (module->name_label), text);
|
||||
gimp_help_set_help_data (module->name_label, text, NULL);
|
||||
g_free (text);
|
||||
|
||||
rgb_profile = color_config_get_rgb_profile (config);
|
||||
|
|
|
@ -174,7 +174,7 @@ gimp_module_query (GTypeModule *module)
|
|||
G_MODULE_EXPORT gboolean
|
||||
gimp_module_register (GTypeModule *module)
|
||||
{
|
||||
gimp_input_device_store_get_type (module);
|
||||
gimp_input_device_store_register_types (module);
|
||||
controller_dx_dinput_register_type (module);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -196,7 +196,7 @@ gimp_module_query (GTypeModule *module)
|
|||
G_MODULE_EXPORT gboolean
|
||||
gimp_module_register (GTypeModule *module)
|
||||
{
|
||||
gimp_input_device_store_get_type (module);
|
||||
gimp_input_device_store_register_types (module);
|
||||
controller_linux_input_register_type (module);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -76,62 +76,38 @@ struct _GimpInputDeviceStoreClass
|
|||
{
|
||||
GtkListStoreClass parent_class;
|
||||
|
||||
void (*device_added) (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
void (*device_removed) (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
void (* device_added) (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
void (* device_removed) (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
};
|
||||
|
||||
|
||||
static void gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass);
|
||||
static void gimp_input_device_store_init (GimpInputDeviceStore *store);
|
||||
static void gimp_input_device_store_finalize (GObject *object);
|
||||
static gboolean gimp_input_device_store_add (GimpInputDeviceStore *store,
|
||||
const GUID *guid);
|
||||
static gboolean gimp_input_device_store_remove (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
static void gimp_input_device_store_finalize (GObject *object);
|
||||
|
||||
static gboolean gimp_input_device_store_add (GimpInputDeviceStore *store,
|
||||
const GUID *guid);
|
||||
static gboolean gimp_input_device_store_remove (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
|
||||
|
||||
GType gimp_input_device_store_type = 0;
|
||||
static GtkListStoreClass *parent_class = NULL;
|
||||
static guint store_signals[LAST_SIGNAL] = { 0 };
|
||||
G_DEFINE_DYNAMIC_TYPE (GimpInputDeviceStore, gimp_input_device_store,
|
||||
GTK_TYPE_LIST_STORE)
|
||||
|
||||
static guint store_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
|
||||
GType
|
||||
gimp_input_device_store_get_type (GTypeModule *module)
|
||||
void
|
||||
gimp_input_device_store_register_types (GTypeModule *module)
|
||||
{
|
||||
if (! gimp_input_device_store_type)
|
||||
{
|
||||
const GTypeInfo info =
|
||||
{
|
||||
sizeof (GimpInputDeviceStoreClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_input_device_store_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpInputDeviceStore),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_input_device_store_init
|
||||
};
|
||||
|
||||
gimp_input_device_store_type =
|
||||
g_type_module_register_type (module, GTK_TYPE_LIST_STORE,
|
||||
"GimpInputDeviceStore",
|
||||
&info, 0);
|
||||
}
|
||||
|
||||
return gimp_input_device_store_type;
|
||||
gimp_input_device_store_register_type (module);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
store_signals[DEVICE_ADDED] =
|
||||
g_signal_new ("device-added",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
|
@ -156,6 +132,11 @@ gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass)
|
|||
klass->device_removed = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_input_device_store_class_finalize (GimpInputDeviceStoreClass *klass)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
aux_window_filter (GdkXEvent *xevent,
|
||||
GdkEvent *event,
|
||||
|
@ -283,7 +264,7 @@ gimp_input_device_store_finalize (GObject *object)
|
|||
store->error = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gimp_input_device_store_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -71,16 +71,15 @@ struct _GimpInputDeviceStoreClass
|
|||
{
|
||||
GtkListStoreClass parent_class;
|
||||
|
||||
void (*device_added) (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
void (*device_removed) (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
void (* device_added) (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
void (* device_removed) (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
};
|
||||
|
||||
|
||||
static void gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass);
|
||||
static void gimp_input_device_store_init (GimpInputDeviceStore *store);
|
||||
static void gimp_input_device_store_finalize (GObject *object);
|
||||
|
||||
static gboolean gimp_input_device_store_add (GimpInputDeviceStore *store,
|
||||
const gchar *udi);
|
||||
static gboolean gimp_input_device_store_remove (GimpInputDeviceStore *store,
|
||||
|
@ -92,46 +91,23 @@ static void gimp_input_device_store_device_removed (LibHalContext *ctx,
|
|||
const char *udi);
|
||||
|
||||
|
||||
GType gimp_input_device_store_type = 0;
|
||||
static GtkListStoreClass *parent_class = NULL;
|
||||
static guint store_signals[LAST_SIGNAL] = { 0 };
|
||||
G_DEFINE_DYNAMIC_TYPE (GimpInputDeviceStore, gimp_input_device_store,
|
||||
GTK_TYPE_LIST_STORE)
|
||||
|
||||
static guint store_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
|
||||
GType
|
||||
gimp_input_device_store_get_type (GTypeModule *module)
|
||||
void
|
||||
gimp_input_device_store_register_types (GTypeModule *module)
|
||||
{
|
||||
if (! gimp_input_device_store_type)
|
||||
{
|
||||
const GTypeInfo info =
|
||||
{
|
||||
sizeof (GimpInputDeviceStoreClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_input_device_store_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpInputDeviceStore),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_input_device_store_init
|
||||
};
|
||||
|
||||
gimp_input_device_store_type =
|
||||
g_type_module_register_type (module, GTK_TYPE_LIST_STORE,
|
||||
"GimpInputDeviceStore",
|
||||
&info, 0);
|
||||
}
|
||||
|
||||
return gimp_input_device_store_type;
|
||||
gimp_input_device_store_register_type (module);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
store_signals[DEVICE_ADDED] =
|
||||
g_signal_new ("device-added",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
|
@ -156,6 +132,11 @@ gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass)
|
|||
klass->device_removed = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_input_device_store_class_finalize (GimpInputDeviceStoreClass *klass)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_input_device_store_init (GimpInputDeviceStore *store)
|
||||
{
|
||||
|
@ -234,7 +215,7 @@ gimp_input_device_store_finalize (GObject *object)
|
|||
store->error = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gimp_input_device_store_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -443,10 +424,13 @@ gimp_input_device_store_get_error (GimpInputDeviceStore *store)
|
|||
|
||||
#else /* HAVE_LIBHAL */
|
||||
|
||||
GType gimp_input_device_store_type = G_TYPE_NONE;
|
||||
void
|
||||
gimp_input_device_store_register_types (GTypeModule *module)
|
||||
{
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_input_device_store_get_type (GTypeModule *module)
|
||||
gimp_input_device_store_get_type (void)
|
||||
{
|
||||
return G_TYPE_NONE;
|
||||
}
|
||||
|
@ -470,5 +454,4 @@ gimp_input_device_store_get_error (GimpInputDeviceStore *store)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#endif /* HAVE_LIBHAL */
|
||||
|
|
|
@ -23,17 +23,16 @@
|
|||
#define __GIMP_INPUT_DEVICE_STORE_H__
|
||||
|
||||
|
||||
#define GIMP_TYPE_INPUT_DEVICE_STORE (gimp_input_device_store_type)
|
||||
#define GIMP_TYPE_INPUT_DEVICE_STORE (gimp_input_device_store_get_type ())
|
||||
#define GIMP_INPUT_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_INPUT_DEVICE_STORE, GimpInputDeviceStore))
|
||||
#define GIMP_IS_INPUT_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_INPUT_DEVICE_STORE))
|
||||
|
||||
typedef struct _GimpInputDeviceStore GimpInputDeviceStore;
|
||||
|
||||
|
||||
extern GType gimp_input_device_store_type;
|
||||
|
||||
GType gimp_input_device_store_get_type (GTypeModule *module);
|
||||
void gimp_input_device_store_register_types (GTypeModule *module);
|
||||
|
||||
GType gimp_input_device_store_get_type (void);
|
||||
|
||||
GimpInputDeviceStore * gimp_input_device_store_new (void);
|
||||
gchar * gimp_input_device_store_get_device_file (GimpInputDeviceStore *store,
|
||||
|
|
|
@ -351,7 +351,6 @@ run (const gchar *name,
|
|||
bmvals.azimuth = param[4].data.d_float;
|
||||
bmvals.elevation = param[5].data.d_float;
|
||||
bmvals.depth = param[6].data.d_int32;
|
||||
bmvals.depth = param[6].data.d_int32;
|
||||
bmvals.xofs = param[7].data.d_int32;
|
||||
bmvals.yofs = param[8].data.d_int32;
|
||||
bmvals.waterlevel = param[9].data.d_int32;
|
||||
|
@ -558,7 +557,8 @@ bumpmap_init_params (bumpmap_params_t *params)
|
|||
lz = sin (elevation) * 255.0;
|
||||
|
||||
/* Calculate constant Z component of surface normal */
|
||||
nz = (6 * 255) / bmvals.depth;
|
||||
/* (depth may be 0 if non-interactive) */
|
||||
nz = (6 * 255) / MAX (bmvals.depth, 1);
|
||||
params->nz2 = nz * nz;
|
||||
params->nzlz = nz * lz;
|
||||
|
||||
|
|
|
@ -22,9 +22,7 @@ INCLUDES = \
|
|||
$(EXIF_CFLAGS) \
|
||||
-I$(includedir)
|
||||
|
||||
libexec_PROGRAMS = $(JPEG)
|
||||
|
||||
EXTRA_PROGRAMS = jpeg
|
||||
libexec_PROGRAMS = jpeg
|
||||
|
||||
jpeg_SOURCES = \
|
||||
jpeg.c \
|
||||
|
|
|
@ -55,7 +55,7 @@ def do_console():
|
|||
RESPONSE_CLEAR,
|
||||
RESPONSE_SAVE))
|
||||
|
||||
banner = ('Gimp %s Python Console\nPython %s\n' %
|
||||
banner = ('GIMP %s Python Console\nPython %s\n' %
|
||||
(gimp.pdb.gimp_version(), sys.version))
|
||||
|
||||
self.cons = pyconsole.Console(locals=namespace, banner=banner,
|
||||
|
@ -215,7 +215,7 @@ def do_console():
|
|||
|
||||
register(
|
||||
PROC_NAME,
|
||||
N_("Interactive Gimp-Python interpreter"),
|
||||
N_("Interactive GIMP Python interpreter"),
|
||||
"Type in commands and see results",
|
||||
"James Henstridge",
|
||||
"James Henstridge",
|
||||
|
|
|
@ -638,18 +638,59 @@ static PyMappingMethods pdb_as_mapping = {
|
|||
/* -------------------------------------------------------- */
|
||||
|
||||
static PyObject *
|
||||
pdb_getattro(PyGimpPDB *self, PyObject *attr)
|
||||
build_procedure_list(void)
|
||||
{
|
||||
int num, i;
|
||||
char **names, *name, *p;
|
||||
PyObject *ret;
|
||||
|
||||
ret = PyObject_GenericGetAttr((PyObject *)self, attr);
|
||||
gimp_procedural_db_query(".*", ".*", ".*", ".*", ".*", ".*", ".*",
|
||||
&num, &names);
|
||||
|
||||
ret = PyList_New(num);
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
name = g_strdup(names[i]);
|
||||
for (p = name; *p != '\0'; p++) {
|
||||
if (*p == '-')
|
||||
*p = '_';
|
||||
}
|
||||
PyList_SetItem(ret, i, PyString_FromString(name));
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
g_free(names);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
pdb_getattro(PyGimpPDB *self, PyObject *attr)
|
||||
{
|
||||
char *attr_name;
|
||||
PyObject *ret;
|
||||
|
||||
attr_name = PyString_AsString(attr);
|
||||
if (!attr_name) {
|
||||
PyErr_Clear();
|
||||
return PyObject_GenericGetAttr((PyObject *)self, attr);
|
||||
}
|
||||
|
||||
if (attr_name[0] == '_') {
|
||||
if (strcmp(attr_name, "__members__")) {
|
||||
return build_procedure_list();
|
||||
} else {
|
||||
return PyObject_GenericGetAttr((PyObject *)self, attr);
|
||||
}
|
||||
}
|
||||
|
||||
ret = PyObject_GenericGetAttr((PyObject *)self, attr);
|
||||
if (ret)
|
||||
return ret;
|
||||
return ret;
|
||||
|
||||
PyErr_Clear();
|
||||
|
||||
return pygimp_pdb_function_new_from_proc_db(PyString_AsString(attr));
|
||||
return pygimp_pdb_function_new_from_proc_db(attr_name);
|
||||
}
|
||||
|
||||
PyTypeObject PyGimpPDB_Type = {
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
RGB-IMAGE "Background" 100 NORMAL-MODE)))
|
||||
(pattern (car (gimp-layer-new img width height
|
||||
RGBA-IMAGE "Pattern" 100 NORMAL-MODE)))
|
||||
(layer2)
|
||||
(layer3)
|
||||
(pattern-mask)
|
||||
(floating-sel)
|
||||
(layer2 0)
|
||||
(layer3 0)
|
||||
(pattern-mask 0)
|
||||
(floating-sel 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
"Bumpmap"
|
||||
100
|
||||
NORMAL-MODE)))
|
||||
(select)
|
||||
(select 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -26,23 +26,23 @@
|
|||
;--- main variable: "bl-x" runs from 0 to layer-width
|
||||
(bl-x 0)
|
||||
(frame-nr 0)
|
||||
(img)
|
||||
(source-layer)
|
||||
(bg-source-layer)
|
||||
(source-layer-width)
|
||||
(bg-layer)
|
||||
(bg-layer-name)
|
||||
(bl-layer)
|
||||
(bl-layer-name)
|
||||
(bl-mask)
|
||||
(bl-layer-width)
|
||||
(bl-height)
|
||||
(bl-x-off)
|
||||
(bl-y-off)
|
||||
(nofadeout-bl-x-off)
|
||||
(nofadeout-bl-width)
|
||||
(blended-layer)
|
||||
(img-display)
|
||||
(img 0)
|
||||
(source-layer 0)
|
||||
(bg-source-layer 0)
|
||||
(source-layer-width 0)
|
||||
(bg-layer 0)
|
||||
(bg-layer-name 0)
|
||||
(bl-layer 0)
|
||||
(bl-layer-name 0)
|
||||
(bl-mask 0)
|
||||
(bl-layer-width 0)
|
||||
(bl-height 0)
|
||||
(bl-x-off 0)
|
||||
(bl-y-off 0)
|
||||
(nofadeout-bl-x-off 0)
|
||||
(nofadeout-bl-width 0)
|
||||
(blended-layer 0)
|
||||
(img-display 0)
|
||||
)
|
||||
|
||||
(if (< speed 1)
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
(theHeight inSize)
|
||||
(theImage (car (gimp-image-new theWidth theHeight RGB)))
|
||||
(baseLayer (car (gimp-layer-new theImage theWidth theHeight RGBA-IMAGE "Background" 100 NORMAL-MODE)))
|
||||
(thickLayer)
|
||||
(thinLayer)
|
||||
(theBlur)
|
||||
(thickLayer 0)
|
||||
(thinLayer 0)
|
||||
(theBlur 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -40,15 +40,15 @@
|
|||
(type (car (gimp-drawable-type-with-alpha drawable)))
|
||||
(image-width (car (gimp-image-width image)))
|
||||
(image-height (car (gimp-image-height image)))
|
||||
(active-selection)
|
||||
(from-selection)
|
||||
(selection-bounds)
|
||||
(select-offset-x)
|
||||
(select-offset-y)
|
||||
(select-width)
|
||||
(select-height)
|
||||
(effect-layer)
|
||||
(active-layer)
|
||||
(active-selection 0)
|
||||
(from-selection 0)
|
||||
(selection-bounds 0)
|
||||
(select-offset-x 0)
|
||||
(select-offset-y 0)
|
||||
(select-width 0)
|
||||
(select-height 0)
|
||||
(effect-layer 0)
|
||||
(active-layer 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
(img (car (gimp-image-new width height RGB)))
|
||||
; (layer-two (car (gimp-layer-new img width height RGB-IMAGE "Y Dots" 100 MULTIPLY-MODE)))
|
||||
(layer-one (car (gimp-layer-new img width height RGB-IMAGE "X Dots" 100 NORMAL-MODE)))
|
||||
(layer-two)
|
||||
(bump-layer)
|
||||
(layer-two 0)
|
||||
(bump-layer 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
(theWidth (car (gimp-image-width theImage)))
|
||||
(theNumber inNumber)
|
||||
(theSize (min theWidth theHeight))
|
||||
(theStain)
|
||||
(theStain 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -34,15 +34,15 @@
|
|||
|
||||
(define (init-sheet-data size)
|
||||
(let (
|
||||
(sheet-w)
|
||||
(sheet-h)
|
||||
(thumb-w)
|
||||
(thumb-h)
|
||||
(border-x) ;Space between rows and at top and bottom of thumbnails
|
||||
(border-y) ;Space between columns and at left and right of thumbnails
|
||||
(off-x) ; Additional X shift to properly center a row of thumbnails
|
||||
(off-y) ; Additional Y shift to properly center rows of thumbnails
|
||||
(count)
|
||||
(sheet-w 0)
|
||||
(sheet-h 0)
|
||||
(thumb-w 0)
|
||||
(thumb-h 0)
|
||||
(border-x 0) ;Space between rows and at top and bottom of thumbnails
|
||||
(border-y 0) ;Space between columns and at left and right of thumbnails
|
||||
(off-x 0) ; Additional X shift to properly center a row of thumbnails
|
||||
(off-y 0) ; Additional Y shift to properly center rows of thumbnails
|
||||
(count 0)
|
||||
)
|
||||
|
||||
(case size
|
||||
|
@ -108,9 +108,9 @@
|
|||
|
||||
(define (init-sheet-img img num img-width border-y off-y)
|
||||
(let* (
|
||||
(text-layer)
|
||||
(text-width)
|
||||
(text-height)
|
||||
(text-layer 0)
|
||||
(text-width 0)
|
||||
(text-height 0)
|
||||
)
|
||||
(gimp-selection-all img)
|
||||
(gimp-drawable-fill (car (gimp-image-get-active-layer img))
|
||||
|
@ -155,25 +155,25 @@
|
|||
(pos-x 0)
|
||||
(pos-y 0)
|
||||
|
||||
(sheet-data)
|
||||
(sheet-width)
|
||||
(sheet-height)
|
||||
(thumb-w)
|
||||
(thumb-h)
|
||||
(border-x)
|
||||
(border-y)
|
||||
(off-x)
|
||||
(off-y)
|
||||
(max-x)
|
||||
(max-y)
|
||||
(sheet-data 0)
|
||||
(sheet-width 0)
|
||||
(sheet-height 0)
|
||||
(thumb-w 0)
|
||||
(thumb-h 0)
|
||||
(border-x 0)
|
||||
(border-y 0)
|
||||
(off-x 0)
|
||||
(off-y 0)
|
||||
(max-x 0)
|
||||
(max-y 0)
|
||||
|
||||
(sheet-img)
|
||||
(sheet-layer)
|
||||
(sheet-img 0)
|
||||
(sheet-layer 0)
|
||||
|
||||
(new-img)
|
||||
(file)
|
||||
(file-path)
|
||||
(tmp-layer)
|
||||
(new-img 0)
|
||||
(file 0)
|
||||
(file-path 0)
|
||||
(tmp-layer 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
(theImage inImage)
|
||||
(theWidth (car (gimp-image-width inImage)))
|
||||
(theHeight (car (gimp-image-height inImage)))
|
||||
(theLayer)
|
||||
(theLayer 0)
|
||||
(theMode (car (gimp-image-base-type inImage)))
|
||||
)
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
(img (car (gimp-image-new width height RGB)))
|
||||
(layer-one (car (gimp-layer-new img width height
|
||||
RGB-IMAGE "bottom" 100 NORMAL-MODE)))
|
||||
(layer-two)
|
||||
(layer-two 0)
|
||||
)
|
||||
|
||||
(gimp-image-undo-disable img)
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
GRAY-IMAGE RGB-IMAGE)
|
||||
"Background" 100 NORMAL-MODE)))
|
||||
(count 0)
|
||||
(font)
|
||||
(font "")
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
(let (
|
||||
(theWidth (car (gimp-image-width inImage)))
|
||||
(theHeight (car (gimp-image-height inImage)))
|
||||
(theImage)
|
||||
(theLayer)
|
||||
(theImage 0)
|
||||
(theLayer 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
(posy (- (cadr (gimp-drawable-offsets logo-layer))))
|
||||
(bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE)))
|
||||
(grow-me (car (gimp-layer-copy logo-layer TRUE)))
|
||||
(dont-drop-me)
|
||||
(dont-drop-me 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
(img (car (gimp-image-new width height RGB)))
|
||||
(layer-one (car (gimp-layer-new img width height
|
||||
RGB-IMAGE "Bottom" 100 NORMAL-MODE)))
|
||||
(layer-two)
|
||||
(layer-two 0)
|
||||
)
|
||||
(gimp-context-set-gradient gradient)
|
||||
(gimp-image-undo-disable img)
|
||||
|
|
|
@ -36,14 +36,14 @@
|
|||
(type (car (gimp-drawable-type-with-alpha drawable)))
|
||||
(image-width (car (gimp-image-width image)))
|
||||
(image-height (car (gimp-image-height image)))
|
||||
(active-selection)
|
||||
(selection-bounds)
|
||||
(select-offset-x)
|
||||
(select-offset-y)
|
||||
(select-width)
|
||||
(select-height)
|
||||
(lava-layer)
|
||||
(active-layer)
|
||||
(active-selection 0)
|
||||
(selection-bounds 0)
|
||||
(select-offset-x 0)
|
||||
(select-offset-y 0)
|
||||
(select-width 0)
|
||||
(select-height 0)
|
||||
(lava-layer 0)
|
||||
(active-layer 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
|
||||
(define (script-fu-old-photo inImage inLayer inDefocus inBorderSize inSepia inMottle inCopy)
|
||||
(let (
|
||||
(theImage)
|
||||
(theLayer)
|
||||
(theWidth)
|
||||
(theHeight)
|
||||
(theImage 0)
|
||||
(theLayer 0)
|
||||
(theWidth 0)
|
||||
(theHeight 0)
|
||||
)
|
||||
(gimp-image-undo-group-start inImage)
|
||||
(gimp-selection-all inImage)
|
||||
|
|
|
@ -35,15 +35,15 @@
|
|||
(type (car (gimp-drawable-type-with-alpha drawable)))
|
||||
(image-width (car (gimp-image-width image)))
|
||||
(image-height (car (gimp-image-height image)))
|
||||
(active-selection)
|
||||
(from-selection)
|
||||
(selection-bounds)
|
||||
(select-offset-x)
|
||||
(select-offset-y)
|
||||
(select-width)
|
||||
(select-height)
|
||||
(effect-layer)
|
||||
(active-layer)
|
||||
(active-selection 0)
|
||||
(from-selection 0)
|
||||
(selection-bounds 0)
|
||||
(select-offset-x 0)
|
||||
(select-offset-y 0)
|
||||
(select-width 0)
|
||||
(select-height 0)
|
||||
(effect-layer 0)
|
||||
(active-layer 0)
|
||||
)
|
||||
|
||||
(gimp-image-undo-group-start image)
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
(theWidth inSize)
|
||||
(theHeight inSize)
|
||||
(theImage (car(gimp-image-new theWidth theHeight RGB)))
|
||||
(theLayer)
|
||||
(thinLayer)
|
||||
(theLayer 0)
|
||||
(thinLayer 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -25,19 +25,19 @@
|
|||
(height (car (gimp-drawable-height drawable)))
|
||||
(ripple-image (car (gimp-image-new width height GRAY)))
|
||||
(ripple-layer (car (gimp-layer-new ripple-image width height GRAY-IMAGE "Ripple Texture" 100 NORMAL-MODE)))
|
||||
(rippletiled-ret)
|
||||
(rippletiled-image)
|
||||
(rippletiled-layer)
|
||||
(remaining-frames)
|
||||
(xpos)
|
||||
(ypos)
|
||||
(xoffset)
|
||||
(yoffset)
|
||||
(dup-image)
|
||||
(layer-name)
|
||||
(this-image)
|
||||
(this-layer)
|
||||
(dup-layer)
|
||||
(rippletiled-ret 0)
|
||||
(rippletiled-image 0)
|
||||
(rippletiled-layer 0)
|
||||
(remaining-frames 0)
|
||||
(xpos 0)
|
||||
(ypos 0)
|
||||
(xoffset 0)
|
||||
(yoffset 0)
|
||||
(dup-image 0)
|
||||
(layer-name 0)
|
||||
(this-image 0)
|
||||
(this-layer 0)
|
||||
(dup-layer 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -330,8 +330,7 @@
|
|||
)
|
||||
|
||||
(define (prog1 form1 . form2)
|
||||
(let ((a))
|
||||
(set! a form1)
|
||||
(let ((a form1))
|
||||
(if (not (null? form2))
|
||||
form2
|
||||
)
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
(let* (
|
||||
(num-colours (car (gimp-palette-get-info palette)))
|
||||
(cmap (cons-array (* num-colours 3) 'byte))
|
||||
(colour)
|
||||
(colour 0)
|
||||
(i 0)
|
||||
)
|
||||
|
||||
|
|
|
@ -38,13 +38,13 @@
|
|||
(select-offset-y (caddr selection-bounds))
|
||||
(selection-width (- (cadr (cddr selection-bounds)) select-offset-x))
|
||||
(selection-height (- (caddr (cddr selection-bounds)) select-offset-y))
|
||||
(from-selection)
|
||||
(active-selection)
|
||||
(brush-draw-type)
|
||||
(brush-image-type)
|
||||
(brush-image)
|
||||
(brush-draw)
|
||||
(filename2)
|
||||
(from-selection 0)
|
||||
(active-selection 0)
|
||||
(brush-draw-type 0)
|
||||
(brush-image-type 0)
|
||||
(brush-image 0)
|
||||
(brush-draw 0)
|
||||
(filename2 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -32,10 +32,10 @@
|
|||
(select-offset-y (caddr selection-bounds))
|
||||
(selection-width (- (cadr (cddr selection-bounds)) select-offset-x))
|
||||
(selection-height (- (caddr (cddr selection-bounds)) select-offset-y))
|
||||
(active-selection)
|
||||
(from-selection)
|
||||
(new-image)
|
||||
(new-draw)
|
||||
(active-selection 0)
|
||||
(from-selection 0)
|
||||
(new-image 0)
|
||||
(new-draw 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -26,16 +26,16 @@
|
|||
(define (script-fu-selection-to-pattern image drawable desc filename)
|
||||
|
||||
(let* (
|
||||
(selection-width)
|
||||
(selection-height)
|
||||
(selection-bounds)
|
||||
(select-offset-x)
|
||||
(select-offset-y)
|
||||
(pattern-draw-type)
|
||||
(pattern-image-type)
|
||||
(pattern-image)
|
||||
(pattern-draw)
|
||||
(filename2)
|
||||
(selection-width 0)
|
||||
(selection-height 0)
|
||||
(selection-bounds 0)
|
||||
(select-offset-x 0)
|
||||
(select-offset-y 0)
|
||||
(pattern-draw-type 0)
|
||||
(pattern-image-type 0)
|
||||
(pattern-image 0)
|
||||
(pattern-draw 0)
|
||||
(filename2 0)
|
||||
)
|
||||
|
||||
(if (= (car (gimp-selection-is-empty image)) TRUE)
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
(saved-select 0)
|
||||
(cell-size (/ font-size 8))
|
||||
(grey (/ (* density 255) 100))
|
||||
(saved-sel)
|
||||
(text-mask)
|
||||
(saved-sel 0)
|
||||
(text-mask 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
(n 0)
|
||||
(ang (* (/ 360 inFrames)
|
||||
(if (= inFromLeft TRUE) 1 -1) ))
|
||||
(theFrame)
|
||||
(theFrame 0)
|
||||
)
|
||||
|
||||
(gimp-layer-add-alpha theLayer)
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"Adrian Likins"
|
||||
"1997"
|
||||
""
|
||||
SF-ADJUSTMENT _"Depth" '(10 0 64 1 1 0 0)
|
||||
SF-ADJUSTMENT _"Depth" '(10 1 64 1 1 0 0)
|
||||
SF-ADJUSTMENT _"Azimuth" '(135 0 360 1 10 0 0)
|
||||
SF-ADJUSTMENT _"Elevation" '(45 0 90 1 10 0 0)
|
||||
SF-ADJUSTMENT _"Blur radius" '(3 0 128 1 10 0 0)
|
||||
|
|
|
@ -194,8 +194,8 @@
|
|||
font))
|
||||
(x-position (- cx (/ (car text-extents) 2)))
|
||||
(y-position (- cy (/ (cadr text-extents) 2)))
|
||||
(shadow-w)
|
||||
(shadow-x)
|
||||
(shadow-w 0)
|
||||
(shadow-x 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -49,9 +49,9 @@
|
|||
(ndx-start 0)
|
||||
(ndx-step 1)
|
||||
(ccw 0)
|
||||
(fill-angle-rad)
|
||||
(rot-op)
|
||||
(radian-step)
|
||||
(fill-angle-rad 0)
|
||||
(rot-op 0)
|
||||
(radian-step 0)
|
||||
)
|
||||
|
||||
(gimp-image-undo-disable img)
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
drawable-width drawable-height
|
||||
RGB-IMAGE "Original"
|
||||
100 NORMAL-MODE)))
|
||||
(original-layer-for-darker)
|
||||
(original-layer-for-lighter)
|
||||
(blured-layer-for-darker)
|
||||
(blured-layer-for-lighter)
|
||||
(darker-layer)
|
||||
(lighter-layer)
|
||||
(original-layer-for-darker 0)
|
||||
(original-layer-for-lighter 0)
|
||||
(blured-layer-for-darker 0)
|
||||
(blured-layer-for-lighter 0)
|
||||
(darker-layer 0)
|
||||
(lighter-layer 0)
|
||||
)
|
||||
|
||||
(gimp-selection-all img)
|
||||
|
|
|
@ -43,12 +43,12 @@
|
|||
(image-width (car (gimp-image-width image)))
|
||||
(hl-opacity (list hl-opacity-comp hl-opacity-comp hl-opacity-comp))
|
||||
(image-height (car (gimp-image-height image)))
|
||||
(active-selection)
|
||||
(from-selection)
|
||||
(theLayer)
|
||||
(hl-layer)
|
||||
(shadow-layer)
|
||||
(mask)
|
||||
(active-selection 0)
|
||||
(from-selection 0)
|
||||
(theLayer 0)
|
||||
(hl-layer 0)
|
||||
(shadow-layer 0)
|
||||
(mask 0)
|
||||
)
|
||||
|
||||
(gimp-context-push)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2008-01-10 Maxim Dziumanenko <dziumanenko@gmail.com>
|
||||
|
||||
* uk.po: Updated Ukrainian translation.
|
||||
|
||||
2008-01-01 Marco Ciampa <ciampix@libero.it>
|
||||
|
||||
* it.po: updated italian.
|
||||
|
|
1704
po-libgimp/uk.po
1704
po-libgimp/uk.po
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,7 @@
|
|||
2008-01-10 Maxim Dziumanenko <dziumanenko@gmail.com>
|
||||
|
||||
* uk.po: Updated Ukrainian translation.
|
||||
|
||||
2007-12-31 Yannig Marchegay <yannig@marchegay.org>
|
||||
|
||||
* oc.po: Updated Occitan translation.
|
||||
|
|
11255
po-plug-ins/uk.po
11255
po-plug-ins/uk.po
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,7 @@
|
|||
2008-01-10 Maxim Dziumanenko <dziumanenko@gmail.com>
|
||||
|
||||
* uk.po: Updated Ukrainian translation.
|
||||
|
||||
2007-12-31 Yannig Marchegay <yannig@marchegay.org>
|
||||
|
||||
* oc.po: Updated Occitan translation.
|
||||
|
|
308
po-python/uk.po
308
po-python/uk.po
|
@ -1,32 +1,308 @@
|
|||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
# Yuri Syrota <rasta@renome.rovno.ua>, 2000.
|
||||
# Maxim Dziumanenko <mvd@mylinux.com.ua>, 2004
|
||||
# Maxim Dziumanenko <dziumanenko@gmail.com>, 2004-2007
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gimp-python-2.0.0\n"
|
||||
"Project-Id-Version: gimp-python-2.4.3\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2006-09-13 21:07+0200\n"
|
||||
"PO-Revision-Date: 2005-02-23 17:54+0200\n"
|
||||
"Last-Translator: Maxim Dziumanenko <mvd@mylinux.com.ua>\n"
|
||||
"POT-Creation-Date: 2007-12-15 03:23+0200\n"
|
||||
"PO-Revision-Date: 2008-01-06 17:54+0200\n"
|
||||
"Last-Translator: Maxim Dziumanenko <dziumanenko@gmail.com>\n"
|
||||
"Language-Team: Ukrainian <uk@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:43
|
||||
msgid "Python Console"
|
||||
msgstr "Консоль Скрипт-Фу"
|
||||
#: ../plug-ins/pygimp/gimpfu.py:380
|
||||
msgid "Missing exception information"
|
||||
msgstr "Відсутня інформація про виключну ситуацію"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:75
|
||||
#: ../plug-ins/pygimp/gimpfu.py:389
|
||||
#, python-format
|
||||
msgid "An error occured running %s"
|
||||
msgstr "При запуску %s виникла помилка"
|
||||
|
||||
#: ../plug-ins/pygimp/gimpfu.py:400
|
||||
msgid "_More Information"
|
||||
msgstr "_Докладніше"
|
||||
|
||||
#: ../plug-ins/pygimp/gimpfu.py:506 ../plug-ins/pygimp/gimpfu.py:518
|
||||
#: ../plug-ins/pygimp/gimpfu.py:524
|
||||
msgid "No"
|
||||
msgstr "Ні"
|
||||
|
||||
#: ../plug-ins/pygimp/gimpfu.py:516 ../plug-ins/pygimp/gimpfu.py:524
|
||||
msgid "Yes"
|
||||
msgstr "Так"
|
||||
|
||||
#: ../plug-ins/pygimp/gimpfu.py:558 ../plug-ins/pygimp/gimpui.py:222
|
||||
msgid "Python-Fu File Selection"
|
||||
msgstr "Вибір файлу в Python-Fu"
|
||||
|
||||
#: ../plug-ins/pygimp/gimpfu.py:569
|
||||
msgid "Python-Fu Folder Selection"
|
||||
msgstr "Вибір каталогу в Python-Fu"
|
||||
|
||||
#: ../plug-ins/pygimp/gimpfu.py:659
|
||||
#, python-format
|
||||
msgid "Invalid input for '%s'"
|
||||
msgstr "Некоректний ввід для '%s'"
|
||||
|
||||
#: ../plug-ins/pygimp/gimpui.py:175
|
||||
msgid "Python-Fu Color Selection"
|
||||
msgstr "Виділення кольором у Python-Fu"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:107
|
||||
msgid "Saving as colored XHTML"
|
||||
msgstr "Збереження кольорового XHTML"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:184
|
||||
msgid "Save as colored XHTML"
|
||||
msgstr "Зберегти як кольоровий XHTML"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:189
|
||||
msgid "Colored XHTML"
|
||||
msgstr "Кольоровий XHTML"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:196
|
||||
msgid "Character _source"
|
||||
msgstr "_Джерело світла"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:197
|
||||
msgid "Source code"
|
||||
msgstr "Первинний код"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:198
|
||||
msgid "Text file"
|
||||
msgstr "Текстовий файл"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:199
|
||||
msgid "Entry box"
|
||||
msgstr "Поле вводу"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:200
|
||||
msgid "_File to read or characters to use"
|
||||
msgstr "_Файл що читається або символи, що використовуються"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:202
|
||||
msgid "Fo_nt size in pixels"
|
||||
msgstr "_Кегль шрифту у точках"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/colorxhtml.py:203
|
||||
msgid "_Write a separate CSS file"
|
||||
msgstr "З_аписати окремий файл CSS"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:46
|
||||
msgid "Python Console"
|
||||
msgstr "Консоль Python"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:50
|
||||
msgid "_Browse..."
|
||||
msgstr "О_гляд..."
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gtkcons.py:217
|
||||
#, fuzzy
|
||||
msgid "Gimp-Python Console"
|
||||
msgstr "Консоль Скрипт-Фу"
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:132
|
||||
msgid "Python Procedure Browser"
|
||||
msgstr "Перегляд процедур Python"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:161
|
||||
#, python-format
|
||||
msgid "Could not open '%s' for writing: %s"
|
||||
msgstr "Не вдається відкрити '%s' для запису: %s"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:176
|
||||
#, python-format
|
||||
msgid "Could not write to '%s': %s"
|
||||
msgstr "Не вдається записати у '%s': %s"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:184
|
||||
msgid "Save Python-Fu Console Output"
|
||||
msgstr "Зберегти вивід консолі Python-Fu"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:218
|
||||
msgid "Interactive Gimp-Python interpreter"
|
||||
msgstr "Інтерактивна консоль для розробки на Python"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gimpcons.py:223
|
||||
msgid "_Console"
|
||||
msgstr "_Консоль"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/foggify.py:53
|
||||
msgid "Add a layer of fog"
|
||||
msgstr "Додати шар туману"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/foggify.py:58
|
||||
msgid "_Fog..."
|
||||
msgstr "_Туман..."
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/foggify.py:63
|
||||
msgid "_Layer name"
|
||||
msgstr "_Назва шару"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/foggify.py:63
|
||||
msgid "Clouds"
|
||||
msgstr "Хмари"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/foggify.py:64
|
||||
msgid "_Fog color"
|
||||
msgstr "_Колір туману"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/foggify.py:65
|
||||
msgid "_Turbulence"
|
||||
msgstr "Т_урбулентність"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/foggify.py:66
|
||||
msgid "Op_acity"
|
||||
msgstr "_Непрозорість"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-offset.py:45
|
||||
msgid "Offset the colors in a palette"
|
||||
msgstr "Зсунути кольори у палитрі"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-offset.py:50
|
||||
msgid "_Offset Palette..."
|
||||
msgstr "_Зсув палітри..."
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-offset.py:53
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:57
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-to-gradient.py:57
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-to-gradient.py:79
|
||||
msgid "Palette"
|
||||
msgstr "Палітра"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-offset.py:54
|
||||
msgid "Off_set"
|
||||
msgstr "Зс_ув"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:49
|
||||
msgid "Sort the colors in a palette"
|
||||
msgstr "Сортувати кольори у палитрі"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:54
|
||||
msgid "_Sort Palette..."
|
||||
msgstr "Сортувати _палітру..."
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:58
|
||||
msgid "Color _model"
|
||||
msgstr "Кольорова _модель"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:59
|
||||
msgid "RGB"
|
||||
msgstr "RGB"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:60
|
||||
msgid "HSV"
|
||||
msgstr "HSV"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:61
|
||||
msgid "Channel to _sort"
|
||||
msgstr "Сортовані _канали"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:62
|
||||
msgid "Red or Hue"
|
||||
msgstr "Червоний або тон"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:63
|
||||
msgid "Green or Saturation"
|
||||
msgstr "Зелений або насиченість"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:64
|
||||
msgid "Blue or Value"
|
||||
msgstr "Синій або яскравість"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-sort.py:65
|
||||
msgid "_Ascending"
|
||||
msgstr "_Зростаючий"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-to-gradient.py:50
|
||||
msgid "Create a repeating gradient using colors from the palette"
|
||||
msgstr "Створити з кольорів палітри градієнт, що повторюється"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-to-gradient.py:55
|
||||
msgid "Palette to _Repeating Gradient"
|
||||
msgstr "П_алітра на градієнт, що повторюється"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-to-gradient.py:72
|
||||
msgid "Create a gradient using colors from the palette"
|
||||
msgstr "Створити градієнт, використовуючи кольори палітри"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/palette-to-gradient.py:77
|
||||
msgid "Palette to _Gradient"
|
||||
msgstr "Палітра на _градиент"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:57
|
||||
msgid "Slice"
|
||||
msgstr "Нарізка"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:416
|
||||
msgid "Cuts an image along its guides, creates images and a HTML table snippet"
|
||||
msgstr "Розрізати зображення за напрямними у HTML-таблицю з його фрагментами"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:427
|
||||
msgid "_Slice..."
|
||||
msgstr "_Нарізка для веб..."
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:432
|
||||
msgid "Path for HTML export"
|
||||
msgstr "Каталог експорту"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:433
|
||||
msgid "Filename for export"
|
||||
msgstr "Назва файлу, що експортується"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:434
|
||||
msgid "Image name prefix"
|
||||
msgstr "Префікс назви файлу"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:435
|
||||
msgid "Image format"
|
||||
msgstr "Формат зображення"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:436
|
||||
msgid "Separate image folder"
|
||||
msgstr "Зображення у окремому каталозі"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:438
|
||||
msgid "Folder for image export"
|
||||
msgstr "Назва каталогу зображень"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:439
|
||||
msgid "Space between table elements"
|
||||
msgstr "Пробіл між елементами таблиці"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:441
|
||||
msgid "Javascript for onmouseover and clicked"
|
||||
msgstr "JavaScript для onmouseover та clicked"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/py-slice.py:443
|
||||
msgid "Skip animation for table caps"
|
||||
msgstr "Пропустити анімацію для заголовків таблиці"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/shadow_bevel.py:61
|
||||
msgid "Add a drop shadow to a layer, and optionally bevel it"
|
||||
msgstr "Додати до зображення тінь та додати бордюр"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/shadow_bevel.py:66
|
||||
msgid "_Drop Shadow and Bevel..."
|
||||
msgstr "Тінь з _бордюром"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/shadow_bevel.py:71
|
||||
msgid "_Shadow blur"
|
||||
msgstr "_Розмитість тіні"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/shadow_bevel.py:72
|
||||
msgid "_Bevel"
|
||||
msgstr "_Бордюр"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/shadow_bevel.py:73
|
||||
msgid "_Drop shadow"
|
||||
msgstr "_Тінь"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/shadow_bevel.py:74
|
||||
msgid "Drop shadow _X displacement"
|
||||
msgstr "Зсув тіні за _X"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/shadow_bevel.py:75
|
||||
msgid "Drop shadow _Y displacement"
|
||||
msgstr "Зсув тіні за _Y"
|
||||
|
||||
#: ../plug-ins/pygimp/plug-ins/gtkcons.py:218
|
||||
msgid "Interactive Python Development"
|
||||
msgstr ""
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2008-01-10 Maxim Dziumanenko <dziumanenko@gmail.com>
|
||||
|
||||
* uk.po: Updated Ukrainian translation.
|
||||
|
||||
2007-12-31 Yannig Marchegay <yannig@marchegay.org>
|
||||
|
||||
* oc.po: Updated Occitan translation.
|
||||
|
|
3106
po-script-fu/uk.po
3106
po-script-fu/uk.po
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,7 @@
|
|||
2008-01-10 Maxim Dziumanenko <dziumanenko@gmail.com>
|
||||
|
||||
* uk.po: Updated Ukrainian translation.
|
||||
|
||||
2007-12-31 Yannig Marchegay <yannig@marchegay.org>
|
||||
|
||||
* oc.po: Updated Occitan translation.
|
||||
|
|
288
po-tips/uk.po
288
po-tips/uk.po
|
@ -1,49 +1,46 @@
|
|||
# Ukrainian tranlation to gimp tips
|
||||
# Copyright (C) 2004 Free Software Foundation
|
||||
# This file is distributed under the same license as the gimp package.
|
||||
# Maxim Dziumanenko <mvd@mylinux.com.ua>, 2004.
|
||||
# Maxim Dziumanenko <dziumanenko@gmail.com>, 2004-2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gimp tips\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2005-05-14 17:18+0200\n"
|
||||
"PO-Revision-Date: 2005-02-24 13:45+0200\n"
|
||||
"Last-Translator: Maxim Dziumanenko <mvd@mylinux.com.ua>\n"
|
||||
"POT-Creation-Date: 2008-01-02 22:50+0200\n"
|
||||
"PO-Revision-Date: 2008-01-02 13:45+0200\n"
|
||||
"Last-Translator: Maxim Dziumanenko <dziumanenko@gmail.com>\n"
|
||||
"Language-Team: Ukrainian <uk@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:1
|
||||
#: ../data/tips/gimp-tips.xml.in.h:1
|
||||
msgid "<big>Welcome to the GNU Image Manipulation Program!</big>"
|
||||
msgstr "<big>Ласкаво просимо до GIMP!</big>"
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:2
|
||||
msgid ""
|
||||
"<tt>Alt</tt>-click on the layer mask's preview in the Layers dialog toggles "
|
||||
"viewing the mask directly."
|
||||
msgstr ""
|
||||
"Щоб побачити маску шару у вікні зображення, натисніть кнопкою миші на ескізі "
|
||||
"маски у діалоговому вікні шарів, утримуючи при цьому клавішу <tt>Alt</tt>."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:3
|
||||
msgid ""
|
||||
"<tt>Ctrl</tt>-click on the layer mask's preview in the Layers dialog toggles "
|
||||
"the effect of the layer mask."
|
||||
msgstr ""
|
||||
"Щоб перемикнути активність маски шару, натисніть кнопкою миші на ескізі, "
|
||||
"утримуючи при цьому клавішу <tt>Ctrl</tt>."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:4
|
||||
#: ../data/tips/gimp-tips.xml.in.h:2
|
||||
msgid ""
|
||||
"<tt>Ctrl</tt>-click with the Bucket Fill tool to have it use the background "
|
||||
"color instead of the foreground color."
|
||||
"color instead of the foreground color. Similarly, <tt>Ctrl</tt>-clicking "
|
||||
"with the eyedropper tool sets the background color instead of the foreground "
|
||||
"color."
|
||||
msgstr ""
|
||||
"Інструмент "Заповнення" зазвичай використовує колір переднього "
|
||||
"плану. Щоб заповнити ділянку кольором тла, натискайте клавішу <tt>Ctrl</tt>."
|
||||
"Інструмент «Заповнення» зазвичай використовує колір переднього "
|
||||
"плану. Щоб заповнити ділянку кольором тла, натискайте клавішу <tt>Ctrl</tt>. Аналогічно, "
|
||||
"при натиснутій клавіші <tt>Ctrl</tt> піпетка знімає колір для тла, а не для "
|
||||
"переднього плану."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:5
|
||||
#: ../data/tips/gimp-tips.xml.in.h:3
|
||||
msgid ""
|
||||
"<tt>Ctrl</tt>-clicking on the layer mask's preview in the Layers dialog "
|
||||
"toggles the effect of the layer mask. <tt>Alt</tt>-clicking on the layer "
|
||||
"mask's preview in the Layers dialog toggles viewing the mask directly."
|
||||
msgstr ""
|
||||
"Щоб перемикнути активність маски шару, натисніть кнопкою миші на ескізі, "
|
||||
"утримуючи при цьому клавішу <tt>Ctrl</tt>. <tt>Alt</tt>+клацання на ескізі маски"
|
||||
|
||||
#: ../data/tips/gimp-tips.xml.in.h:4
|
||||
msgid ""
|
||||
"<tt>Ctrl</tt>-drag with the Rotate tool will constrain the rotation to 15 "
|
||||
"degree angles."
|
||||
|
@ -51,7 +48,7 @@ msgstr ""
|
|||
"Натискання <tt>Ctrl</tt> у інструменті "Обертання" при обертанні, "
|
||||
"призводить до повороту на кут кратний 15 градусам."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:6
|
||||
#: ../data/tips/gimp-tips.xml.in.h:5
|
||||
msgid ""
|
||||
"<tt>Shift</tt>-click on the eye icon in the Layers dialog to hide all layers "
|
||||
"but that one. <tt>Shift</tt>-click again to show all layers."
|
||||
|
@ -61,7 +58,7 @@ msgstr ""
|
|||
"на чий значок натиснули. Щоб зробити всі шари знову видимими, натисніть на "
|
||||
"той самий значок, утримуючи клавішу <tt>Shift</tt>."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:7
|
||||
#: ../data/tips/gimp-tips.xml.in.h:6
|
||||
msgid ""
|
||||
"A floating selection must be anchored to a new layer or to the last active "
|
||||
"layer before doing other operations on the image. Click on the "New "
|
||||
|
@ -74,22 +71,26 @@ msgstr ""
|
|||
""Шари" або "Прикріпити плаваючий шар", або виберіть цю "
|
||||
"функцію з меню."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:8
|
||||
#: ../data/tips/gimp-tips.xml.in.h:7
|
||||
msgid ""
|
||||
"After you enabled "Dynamic Keyboard Shortcuts" in the Preferences "
|
||||
"dialog, you can reassign shortcut keys. Do so by bringing up the menu, "
|
||||
"selecting a menu item, and pressing the desired key combination. If ""
|
||||
"Save Keyboard Shortcuts" is enabled, the key bindings are saved when "
|
||||
"you exit GIMP."
|
||||
"you exit GIMP. You should probably disable "Dynamic Keyboard "
|
||||
"Shortcuts" afterwards, to prevent accidentally assigning/reassigning "
|
||||
"shortcuts."
|
||||
msgstr ""
|
||||
"Після ввімкнення функції "Динамічні комбінації клавіш" у "
|
||||
"діалоговому вікні Параметри\" ви можете перевизначати комбінації клавіш. Для "
|
||||
"Після ввімкнення функції «Динамічні комбінації клавіш» у "
|
||||
"діалоговому вікні Параметри\" можна перевизначати комбінації клавіш. Для "
|
||||
"цього відкрийте меню наведіть вказівник на потрібний пункт меню, та "
|
||||
"натисніть бажану комбінацію клавіш. Якщо ввімкнено "Зберігати "
|
||||
"комбінації клавіш при виході", вона буде збережена під час виходу з "
|
||||
"програми GIMP."
|
||||
"натисніть бажану комбінацію клавіш. Якщо ввімкнено «Зберігати "
|
||||
"комбінації клавіш при виході», вона буде збережена під час виходу з "
|
||||
"програми GIMP. Після встановлення "
|
||||
"всіх комбінацій, можливо, варто вимкнути динамічне запам'ятовування, щоб "
|
||||
"випадково нічого не переназначити."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:9
|
||||
#: ../data/tips/gimp-tips.xml.in.h:8
|
||||
msgid ""
|
||||
"Click and drag on a ruler to place a guide on an image. All dragged "
|
||||
"selections will snap to the guides. You can remove guides by dragging them "
|
||||
|
@ -98,104 +99,103 @@ msgstr ""
|
|||
"Щоб помістити напрямну на зображення натисніть на лінійку та перетягніть. "
|
||||
"Всі виділені області, які переміщуватимуться, будуть причіплюватись до "
|
||||
"напрямних. Видалити напрямні можна перетягнувши їх за межі зображення за "
|
||||
"допомогою інструменту "Переміщення"."
|
||||
"допомогою інструменту «Переміщення»."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:10
|
||||
#, fuzzy
|
||||
#: ../data/tips/gimp-tips.xml.in.h:9
|
||||
msgid ""
|
||||
"GIMP allows you to undo most changes to the image, so feel free to "
|
||||
"experiment."
|
||||
msgstr ""
|
||||
"У GIMP можна скасувати більшість змін зображення, тому можете сміливо "
|
||||
"У GIMP можна скасувати більшість внесених змін, тому можете сміливо "
|
||||
"експериментувати."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:11
|
||||
#, fuzzy
|
||||
#: ../data/tips/gimp-tips.xml.in.h:10
|
||||
msgid ""
|
||||
"GIMP supports gzip compression on the fly. Just add <tt>.gz</tt> (or <tt>."
|
||||
"bz2</tt>, if you have bzip2 installed) to the filename and your image will "
|
||||
"be saved compressed. Of course loading compressed images works too."
|
||||
msgstr ""
|
||||
"GIMP підтримує стискання gzip "на ходу". Просто додайте <tt>.gz</"
|
||||
"GIMP підтримує стискання gzip «на ходу». Просто додайте <tt>.gz</"
|
||||
"tt> (чи <tt>.bz2</tt>, якщо у вас встановлено bzip2) до назви файлу, та ваше "
|
||||
"зображення буде збережено стисненим. Звичайно, стиснені зображення можна "
|
||||
"відкривати як звичайні."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:12
|
||||
#, fuzzy
|
||||
#: ../data/tips/gimp-tips.xml.in.h:11
|
||||
msgid ""
|
||||
"GIMP uses layers to let you organize your image. Think of them as a stack of "
|
||||
"slides or filters, such that looking through them you see a composite of "
|
||||
"their contents."
|
||||
msgstr ""
|
||||
"Для створення структури зображення, GIMP використовує шари. Щоб отримати про "
|
||||
"Для створення складного зображення у GIMP використовує шари. Щоб отримати про "
|
||||
"них уяву, уявіть стопку прозорих плівок із зображеннями, так що при "
|
||||
"перегляді ви бачите вміст одразу всіх плівок."
|
||||
"перегляді видимий вміст одразу всіх плівок."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:13
|
||||
#: ../data/tips/gimp-tips.xml.in.h:12
|
||||
msgid ""
|
||||
"If a layer's name in the Layers dialog is displayed in <b>bold</b>, this "
|
||||
"layer doesn't have an alpha-channel. You can add an alpha-channel using "
|
||||
"Layer->Transparency->Add Alpha Channel."
|
||||
"Layer→Transparency→Add Alpha Channel."
|
||||
msgstr ""
|
||||
"Якщо назва шару у палітрі шарів відображається <b>жирним</b> шрифтом, це "
|
||||
"означає, що цей шар не має альфа-каналу. Ви можете додати альфа-"
|
||||
"канал у меню «Шар→Прозорість→Додати альфа-канал»."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:14
|
||||
#: ../data/tips/gimp-tips.xml.in.h:13
|
||||
msgid ""
|
||||
"If some of your scanned photos do not look colorful enough, you can easily "
|
||||
"improve their tonal range with the "Auto" button in the Levels "
|
||||
"tool (Layer->Colors->Levels). If there are any color casts, you can "
|
||||
"correct them with the Curves tool (Layer->Colors->Curves)."
|
||||
"tool (Colors→Levels). If there are any color casts, you can correct them "
|
||||
"with the Curves tool (Colors→Curves)."
|
||||
msgstr ""
|
||||
"Якщо відскановані зображення виглядають недостатньо кольоровими, їх "
|
||||
"тональний діапазон можна виправити за допомогою кнопки "Авто" у "
|
||||
"діалоговому вікні "Рівні" (Шар->Кольори->Рівні). Відтінки "
|
||||
"кольору можна скорегувати інструментом "Криві" (Шар->Кольори-"
|
||||
">Криві)."
|
||||
"Якщо кольори сканованих зображення виглядають недостатньо соковитими, їх "
|
||||
"тональний діапазон можна виправити за допомогою кнопки «Авто» у "
|
||||
"діалоговому вікні «Рівні» (Колір→Рівні). Відтінки "
|
||||
"кольору можна скоригувати інструментом «Криві» (Колір→Криві)."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:15
|
||||
#: ../data/tips/gimp-tips.xml.in.h:14
|
||||
msgid ""
|
||||
"If you stroke a path (Edit->Stroke Path), the paint tools can be used "
|
||||
"with their current settings. You can use the Paintbrush in gradient mode or "
|
||||
"even the Eraser or the Smudge tool."
|
||||
"If you stroke a path (Edit→Stroke Path), the paint tools can be used with "
|
||||
"their current settings. You can use the Paintbrush in gradient mode or even "
|
||||
"the Eraser or the Smudge tool."
|
||||
msgstr ""
|
||||
"При обведенні контуру (Правка->Обвести за контуром), використовується "
|
||||
"При обведенні контуру (Правка→Обвести за контуром), використовується "
|
||||
"поточний інструмент малювання з усіма параметрами. Ви можете використовувати "
|
||||
""Пензель" у режимі градієнта, або навіть інструменти ""
|
||||
"Гумка" чи "Палець"."
|
||||
"«Пензель» у режимі градієнта, «Штамп» з джерелом з шаблону, або навіть інструменти «"
|
||||
"Гумка» чи «Палець»."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:16
|
||||
#: ../data/tips/gimp-tips.xml.in.h:15
|
||||
msgid ""
|
||||
"If your screen is too cluttered, you can press <tt>Tab</tt> multiple times "
|
||||
"in an image window to hide or show the toolbox and other dialogs."
|
||||
"If your screen is too cluttered, you can press <tt>Tab</tt> in an image "
|
||||
"window to toggle the visibility of the toolbox and other dialogs."
|
||||
msgstr ""
|
||||
"Якщо ваш екран занадто засмічений вікнами, можна користуватись кнопкою "
|
||||
"Якщо на екрані мало місця, можна користуватись кнопкою "
|
||||
"<tt>Tab</tt> у вікні зображення, щоб приховати чи показати панелі "
|
||||
"інструментів та інші діалогові вікна."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:17
|
||||
#: ../data/tips/gimp-tips.xml.in.h:16
|
||||
msgid ""
|
||||
"Most plug-ins work on the current layer of the current image. In some cases, "
|
||||
"you will have to merge all layers (Image->Flatten Image) if you want the "
|
||||
"plug-in to work on the whole image."
|
||||
"you will have to merge all layers (Image→Flatten Image) if you want the plug-"
|
||||
"in to work on the whole image."
|
||||
msgstr ""
|
||||
"Більшість доповнень працюють з активним шаром зображення. У деяких випадках "
|
||||
"необхідно об'єднувати всі шари (Зображення->Звести зображення), якщо "
|
||||
"необхідно об'єднувати всі шари (Зображення→Звести зображення), якщо "
|
||||
"бажаєте щоб доповнення діяло на все зображення."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:18
|
||||
#: ../data/tips/gimp-tips.xml.in.h:17
|
||||
msgid ""
|
||||
"Not all effects can be applied to all kinds of images. This is indicated by "
|
||||
"a grayed-out menu-entry. You may need to change the image mode to RGB (Image-"
|
||||
">Mode->RGB), add an alpha-channel (Layer->Transparency->Add "
|
||||
"Alpha Channel) or flatten it (Image->Flatten Image)."
|
||||
"a grayed-out menu-entry. You may need to change the image mode to RGB "
|
||||
"(Image→Mode→RGB), add an alpha-channel (Layer→Transparency→Add Alpha "
|
||||
"Channel) or flatten it (Image→Flatten Image)."
|
||||
msgstr ""
|
||||
"Не всі ефекти можуть бути застосовані до усіх типів зображення. Це "
|
||||
"Деякі ефекти не можуть бути застосовані до усіх типів зображення. Це "
|
||||
"позначується сірим кольором елементів меню. Можливо знадобиться перевести "
|
||||
"зображення у режим RGB (Зображення->Режим->RGB), додати канал "
|
||||
"прозорості (Шари->Прозорість->Додати альфа-канал) або об'єднати шари "
|
||||
"зображення (Зображення->Звести зображення)."
|
||||
"зображення у режим RGB (Зображення→Режим→RGB), додати канал "
|
||||
"прозорості (Шар→Прозорість→Додати альфа-канал) або об'єднати шари "
|
||||
"зображення (Зображення→Звести зображення)."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:19
|
||||
#: ../data/tips/gimp-tips.xml.in.h:18
|
||||
msgid ""
|
||||
"Pressing and holding the <tt>Shift</tt> key before making a selection allows "
|
||||
"you to add to the current selection instead of replacing it. Using <tt>Ctrl</"
|
||||
|
@ -205,7 +205,7 @@ msgstr ""
|
|||
"<tt>Shift</tt>. Щоб відняти ділянку від виділеної, натисніть перед початком "
|
||||
"виділення клавішу <tt>Ctrl</tt>. "
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:20
|
||||
#: ../data/tips/gimp-tips.xml.in.h:19
|
||||
msgid ""
|
||||
"To create a circle-shaped selection, hold <tt>Shift</tt> while doing an "
|
||||
"ellipse select. To place a circle precisely, drag horizontal and vertical "
|
||||
|
@ -219,19 +219,7 @@ msgstr ""
|
|||
"кола, розташуйте вказівник у точці перетину напрямних та створіть ділянку "
|
||||
"виділення."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:21
|
||||
msgid ""
|
||||
"When using a drawing tool (Paintbrush, Airbrush, or Pencil), <tt>Shift</tt>-"
|
||||
"click will draw a straight line from your last drawing point to your current "
|
||||
"cursor position. If you also press <tt>Ctrl</tt>, the line will be "
|
||||
"constrained to 15 degree angles."
|
||||
msgstr ""
|
||||
"Щоб намалювати пряму інструментом малювання (пензлем, пером, олівцем), "
|
||||
"використовуйте клавішу <tt>Shift</tt>. Якщо ви одночасно натиснете <tt>Ctrl</"
|
||||
"tt>, кут нахилу ліній буде кратний 15 градусам."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:22
|
||||
#, fuzzy
|
||||
#: ../data/tips/gimp-tips.xml.in.h:20
|
||||
msgid ""
|
||||
"When you save an image to work on it again later, try using XCF, GIMP's "
|
||||
"native file format (use the file extension <tt>.xcf</tt>). This preserves "
|
||||
|
@ -243,76 +231,70 @@ msgstr ""
|
|||
"ньому зберігаються стан усіх шарів, масок та інших частин зображення. Після "
|
||||
"закінчення роботи над проектом можете зберегти його у JPEG, PNG, GIF, ..."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:23
|
||||
#: ../data/tips/gimp-tips.xml.in.h:21
|
||||
msgid ""
|
||||
"You can adjust or move a selection by using <tt>Alt</tt>-drag. If this makes "
|
||||
"the window move, your window manager uses the <tt>Alt</tt> key already. Try "
|
||||
"pressing <tt>Shift</tt> at the same time."
|
||||
"the window move, your window manager uses the <tt>Alt</tt> key already. Most "
|
||||
"window managers can be configured to ignore the <tt>Alt</tt> key or to use "
|
||||
"the <tt>Super</tt> key (or \"Windows logo\") instead."
|
||||
msgstr ""
|
||||
"Ви можете скорегувати та перемістити виділену ділянку використовуючи "
|
||||
"Ви можете скоригувати чи перемістити виділену ділянку використовуючи "
|
||||
"перетягування з утриманням натиснутої <tt>Alt</tt>. Якщо це призводить до "
|
||||
"переміщення цілого вікна, це означає ваш менеджер вікон вже використовує "
|
||||
"клавішу <tt>Alt</tt>. Спробуйте одночасно з цим натискати <tt>Shift</tt>."
|
||||
"клавішу <tt>Alt</tt>. Спробуйте одночасно з цим натискати <tt>Shift</tt>, або змініть "
|
||||
"настройки віконного менеджера (змінивши <tt>Alt</tt> на <tt>Super</tt> чи "
|
||||
"клавішу з логотипом Windows)."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:24
|
||||
msgid ""
|
||||
"You can adjust the selection range for fuzzy select by clicking and dragging "
|
||||
"left and right."
|
||||
msgstr ""
|
||||
"Можна скорегувати ділянку вільного виділення шляхом натискання лівої клавіші "
|
||||
"миші та переміщенням вправо та вліво."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:25
|
||||
#: ../data/tips/gimp-tips.xml.in.h:22
|
||||
msgid ""
|
||||
"You can create and edit complex selections using the Path tool. The Paths "
|
||||
"dialog allows you to work on multiple paths and to convert them to "
|
||||
"selections."
|
||||
msgstr ""
|
||||
"Можна створювати та редагувати складні ділянки виділення використовуючи "
|
||||
"інструмент "Контур". У діалоговому вікні "Контур" можна "
|
||||
"інструмент «Контур». У діалоговому вікні «Контур»; можна "
|
||||
"працювати з кількома контурами та перетворювати їх у виділення."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:26
|
||||
#: ../data/tips/gimp-tips.xml.in.h:23
|
||||
msgid ""
|
||||
"You can drag a layer from the Layers dialog and drop it onto the toolbox. "
|
||||
"This will create a new image containing only that layer."
|
||||
msgstr ""
|
||||
"Можна перемістити шар з діалогового вікна "Шари" на панель "
|
||||
"Можна перемістити шар з діалогового вікна «Шари» на панель "
|
||||
"інструментів. Це призведе до створення нового зображення, яке буде містити "
|
||||
"лише цей шар."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:27
|
||||
#, fuzzy
|
||||
#: ../data/tips/gimp-tips.xml.in.h:24
|
||||
msgid ""
|
||||
"You can drag and drop many things in GIMP. For example, dragging a color "
|
||||
"from the toolbox or from a color palette and dropping it into an image will "
|
||||
"fill the current image or selection with that color."
|
||||
"fill the current selection with that color."
|
||||
msgstr ""
|
||||
"У GIMP можна перетягувати (drag and drop) багато елементів. Наприклад, "
|
||||
"У GIMP можна перетягувати мишею багато елементів. Наприклад, "
|
||||
"перетягування кольору з панелі інструментів або з палітри на зображення "
|
||||
"призводить до заповнення цим кольором зображення (або його виділеної "
|
||||
"ділянки)."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:28
|
||||
#: ../data/tips/gimp-tips.xml.in.h:25
|
||||
msgid ""
|
||||
"You can draw simple squares or circles using Edit->Stroke Selection. It "
|
||||
"You can draw simple squares or circles using Edit→Stroke Selection. It "
|
||||
"strokes the edge of your current selection. More complex shapes can be drawn "
|
||||
"using the Path tool or with Filters->Render->Gfig."
|
||||
"using the Path tool or with Filters→Render→Gfig."
|
||||
msgstr ""
|
||||
"Можна малювати прості квадрати чи кола використовуючи меню Правка->"
|
||||
"Обвести за контуром. Даний пункт меню обводить за контуром виділену ділянку. "
|
||||
"Більш складні геометричні фігури можна намалювати використовуючи інструмент "
|
||||
""Контур" або Фільтри->Візуалізація->Gfig."
|
||||
"Можна малювати прості квадрати чи кола використовуючи меню «Правка→"
|
||||
"Обвести за контуром». Цією командою контур виділеної області обводиться "
|
||||
"активним пензлем чи типовим пунктиром. Більш складні геометричні фігури "
|
||||
"можна намалювати використовуючи інструмент «Контур» або «Фільтри→Візуалізація→Gfig»."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:29
|
||||
#: ../data/tips/gimp-tips.xml.in.h:26
|
||||
msgid ""
|
||||
"You can get context-sensitive help for most of the GIMP's features by "
|
||||
"pressing the F1 key at any time. This also works inside the menus."
|
||||
"You can get context-sensitive help for most of GIMP's features by pressing "
|
||||
"the F1 key at any time. This also works inside the menus."
|
||||
msgstr ""
|
||||
"Контекстну довідку для більшості функцій та меню GIMP можна викликати "
|
||||
"клавішею F1. Це також працює у меню."
|
||||
"клавішею F1."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:30
|
||||
#: ../data/tips/gimp-tips.xml.in.h:27
|
||||
msgid ""
|
||||
"You can perform many layer operations by right-clicking on the text label of "
|
||||
"a layer in the Layers dialog."
|
||||
|
@ -321,46 +303,38 @@ msgstr ""
|
|||
"відкривається при натисканні правої кнопки миші на назві шару у діалоговому "
|
||||
"вікні "Шари"."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:31
|
||||
#: ../data/tips/gimp-tips.xml.in.h:28
|
||||
msgid ""
|
||||
"You can press or release the <tt>Shift</tt> and <tt>Ctrl</tt> keys while you "
|
||||
"are making a selection in order to constrain it to a square or a circle, or "
|
||||
"to have it centered on its starting point."
|
||||
msgstr ""
|
||||
"Щоб створити виділену ділянку у вигляді квадрату або кола, а також, щоб "
|
||||
"створити виділену ділянку з вказаного центру, використовуйте клавіші "
|
||||
"<tt>Shift</tt> та <tt>Ctrl</tt>."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:32
|
||||
msgid ""
|
||||
"You can save a selection to a channel (Select->Save to Channel) and then "
|
||||
"You can save a selection to a channel (Select→Save to Channel) and then "
|
||||
"modify this channel with any paint tools. Using the buttons in the Channels "
|
||||
"dialog, you can toggle the visibility of this new channel or convert it to a "
|
||||
"selection."
|
||||
msgstr ""
|
||||
"Виділену ділянку можна зберегти як канал (Виділення->Зберегти в каналі), "
|
||||
"а потім редагувати цей канал за допомогою будь-яких інструментів. "
|
||||
"Використовуючи кнопки у діалоговому вікні \"Канали\", ви можете змінити "
|
||||
"Виділену ділянку можна зберегти як канал («Виділення→Зберегти в каналі»), "
|
||||
"а потім редагувати цей канал будь-яким інструментом. "
|
||||
"Кнопками у діалоговому вікні \"Канали\", можна змінити "
|
||||
"видимість каналу або перетворити його у виділену ділянку."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:33
|
||||
#: ../data/tips/gimp-tips.xml.in.h:29
|
||||
msgid ""
|
||||
"You can use <tt>Alt</tt>-<tt>Tab</tt> to cycle through all layers in an "
|
||||
"You can use <tt>Ctrl</tt>-<tt>Tab</tt> to cycle through all layers in an "
|
||||
"image (if your window manager doesn't trap those keys...)."
|
||||
msgstr ""
|
||||
"Для перемикання між шарами можна користуватись клавішами <tt>Alt</tt>-"
|
||||
"<tt>Tab</tt> (якщо ваш віконний менеджер не використовує цю комбінацію "
|
||||
"клавіш)."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:34
|
||||
#: ../data/tips/gimp-tips.xml.in.h:30
|
||||
msgid ""
|
||||
"You can use the middle mouse button to pan around the image, if it's larger "
|
||||
"than its display window."
|
||||
"You can use the middle mouse button to pan around the image (or optionally "
|
||||
"hold <tt>Spacebar</tt> while you move the mouse)."
|
||||
msgstr ""
|
||||
"Щоб переміщуватись по зображенню, яке більше ніж вікно, використовуйте "
|
||||
"середню кнопку миші."
|
||||
"Для переміщення по зображенню використовуйте середню клавішу миші. У діалозі "
|
||||
"параметрів можна змінити спосіб на більш звичний для користувачів інших "
|
||||
"програм — утримуючи натисненою клавішу <tt>пробіл</tt>, переміщувати курсор "
|
||||
"миші."
|
||||
|
||||
#: ../tips/gimp-tips.xml.in.h:35
|
||||
#: ../data/tips/gimp-tips.xml.in.h:31
|
||||
msgid ""
|
||||
"You can use the paint tools to change the selection. Click on the ""
|
||||
"Quick Mask" button at the bottom left of an image window. Change your "
|
||||
|
@ -372,14 +346,4 @@ msgstr ""
|
|||
"лівому куті вінка зображення, відредагувати виділену ділянку інструментом "
|
||||
"малювання, потім ще раз натиснути кнопку для переходу у звичайний режим."
|
||||
|
||||
#~ msgid ""
|
||||
#~ "The layer named "Background" is special because it lacks "
|
||||
#~ "transparency. This prevents you from moving the layer up in the stack. "
|
||||
#~ "You may add transparency to it by right-clicking in the Layers dialog and "
|
||||
#~ "selecting "Add Alpha Channel"."
|
||||
#~ msgstr ""
|
||||
#~ "Шар "Тло" - особливий. У ньому відсутня прозорість. Це не дає "
|
||||
#~ "змоги додати до нього маску шару або перемістити шар вгору у стеку шарів. "
|
||||
#~ "Можна додати до нього прозорість, якщо натиснути праву кнопку миші у "
|
||||
#~ "діалоговому вікні "Шари" та вибрати "Додати альфа-"
|
||||
#~ "канал"."
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2008-01-10 Maxim Dziumanenko <dziumanenko@gmail.com>
|
||||
|
||||
* uk.po: Updated Ukrainian translation.
|
||||
|
||||
2007-01-07 Jakub Friedl <jfriedl@suse.cz>
|
||||
|
||||
* cs.po: Updated Czech translation.
|
||||
|
|
Loading…
Reference in New Issue