cleaned up a bit.
2000-12-31 Michael Natterer <mitch@gimp.org> * app/apptypes.h: cleaned up a bit. * app/asupsample.[ch] * app/blend.[ch] * app/channel.h * app/gimpprogress.[ch] * app/layer.h * app/perspective_tool.c * app/plug_in.h * app/rotate_tool.c * app/scale_tool.c * app/shear_tool.c * app/transform_core.[ch]: s/gimp_progress/GimpProgress/g and some changes related to the apptypes.h cleanup.
This commit is contained in:
committed by
Michael Natterer
parent
2db8881557
commit
f16e01a237
17
ChangeLog
17
ChangeLog
@ -1,3 +1,20 @@
|
||||
2000-12-31 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/apptypes.h: cleaned up a bit.
|
||||
|
||||
* app/asupsample.[ch]
|
||||
* app/blend.[ch]
|
||||
* app/channel.h
|
||||
* app/gimpprogress.[ch]
|
||||
* app/layer.h
|
||||
* app/perspective_tool.c
|
||||
* app/plug_in.h
|
||||
* app/rotate_tool.c
|
||||
* app/scale_tool.c
|
||||
* app/shear_tool.c
|
||||
* app/transform_core.[ch]: s/gimp_progress/GimpProgress/g and some
|
||||
changes related to the apptypes.h cleanup.
|
||||
|
||||
2000-12-31 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/airbrush.[ch]
|
||||
|
||||
170
app/apptypes.h
170
app/apptypes.h
@ -337,125 +337,145 @@ typedef enum /*< skip >*/
|
||||
} CursorModifier;
|
||||
|
||||
|
||||
typedef struct _GimpContext GimpContext;
|
||||
typedef struct _GimpContextPreview GimpContextPreview;
|
||||
/* objects */
|
||||
|
||||
typedef struct _GimpChannel GimpChannel;
|
||||
typedef struct _GimpChannelClass GimpChannelClass;
|
||||
typedef struct _GimpObject GimpObject;
|
||||
|
||||
typedef GimpChannel Channel; /* convenience */
|
||||
typedef struct _GimpSet GimpSet;
|
||||
typedef struct _GimpList GimpList;
|
||||
|
||||
typedef struct _GDisplay GDisplay;
|
||||
typedef struct _GimpContext GimpContext;
|
||||
|
||||
typedef struct _GPattern GPattern;
|
||||
typedef struct _GimpDrawable GimpDrawable;
|
||||
|
||||
typedef struct _gradient_t gradient_t;
|
||||
typedef struct _GimpChannel GimpChannel;
|
||||
typedef GimpChannel Channel; /* convenience */
|
||||
|
||||
typedef struct _PaletteEntries PaletteEntries;
|
||||
typedef struct _PaletteEntry PaletteEntry;
|
||||
typedef struct _GimpLayer GimpLayer;
|
||||
typedef struct _GimpLayerMask GimpLayerMask;
|
||||
|
||||
typedef struct _GimpDrawable GimpDrawable;
|
||||
typedef GimpLayer Layer; /* convenience */
|
||||
typedef GimpLayerMask LayerMask; /* convenience */
|
||||
|
||||
typedef struct _GimpLayer GimpLayer;
|
||||
typedef struct _GimpLayerClass GimpLayerClass;
|
||||
typedef struct _GimpLayerMask GimpLayerMask;
|
||||
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
|
||||
typedef struct _GimpImage GimpImage;
|
||||
typedef GimpImage GImage;
|
||||
|
||||
typedef GimpLayer Layer; /* convenience */
|
||||
typedef GimpLayerMask LayerMask; /* convenience */
|
||||
typedef struct _GimpBrush GimpBrush;
|
||||
typedef struct _GimpBrushList GimpBrushList;
|
||||
typedef struct _GimpBrushGenerated GimpBrushGenerated;
|
||||
typedef struct _GimpBrushPipe GimpBrushPipe;
|
||||
|
||||
typedef struct _GimpImage GimpImage;
|
||||
typedef GimpImage GImage;
|
||||
|
||||
typedef struct _GimpSet GimpSet;
|
||||
typedef struct _GimpList GimpList;
|
||||
/* widgets */
|
||||
|
||||
typedef struct _Guide Guide;
|
||||
typedef guint32 Tattoo;
|
||||
typedef struct _HistogramWidget HistogramWidget;
|
||||
|
||||
typedef struct _PaintCore PaintCore;
|
||||
typedef struct _DrawCore DrawCore;
|
||||
|
||||
typedef struct _GimpBrush GimpBrush;
|
||||
typedef struct _GimpBrushList GimpBrushList;
|
||||
typedef struct _GimpBrushGenerated GimpBrushGenerated;
|
||||
typedef struct _GimpBrushPipe GimpBrushPipe;
|
||||
/* other stuff */
|
||||
|
||||
typedef struct _GimpObject GimpObject;
|
||||
typedef struct _Argument Argument;
|
||||
|
||||
typedef struct _GimpHistogram GimpHistogram;
|
||||
typedef struct _GimpLut GimpLut;
|
||||
typedef struct _BezierPoint BezierPoint;
|
||||
typedef struct _BezierSelect BezierSelect;
|
||||
|
||||
typedef struct _BoundSeg BoundSeg;
|
||||
typedef struct _BoundSeg BoundSeg;
|
||||
|
||||
typedef struct _layer_undo LayerUndo;
|
||||
typedef struct _DrawCore DrawCore;
|
||||
|
||||
typedef struct _layer_mask_undo LayerMaskUndo;
|
||||
typedef struct _GDisplay GDisplay;
|
||||
|
||||
typedef struct _fs_to_layer_undo FStoLayerUndo;
|
||||
typedef struct _GimpContextPreview GimpContextPreview;
|
||||
|
||||
typedef struct _Argument Argument;
|
||||
typedef struct _ProcArg ProcArg;
|
||||
typedef struct _ProcRecord ProcRecord;
|
||||
typedef struct _GimpHistogram GimpHistogram;
|
||||
|
||||
typedef struct _PlugIn PlugIn;
|
||||
typedef struct _PlugInDef PlugInDef;
|
||||
typedef struct _PlugInProcDef PlugInProcDef;
|
||||
typedef struct _GimpImageNewValues GimpImageNewValues;
|
||||
|
||||
typedef struct _ParasiteList ParasiteList;
|
||||
typedef struct _GimpLut GimpLut;
|
||||
|
||||
typedef struct _Tile Tile;
|
||||
typedef struct _TileManager TileManager;
|
||||
typedef struct _GimpParasite GimpParasite;
|
||||
|
||||
typedef void (* TileValidateProc) (TileManager *tm,
|
||||
Tile *tile);
|
||||
typedef struct _GimpProgress GimpProgress;
|
||||
|
||||
typedef struct _GPattern GPattern;
|
||||
|
||||
typedef struct _gradient_t gradient_t;
|
||||
|
||||
typedef struct _Guide Guide;
|
||||
|
||||
typedef gpointer ImageMap;
|
||||
|
||||
typedef struct _InfoDialog InfoDialog;
|
||||
|
||||
typedef struct _PaintCore PaintCore;
|
||||
|
||||
typedef struct _PaletteEntries PaletteEntries;
|
||||
typedef struct _PaletteEntry PaletteEntry;
|
||||
|
||||
typedef struct _Path Path;
|
||||
typedef struct _PathPoint PathPoint;
|
||||
typedef struct _PathList PathList;
|
||||
|
||||
typedef struct _PlugIn PlugIn;
|
||||
typedef struct _PlugInDef PlugInDef;
|
||||
typedef struct _PlugInProcDef PlugInProcDef;
|
||||
|
||||
typedef struct _ParasiteList ParasiteList;
|
||||
|
||||
typedef struct _PixelRegionIterator PixelRegionIterator;
|
||||
typedef struct _PixelRegion PixelRegion;
|
||||
typedef struct _PixelRegionHolder PixelRegionHolder;
|
||||
|
||||
typedef struct _GimpParasite GimpParasite;
|
||||
typedef struct _ProcArg ProcArg;
|
||||
typedef struct _ProcRecord ProcRecord;
|
||||
|
||||
typedef struct _Path Path;
|
||||
typedef struct _PathPoint PathPoint;
|
||||
typedef struct _PathList PathList;
|
||||
typedef GSList PathUndo;
|
||||
typedef guint32 Tattoo;
|
||||
|
||||
typedef struct _TempBuf TempBuf;
|
||||
typedef struct _TempBuf MaskBuf;
|
||||
|
||||
typedef struct _Tile Tile;
|
||||
typedef struct _TileManager TileManager;
|
||||
|
||||
typedef struct _Tool Tool;
|
||||
typedef struct _ToolInfo ToolInfo;
|
||||
|
||||
typedef struct _ToolOptions ToolOptions;
|
||||
typedef struct _SelectionOptions SelectionOptions;
|
||||
|
||||
typedef void (* ToolOptionsResetFunc) (void);
|
||||
|
||||
typedef struct _BezierPoint BezierPoint;
|
||||
typedef struct _BezierSelect BezierSelect;
|
||||
|
||||
typedef struct gimp_progress_pvt gimp_progress;
|
||||
typedef void (* progress_func_t) (gint ymin,
|
||||
gint ymax,
|
||||
gint curr_y,
|
||||
gpointer progress_data);
|
||||
|
||||
typedef gpointer ImageMap;
|
||||
typedef void (* ImageMapApplyFunc) (PixelRegion *,
|
||||
PixelRegion *,
|
||||
gpointer);
|
||||
|
||||
typedef struct _TransformCore TransformCore;
|
||||
|
||||
typedef struct _ScanConvertPoint ScanConvertPoint;
|
||||
|
||||
typedef struct _InfoDialog InfoDialog;
|
||||
|
||||
typedef struct _Selection Selection;
|
||||
|
||||
typedef struct _HistogramWidget HistogramWidget;
|
||||
typedef struct _SelectionOptions SelectionOptions;
|
||||
|
||||
typedef struct _GimpImageNewValues GimpImageNewValues;
|
||||
typedef struct _TransformCore TransformCore;
|
||||
|
||||
|
||||
/* some undo stuff */
|
||||
|
||||
typedef struct _layer_undo LayerUndo;
|
||||
|
||||
typedef struct _layer_mask_undo LayerMaskUndo;
|
||||
|
||||
typedef struct _fs_to_layer_undo FStoLayerUndo;
|
||||
|
||||
typedef GSList PathUndo;
|
||||
|
||||
|
||||
/* functions */
|
||||
|
||||
typedef void (* TileValidateProc) (TileManager *tm,
|
||||
Tile *tile);
|
||||
|
||||
typedef void (* ToolOptionsResetFunc) (void);
|
||||
|
||||
typedef void (* GimpProgressFunc) (gint ymin,
|
||||
gint ymax,
|
||||
gint curr_y,
|
||||
gpointer progress_data);
|
||||
|
||||
typedef void (* ImageMapApplyFunc) (PixelRegion *,
|
||||
PixelRegion *,
|
||||
gpointer);
|
||||
|
||||
|
||||
#endif /* __APPTYPES_H__ */
|
||||
|
||||
@ -84,7 +84,7 @@ adaptive_supersample_area (gint x1,
|
||||
gpointer render_data,
|
||||
put_pixel_func_t put_pixel_func,
|
||||
gpointer put_pixel_data,
|
||||
progress_func_t progress_func,
|
||||
GimpProgressFunc progress_func,
|
||||
gpointer progress_data)
|
||||
{
|
||||
int x, y, width; /* Counters, width of region */
|
||||
@ -225,7 +225,7 @@ adaptive_supersample_area (gint x1,
|
||||
/* Call progress display function */
|
||||
|
||||
if (progress_func && !(y & 0xf))
|
||||
(*progress_func)(y1, y2, y, progress_data);
|
||||
(* progress_func) (y1, y2, y, progress_data);
|
||||
}
|
||||
|
||||
/* Free memory */
|
||||
|
||||
@ -49,7 +49,7 @@ gulong adaptive_supersample_area (gint x1,
|
||||
gpointer render_data,
|
||||
put_pixel_func_t put_pixel_func,
|
||||
gpointer put_pixel_data,
|
||||
progress_func_t progress_func,
|
||||
GimpProgressFunc progress_func,
|
||||
gpointer progress_data);
|
||||
|
||||
|
||||
|
||||
257
app/blend.c
257
app/blend.c
@ -162,66 +162,110 @@ static guint blend_n_targets = (sizeof (blend_target_table) /
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gradient_type_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gradient_type_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
static void blend_button_press (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_release (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_motion (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_cursor_update (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_control (Tool *tool,
|
||||
ToolAction action,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_press (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_release (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_motion (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_cursor_update (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_control (Tool *tool,
|
||||
ToolAction action,
|
||||
GDisplay *gdisp);
|
||||
|
||||
static void blend_options_drop_gradient (GtkWidget *, gradient_t *, gpointer);
|
||||
static void blend_options_drop_tool (GtkWidget *, ToolType, gpointer);
|
||||
static void blend_options_drop_gradient (GtkWidget *,
|
||||
gradient_t *,
|
||||
gpointer );
|
||||
static void blend_options_drop_tool (GtkWidget *,
|
||||
ToolType ,
|
||||
gpointer );
|
||||
|
||||
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_conical_asym_factor (double dist, double *axis, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_square_factor (double dist, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_radial_factor (double dist, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_linear_factor (double dist, double *vec, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_bilinear_factor (double dist, double *vec, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_spiral_factor (double dist, double *axis, double offset,
|
||||
double x, double y, gint cwise);
|
||||
static double gradient_calc_shapeburst_angular_factor (double x, double y);
|
||||
static double gradient_calc_shapeburst_spherical_factor (double x, double y);
|
||||
static double gradient_calc_shapeburst_dimpled_factor (double x, double y);
|
||||
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_conical_asym_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_square_factor (gdouble dist,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_radial_factor (gdouble dist,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_linear_factor (gdouble dist,
|
||||
gdouble *vec,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_bilinear_factor (gdouble dist,
|
||||
gdouble *vec,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_spiral_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gint cwise);
|
||||
|
||||
static double gradient_repeat_none (double val);
|
||||
static double gradient_repeat_sawtooth (double val);
|
||||
static double gradient_repeat_triangular (double val);
|
||||
static gdouble gradient_calc_shapeburst_angular_factor (gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_shapeburst_spherical_factor (gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_shapeburst_dimpled_factor (gdouble x,
|
||||
gdouble y);
|
||||
|
||||
static void gradient_precalc_shapeburst (GImage *gimage, GimpDrawable *drawable,
|
||||
PixelRegion *PR, double dist);
|
||||
static gdouble gradient_repeat_none (gdouble val);
|
||||
static gdouble gradient_repeat_sawtooth (gdouble val);
|
||||
static gdouble gradient_repeat_triangular (gdouble val);
|
||||
|
||||
static void gradient_render_pixel (double x, double y,
|
||||
color_t *color, void *render_data);
|
||||
static void gradient_put_pixel (int x, int y,
|
||||
color_t color, void *put_pixel_data);
|
||||
static void gradient_precalc_shapeburst (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
gdouble dist);
|
||||
|
||||
static void gradient_fill_region (GImage *gimage, GimpDrawable *drawable, PixelRegion *PR,
|
||||
int width, int height,
|
||||
BlendMode blend_mode, GradientType gradient_type,
|
||||
double offset, RepeatMode repeat,
|
||||
int supersample, int max_depth, double threshold,
|
||||
double sx, double sy, double ex, double ey,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data);
|
||||
static void gradient_render_pixel (gdouble x,
|
||||
gdouble y,
|
||||
color_t *color,
|
||||
gpointer render_data);
|
||||
static void gradient_put_pixel (gint x,
|
||||
gint y,
|
||||
color_t color,
|
||||
gpointer put_pixel_data);
|
||||
|
||||
static void gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
gint width,
|
||||
gint height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble sx,
|
||||
gdouble sy,
|
||||
gdouble ex,
|
||||
gdouble ey,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
|
||||
|
||||
/* functions */
|
||||
@ -462,22 +506,27 @@ blend_button_press (Tool *tool,
|
||||
|
||||
/* Keep the coordinates of the target */
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y,
|
||||
&blend_tool->startx, &blend_tool->starty, FALSE, 1);
|
||||
&blend_tool->startx, &blend_tool->starty,
|
||||
FALSE, TRUE);
|
||||
|
||||
blend_tool->endx = blend_tool->startx;
|
||||
blend_tool->endy = blend_tool->starty;
|
||||
|
||||
/* Make the tool active and set the gdisplay which owns it */
|
||||
gdk_pointer_grab (gdisp->canvas->window, FALSE,
|
||||
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
|
||||
GDK_POINTER_MOTION_HINT_MASK |
|
||||
GDK_BUTTON1_MOTION_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK,
|
||||
NULL, NULL, bevent->time);
|
||||
|
||||
tool->gdisp = gdisp;
|
||||
tool->state = ACTIVE;
|
||||
|
||||
/* initialize the statusbar display */
|
||||
blend_tool->context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "blend");
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), blend_tool->context_id, _("Blend: 0, 0"));
|
||||
blend_tool->context_id =
|
||||
gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "blend");
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
|
||||
blend_tool->context_id, _("Blend: 0, 0"));
|
||||
|
||||
/* Start drawing the blend tool */
|
||||
draw_core_start (blend_tool->core, gdisp->canvas->window, tool);
|
||||
@ -494,7 +543,7 @@ blend_button_release (Tool *tool,
|
||||
Argument *return_vals;
|
||||
int nreturn_vals;
|
||||
#else
|
||||
gimp_progress *progress;
|
||||
GimpProgress *progress;
|
||||
#endif
|
||||
|
||||
gimage = gdisp->gimage;
|
||||
@ -561,7 +610,7 @@ blend_button_release (Tool *tool,
|
||||
blend_tool->starty,
|
||||
blend_tool->endx,
|
||||
blend_tool->endy,
|
||||
progress ? progress_update_and_flush : (progress_func_t)NULL,
|
||||
progress ? progress_update_and_flush : (GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
@ -756,30 +805,30 @@ blend_options_drop_tool (GtkWidget *widget,
|
||||
|
||||
/* The actual blending procedure */
|
||||
void
|
||||
blend (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
int paint_mode,
|
||||
GradientType gradient_type,
|
||||
double opacity,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double startx,
|
||||
double starty,
|
||||
double endx,
|
||||
double endy,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data)
|
||||
blend (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
int paint_mode,
|
||||
GradientType gradient_type,
|
||||
double opacity,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double startx,
|
||||
double starty,
|
||||
double endx,
|
||||
double endy,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
TileManager *buf_tiles;
|
||||
PixelRegion bufPR;
|
||||
int has_alpha;
|
||||
int has_selection;
|
||||
int bytes;
|
||||
int x1, y1, x2, y2;
|
||||
PixelRegion bufPR;
|
||||
gint has_alpha;
|
||||
gint has_selection;
|
||||
gint bytes;
|
||||
gint x1, y1, x2, y2;
|
||||
|
||||
gimp_add_busy_cursors();
|
||||
|
||||
@ -1382,32 +1431,32 @@ gradient_put_pixel (int x,
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
int width,
|
||||
int height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double sx,
|
||||
double sy,
|
||||
double ex,
|
||||
double ey,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data)
|
||||
gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
int width,
|
||||
int height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double sx,
|
||||
double sy,
|
||||
double ex,
|
||||
double ey,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
RenderBlendData rbd;
|
||||
PutPixelData ppd;
|
||||
unsigned char r, g, b;
|
||||
int x, y;
|
||||
int endx, endy;
|
||||
void *pr;
|
||||
unsigned char *data;
|
||||
guchar r, g, b;
|
||||
gint x, y;
|
||||
gint endx, endy;
|
||||
gpointer *pr;
|
||||
guchar *data;
|
||||
color_t color;
|
||||
|
||||
/* Get foreground and background colors, normalized */
|
||||
|
||||
36
app/blend.h
36
app/blend.h
@ -53,26 +53,26 @@ typedef enum
|
||||
REPEAT_LAST /*< skip >*/
|
||||
} RepeatMode;
|
||||
|
||||
void blend (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
gint paint_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble opacity,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble startx,
|
||||
gdouble starty,
|
||||
gdouble endx,
|
||||
gdouble endy,
|
||||
progress_func_t progress_callback,
|
||||
gpointer progress_data);
|
||||
void blend (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
gint paint_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble opacity,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble startx,
|
||||
gdouble starty,
|
||||
gdouble endx,
|
||||
gdouble endy,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
|
||||
Tool * tools_new_blend (void);
|
||||
void tools_free_blend (Tool *tool);
|
||||
void tools_free_blend (Tool *tool);
|
||||
|
||||
|
||||
#endif /* __BLEND_H__ */
|
||||
|
||||
@ -36,6 +36,9 @@
|
||||
#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL))
|
||||
#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL))
|
||||
|
||||
|
||||
typedef struct _GimpChannelClass GimpChannelClass;
|
||||
|
||||
struct _GimpChannel
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
@ -36,6 +36,9 @@
|
||||
#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL))
|
||||
#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL))
|
||||
|
||||
|
||||
typedef struct _GimpChannelClass GimpChannelClass;
|
||||
|
||||
struct _GimpChannel
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
@ -36,6 +36,9 @@
|
||||
#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL))
|
||||
#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL))
|
||||
|
||||
|
||||
typedef struct _GimpChannelClass GimpChannelClass;
|
||||
|
||||
struct _GimpChannel
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
@ -162,66 +162,110 @@ static guint blend_n_targets = (sizeof (blend_target_table) /
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gradient_type_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gradient_type_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
static void blend_button_press (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_release (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_motion (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_cursor_update (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_control (Tool *tool,
|
||||
ToolAction action,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_press (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_release (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_motion (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_cursor_update (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_control (Tool *tool,
|
||||
ToolAction action,
|
||||
GDisplay *gdisp);
|
||||
|
||||
static void blend_options_drop_gradient (GtkWidget *, gradient_t *, gpointer);
|
||||
static void blend_options_drop_tool (GtkWidget *, ToolType, gpointer);
|
||||
static void blend_options_drop_gradient (GtkWidget *,
|
||||
gradient_t *,
|
||||
gpointer );
|
||||
static void blend_options_drop_tool (GtkWidget *,
|
||||
ToolType ,
|
||||
gpointer );
|
||||
|
||||
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_conical_asym_factor (double dist, double *axis, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_square_factor (double dist, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_radial_factor (double dist, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_linear_factor (double dist, double *vec, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_bilinear_factor (double dist, double *vec, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_spiral_factor (double dist, double *axis, double offset,
|
||||
double x, double y, gint cwise);
|
||||
static double gradient_calc_shapeburst_angular_factor (double x, double y);
|
||||
static double gradient_calc_shapeburst_spherical_factor (double x, double y);
|
||||
static double gradient_calc_shapeburst_dimpled_factor (double x, double y);
|
||||
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_conical_asym_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_square_factor (gdouble dist,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_radial_factor (gdouble dist,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_linear_factor (gdouble dist,
|
||||
gdouble *vec,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_bilinear_factor (gdouble dist,
|
||||
gdouble *vec,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_spiral_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gint cwise);
|
||||
|
||||
static double gradient_repeat_none (double val);
|
||||
static double gradient_repeat_sawtooth (double val);
|
||||
static double gradient_repeat_triangular (double val);
|
||||
static gdouble gradient_calc_shapeburst_angular_factor (gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_shapeburst_spherical_factor (gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_shapeburst_dimpled_factor (gdouble x,
|
||||
gdouble y);
|
||||
|
||||
static void gradient_precalc_shapeburst (GImage *gimage, GimpDrawable *drawable,
|
||||
PixelRegion *PR, double dist);
|
||||
static gdouble gradient_repeat_none (gdouble val);
|
||||
static gdouble gradient_repeat_sawtooth (gdouble val);
|
||||
static gdouble gradient_repeat_triangular (gdouble val);
|
||||
|
||||
static void gradient_render_pixel (double x, double y,
|
||||
color_t *color, void *render_data);
|
||||
static void gradient_put_pixel (int x, int y,
|
||||
color_t color, void *put_pixel_data);
|
||||
static void gradient_precalc_shapeburst (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
gdouble dist);
|
||||
|
||||
static void gradient_fill_region (GImage *gimage, GimpDrawable *drawable, PixelRegion *PR,
|
||||
int width, int height,
|
||||
BlendMode blend_mode, GradientType gradient_type,
|
||||
double offset, RepeatMode repeat,
|
||||
int supersample, int max_depth, double threshold,
|
||||
double sx, double sy, double ex, double ey,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data);
|
||||
static void gradient_render_pixel (gdouble x,
|
||||
gdouble y,
|
||||
color_t *color,
|
||||
gpointer render_data);
|
||||
static void gradient_put_pixel (gint x,
|
||||
gint y,
|
||||
color_t color,
|
||||
gpointer put_pixel_data);
|
||||
|
||||
static void gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
gint width,
|
||||
gint height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble sx,
|
||||
gdouble sy,
|
||||
gdouble ex,
|
||||
gdouble ey,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
|
||||
|
||||
/* functions */
|
||||
@ -462,22 +506,27 @@ blend_button_press (Tool *tool,
|
||||
|
||||
/* Keep the coordinates of the target */
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y,
|
||||
&blend_tool->startx, &blend_tool->starty, FALSE, 1);
|
||||
&blend_tool->startx, &blend_tool->starty,
|
||||
FALSE, TRUE);
|
||||
|
||||
blend_tool->endx = blend_tool->startx;
|
||||
blend_tool->endy = blend_tool->starty;
|
||||
|
||||
/* Make the tool active and set the gdisplay which owns it */
|
||||
gdk_pointer_grab (gdisp->canvas->window, FALSE,
|
||||
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
|
||||
GDK_POINTER_MOTION_HINT_MASK |
|
||||
GDK_BUTTON1_MOTION_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK,
|
||||
NULL, NULL, bevent->time);
|
||||
|
||||
tool->gdisp = gdisp;
|
||||
tool->state = ACTIVE;
|
||||
|
||||
/* initialize the statusbar display */
|
||||
blend_tool->context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "blend");
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), blend_tool->context_id, _("Blend: 0, 0"));
|
||||
blend_tool->context_id =
|
||||
gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "blend");
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
|
||||
blend_tool->context_id, _("Blend: 0, 0"));
|
||||
|
||||
/* Start drawing the blend tool */
|
||||
draw_core_start (blend_tool->core, gdisp->canvas->window, tool);
|
||||
@ -494,7 +543,7 @@ blend_button_release (Tool *tool,
|
||||
Argument *return_vals;
|
||||
int nreturn_vals;
|
||||
#else
|
||||
gimp_progress *progress;
|
||||
GimpProgress *progress;
|
||||
#endif
|
||||
|
||||
gimage = gdisp->gimage;
|
||||
@ -561,7 +610,7 @@ blend_button_release (Tool *tool,
|
||||
blend_tool->starty,
|
||||
blend_tool->endx,
|
||||
blend_tool->endy,
|
||||
progress ? progress_update_and_flush : (progress_func_t)NULL,
|
||||
progress ? progress_update_and_flush : (GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
@ -756,30 +805,30 @@ blend_options_drop_tool (GtkWidget *widget,
|
||||
|
||||
/* The actual blending procedure */
|
||||
void
|
||||
blend (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
int paint_mode,
|
||||
GradientType gradient_type,
|
||||
double opacity,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double startx,
|
||||
double starty,
|
||||
double endx,
|
||||
double endy,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data)
|
||||
blend (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
int paint_mode,
|
||||
GradientType gradient_type,
|
||||
double opacity,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double startx,
|
||||
double starty,
|
||||
double endx,
|
||||
double endy,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
TileManager *buf_tiles;
|
||||
PixelRegion bufPR;
|
||||
int has_alpha;
|
||||
int has_selection;
|
||||
int bytes;
|
||||
int x1, y1, x2, y2;
|
||||
PixelRegion bufPR;
|
||||
gint has_alpha;
|
||||
gint has_selection;
|
||||
gint bytes;
|
||||
gint x1, y1, x2, y2;
|
||||
|
||||
gimp_add_busy_cursors();
|
||||
|
||||
@ -1382,32 +1431,32 @@ gradient_put_pixel (int x,
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
int width,
|
||||
int height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double sx,
|
||||
double sy,
|
||||
double ex,
|
||||
double ey,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data)
|
||||
gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
int width,
|
||||
int height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double sx,
|
||||
double sy,
|
||||
double ex,
|
||||
double ey,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
RenderBlendData rbd;
|
||||
PutPixelData ppd;
|
||||
unsigned char r, g, b;
|
||||
int x, y;
|
||||
int endx, endy;
|
||||
void *pr;
|
||||
unsigned char *data;
|
||||
guchar r, g, b;
|
||||
gint x, y;
|
||||
gint endx, endy;
|
||||
gpointer *pr;
|
||||
guchar *data;
|
||||
color_t color;
|
||||
|
||||
/* Get foreground and background colors, normalized */
|
||||
|
||||
@ -37,6 +37,9 @@
|
||||
#define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK))
|
||||
|
||||
|
||||
typedef struct _GimpLayerClass GimpLayerClass;
|
||||
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
|
||||
|
||||
struct _GimpLayer
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
struct gimp_progress_pvt
|
||||
struct _GimpProgress
|
||||
{
|
||||
GDisplay *gdisp; /* gdisp in use, or NULL*/
|
||||
|
||||
@ -45,11 +45,14 @@ struct gimp_progress_pvt
|
||||
};
|
||||
|
||||
/* prototypes */
|
||||
static void progress_signal_setup (gimp_progress *, GtkSignalFunc, gpointer);
|
||||
static void progress_signal_setup (GimpProgress *progress,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data);
|
||||
|
||||
|
||||
/* These progress bar routines are re-entrant, and so should be
|
||||
* thread-safe. */
|
||||
* thread-safe.
|
||||
*/
|
||||
|
||||
|
||||
/* Start a progress bar on "gdisp" with reason "message". If "gdisp"
|
||||
@ -67,18 +70,18 @@ static void progress_signal_setup (gimp_progress *, GtkSignalFunc, gpointer);
|
||||
* user in any possible way. Unimportant progress bars will not be
|
||||
* shown to the user if it would mean creating a new window.
|
||||
*/
|
||||
gimp_progress *
|
||||
GimpProgress *
|
||||
progress_start (GDisplay *gdisp,
|
||||
const char *message,
|
||||
gboolean important,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data)
|
||||
{
|
||||
gimp_progress *p;
|
||||
guint cid;
|
||||
GtkWidget *vbox;
|
||||
GimpProgress *p;
|
||||
guint cid;
|
||||
GtkWidget *vbox;
|
||||
|
||||
p = g_new (gimp_progress, 1);
|
||||
p = g_new (GimpProgress, 1);
|
||||
|
||||
p->gdisp = gdisp;
|
||||
p->dialog = NULL;
|
||||
@ -150,8 +153,8 @@ progress_start (GDisplay *gdisp,
|
||||
|
||||
/* Update the message and/or the callbacks for a progress and reset
|
||||
* the bar to zero, with the minimum of disturbance to the user. */
|
||||
gimp_progress *
|
||||
progress_restart (gimp_progress *p,
|
||||
GimpProgress *
|
||||
progress_restart (GimpProgress *p,
|
||||
const char *message,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data)
|
||||
@ -191,8 +194,8 @@ progress_restart (gimp_progress *p,
|
||||
|
||||
|
||||
void
|
||||
progress_update (gimp_progress *progress,
|
||||
float percentage)
|
||||
progress_update (GimpProgress *progress,
|
||||
gdouble percentage)
|
||||
{
|
||||
GtkWidget *bar;
|
||||
|
||||
@ -213,12 +216,12 @@ progress_update (gimp_progress *progress,
|
||||
|
||||
/* This function's prototype is conveniently the same as progress_func_t */
|
||||
void
|
||||
progress_update_and_flush (int ymin,
|
||||
int ymax,
|
||||
int curr_y,
|
||||
progress_update_and_flush (gint ymin,
|
||||
gint ymax,
|
||||
gint curr_y,
|
||||
gpointer data)
|
||||
{
|
||||
progress_update ((gimp_progress *)data,
|
||||
progress_update ((GimpProgress *) data,
|
||||
(float)(curr_y - ymin) / (float)(ymax - ymin));
|
||||
|
||||
/* HACK until we do long-running operations in the gtk idle thread */
|
||||
@ -229,10 +232,10 @@ progress_update_and_flush (int ymin,
|
||||
|
||||
/* Step the progress bar by one percent, wrapping at 100% */
|
||||
void
|
||||
progress_step (gimp_progress *progress)
|
||||
progress_step (GimpProgress *progress)
|
||||
{
|
||||
GtkWidget *bar;
|
||||
float val;
|
||||
float val;
|
||||
|
||||
g_return_if_fail (progress != NULL);
|
||||
|
||||
@ -251,9 +254,9 @@ progress_step (gimp_progress *progress)
|
||||
|
||||
/* Finish using the progress bar "p" */
|
||||
void
|
||||
progress_end (gimp_progress *p)
|
||||
progress_end (GimpProgress *p)
|
||||
{
|
||||
int cid;
|
||||
gint cid;
|
||||
|
||||
g_return_if_fail (p != NULL);
|
||||
|
||||
@ -283,7 +286,7 @@ progress_end (gimp_progress *p)
|
||||
|
||||
/* Helper function to add or remove signals */
|
||||
static void
|
||||
progress_signal_setup (gimp_progress *p,
|
||||
progress_signal_setup (GimpProgress *p,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data)
|
||||
{
|
||||
|
||||
@ -22,29 +22,25 @@
|
||||
/* Progress bars for use internally by the main GIMP application. */
|
||||
|
||||
|
||||
/* structures */
|
||||
struct gimp_progress_pvt;
|
||||
|
||||
|
||||
/* functions */
|
||||
gimp_progress * progress_start (GDisplay *,
|
||||
const gchar *,
|
||||
gboolean ,
|
||||
GtkSignalFunc ,
|
||||
gpointer );
|
||||
gimp_progress * progress_restart (gimp_progress *,
|
||||
const gchar *,
|
||||
GtkSignalFunc ,
|
||||
gpointer );
|
||||
void progress_update (gimp_progress *,
|
||||
gfloat );
|
||||
void progress_step (gimp_progress *);
|
||||
void progress_end (gimp_progress *);
|
||||
GimpProgress * progress_start (GDisplay *gdisp,
|
||||
const gchar *message,
|
||||
gboolean important,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data);
|
||||
GimpProgress * progress_restart (GimpProgress *progress,
|
||||
const gchar *message,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data);
|
||||
void progress_update (GimpProgress *progress,
|
||||
gdouble percentage);
|
||||
void progress_step (GimpProgress *progress);
|
||||
void progress_end (GimpProgress *progress);
|
||||
|
||||
void progress_update_and_flush (gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
gpointer );
|
||||
void progress_update_and_flush (gint ymin,
|
||||
gint ymax,
|
||||
gint curr_x,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __GIMP_PROGRESS_H__ */
|
||||
|
||||
@ -36,6 +36,9 @@
|
||||
#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL))
|
||||
#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL))
|
||||
|
||||
|
||||
typedef struct _GimpChannelClass GimpChannelClass;
|
||||
|
||||
struct _GimpChannel
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
@ -37,6 +37,9 @@
|
||||
#define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK))
|
||||
|
||||
|
||||
typedef struct _GimpLayerClass GimpLayerClass;
|
||||
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
|
||||
|
||||
struct _GimpLayer
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
struct gimp_progress_pvt
|
||||
struct _GimpProgress
|
||||
{
|
||||
GDisplay *gdisp; /* gdisp in use, or NULL*/
|
||||
|
||||
@ -45,11 +45,14 @@ struct gimp_progress_pvt
|
||||
};
|
||||
|
||||
/* prototypes */
|
||||
static void progress_signal_setup (gimp_progress *, GtkSignalFunc, gpointer);
|
||||
static void progress_signal_setup (GimpProgress *progress,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data);
|
||||
|
||||
|
||||
/* These progress bar routines are re-entrant, and so should be
|
||||
* thread-safe. */
|
||||
* thread-safe.
|
||||
*/
|
||||
|
||||
|
||||
/* Start a progress bar on "gdisp" with reason "message". If "gdisp"
|
||||
@ -67,18 +70,18 @@ static void progress_signal_setup (gimp_progress *, GtkSignalFunc, gpointer);
|
||||
* user in any possible way. Unimportant progress bars will not be
|
||||
* shown to the user if it would mean creating a new window.
|
||||
*/
|
||||
gimp_progress *
|
||||
GimpProgress *
|
||||
progress_start (GDisplay *gdisp,
|
||||
const char *message,
|
||||
gboolean important,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data)
|
||||
{
|
||||
gimp_progress *p;
|
||||
guint cid;
|
||||
GtkWidget *vbox;
|
||||
GimpProgress *p;
|
||||
guint cid;
|
||||
GtkWidget *vbox;
|
||||
|
||||
p = g_new (gimp_progress, 1);
|
||||
p = g_new (GimpProgress, 1);
|
||||
|
||||
p->gdisp = gdisp;
|
||||
p->dialog = NULL;
|
||||
@ -150,8 +153,8 @@ progress_start (GDisplay *gdisp,
|
||||
|
||||
/* Update the message and/or the callbacks for a progress and reset
|
||||
* the bar to zero, with the minimum of disturbance to the user. */
|
||||
gimp_progress *
|
||||
progress_restart (gimp_progress *p,
|
||||
GimpProgress *
|
||||
progress_restart (GimpProgress *p,
|
||||
const char *message,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data)
|
||||
@ -191,8 +194,8 @@ progress_restart (gimp_progress *p,
|
||||
|
||||
|
||||
void
|
||||
progress_update (gimp_progress *progress,
|
||||
float percentage)
|
||||
progress_update (GimpProgress *progress,
|
||||
gdouble percentage)
|
||||
{
|
||||
GtkWidget *bar;
|
||||
|
||||
@ -213,12 +216,12 @@ progress_update (gimp_progress *progress,
|
||||
|
||||
/* This function's prototype is conveniently the same as progress_func_t */
|
||||
void
|
||||
progress_update_and_flush (int ymin,
|
||||
int ymax,
|
||||
int curr_y,
|
||||
progress_update_and_flush (gint ymin,
|
||||
gint ymax,
|
||||
gint curr_y,
|
||||
gpointer data)
|
||||
{
|
||||
progress_update ((gimp_progress *)data,
|
||||
progress_update ((GimpProgress *) data,
|
||||
(float)(curr_y - ymin) / (float)(ymax - ymin));
|
||||
|
||||
/* HACK until we do long-running operations in the gtk idle thread */
|
||||
@ -229,10 +232,10 @@ progress_update_and_flush (int ymin,
|
||||
|
||||
/* Step the progress bar by one percent, wrapping at 100% */
|
||||
void
|
||||
progress_step (gimp_progress *progress)
|
||||
progress_step (GimpProgress *progress)
|
||||
{
|
||||
GtkWidget *bar;
|
||||
float val;
|
||||
float val;
|
||||
|
||||
g_return_if_fail (progress != NULL);
|
||||
|
||||
@ -251,9 +254,9 @@ progress_step (gimp_progress *progress)
|
||||
|
||||
/* Finish using the progress bar "p" */
|
||||
void
|
||||
progress_end (gimp_progress *p)
|
||||
progress_end (GimpProgress *p)
|
||||
{
|
||||
int cid;
|
||||
gint cid;
|
||||
|
||||
g_return_if_fail (p != NULL);
|
||||
|
||||
@ -283,7 +286,7 @@ progress_end (gimp_progress *p)
|
||||
|
||||
/* Helper function to add or remove signals */
|
||||
static void
|
||||
progress_signal_setup (gimp_progress *p,
|
||||
progress_signal_setup (GimpProgress *p,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data)
|
||||
{
|
||||
|
||||
@ -22,29 +22,25 @@
|
||||
/* Progress bars for use internally by the main GIMP application. */
|
||||
|
||||
|
||||
/* structures */
|
||||
struct gimp_progress_pvt;
|
||||
|
||||
|
||||
/* functions */
|
||||
gimp_progress * progress_start (GDisplay *,
|
||||
const gchar *,
|
||||
gboolean ,
|
||||
GtkSignalFunc ,
|
||||
gpointer );
|
||||
gimp_progress * progress_restart (gimp_progress *,
|
||||
const gchar *,
|
||||
GtkSignalFunc ,
|
||||
gpointer );
|
||||
void progress_update (gimp_progress *,
|
||||
gfloat );
|
||||
void progress_step (gimp_progress *);
|
||||
void progress_end (gimp_progress *);
|
||||
GimpProgress * progress_start (GDisplay *gdisp,
|
||||
const gchar *message,
|
||||
gboolean important,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data);
|
||||
GimpProgress * progress_restart (GimpProgress *progress,
|
||||
const gchar *message,
|
||||
GtkSignalFunc cancel_callback,
|
||||
gpointer cancel_data);
|
||||
void progress_update (GimpProgress *progress,
|
||||
gdouble percentage);
|
||||
void progress_step (GimpProgress *progress);
|
||||
void progress_end (GimpProgress *progress);
|
||||
|
||||
void progress_update_and_flush (gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
gpointer );
|
||||
void progress_update_and_flush (gint ymin,
|
||||
gint ymax,
|
||||
gint curr_x,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __GIMP_PROGRESS_H__ */
|
||||
|
||||
@ -37,6 +37,9 @@
|
||||
#define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK))
|
||||
|
||||
|
||||
typedef struct _GimpLayerClass GimpLayerClass;
|
||||
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
|
||||
|
||||
struct _GimpLayer
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
@ -307,15 +307,15 @@ perspective_tool_perspective (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Perspective..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ struct _PlugIn
|
||||
|
||||
GSList *temp_proc_defs; /* Temporary procedures */
|
||||
|
||||
gimp_progress *progress; /* Progress dialog */
|
||||
GimpProgress *progress; /* Progress dialog */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
@ -399,15 +399,15 @@ rotate_tool_rotate (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Rotating..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -509,15 +509,15 @@ scale_tool_scale (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Scaling..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -355,15 +355,15 @@ shear_tool_shear (GimpImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Shearing..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -162,66 +162,110 @@ static guint blend_n_targets = (sizeof (blend_target_table) /
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gradient_type_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gradient_type_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
static void blend_button_press (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_release (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_motion (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_cursor_update (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_control (Tool *tool,
|
||||
ToolAction action,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_press (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_release (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_motion (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_cursor_update (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_control (Tool *tool,
|
||||
ToolAction action,
|
||||
GDisplay *gdisp);
|
||||
|
||||
static void blend_options_drop_gradient (GtkWidget *, gradient_t *, gpointer);
|
||||
static void blend_options_drop_tool (GtkWidget *, ToolType, gpointer);
|
||||
static void blend_options_drop_gradient (GtkWidget *,
|
||||
gradient_t *,
|
||||
gpointer );
|
||||
static void blend_options_drop_tool (GtkWidget *,
|
||||
ToolType ,
|
||||
gpointer );
|
||||
|
||||
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_conical_asym_factor (double dist, double *axis, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_square_factor (double dist, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_radial_factor (double dist, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_linear_factor (double dist, double *vec, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_bilinear_factor (double dist, double *vec, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_spiral_factor (double dist, double *axis, double offset,
|
||||
double x, double y, gint cwise);
|
||||
static double gradient_calc_shapeburst_angular_factor (double x, double y);
|
||||
static double gradient_calc_shapeburst_spherical_factor (double x, double y);
|
||||
static double gradient_calc_shapeburst_dimpled_factor (double x, double y);
|
||||
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_conical_asym_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_square_factor (gdouble dist,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_radial_factor (gdouble dist,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_linear_factor (gdouble dist,
|
||||
gdouble *vec,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_bilinear_factor (gdouble dist,
|
||||
gdouble *vec,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_spiral_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gint cwise);
|
||||
|
||||
static double gradient_repeat_none (double val);
|
||||
static double gradient_repeat_sawtooth (double val);
|
||||
static double gradient_repeat_triangular (double val);
|
||||
static gdouble gradient_calc_shapeburst_angular_factor (gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_shapeburst_spherical_factor (gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_shapeburst_dimpled_factor (gdouble x,
|
||||
gdouble y);
|
||||
|
||||
static void gradient_precalc_shapeburst (GImage *gimage, GimpDrawable *drawable,
|
||||
PixelRegion *PR, double dist);
|
||||
static gdouble gradient_repeat_none (gdouble val);
|
||||
static gdouble gradient_repeat_sawtooth (gdouble val);
|
||||
static gdouble gradient_repeat_triangular (gdouble val);
|
||||
|
||||
static void gradient_render_pixel (double x, double y,
|
||||
color_t *color, void *render_data);
|
||||
static void gradient_put_pixel (int x, int y,
|
||||
color_t color, void *put_pixel_data);
|
||||
static void gradient_precalc_shapeburst (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
gdouble dist);
|
||||
|
||||
static void gradient_fill_region (GImage *gimage, GimpDrawable *drawable, PixelRegion *PR,
|
||||
int width, int height,
|
||||
BlendMode blend_mode, GradientType gradient_type,
|
||||
double offset, RepeatMode repeat,
|
||||
int supersample, int max_depth, double threshold,
|
||||
double sx, double sy, double ex, double ey,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data);
|
||||
static void gradient_render_pixel (gdouble x,
|
||||
gdouble y,
|
||||
color_t *color,
|
||||
gpointer render_data);
|
||||
static void gradient_put_pixel (gint x,
|
||||
gint y,
|
||||
color_t color,
|
||||
gpointer put_pixel_data);
|
||||
|
||||
static void gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
gint width,
|
||||
gint height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble sx,
|
||||
gdouble sy,
|
||||
gdouble ex,
|
||||
gdouble ey,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
|
||||
|
||||
/* functions */
|
||||
@ -462,22 +506,27 @@ blend_button_press (Tool *tool,
|
||||
|
||||
/* Keep the coordinates of the target */
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y,
|
||||
&blend_tool->startx, &blend_tool->starty, FALSE, 1);
|
||||
&blend_tool->startx, &blend_tool->starty,
|
||||
FALSE, TRUE);
|
||||
|
||||
blend_tool->endx = blend_tool->startx;
|
||||
blend_tool->endy = blend_tool->starty;
|
||||
|
||||
/* Make the tool active and set the gdisplay which owns it */
|
||||
gdk_pointer_grab (gdisp->canvas->window, FALSE,
|
||||
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
|
||||
GDK_POINTER_MOTION_HINT_MASK |
|
||||
GDK_BUTTON1_MOTION_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK,
|
||||
NULL, NULL, bevent->time);
|
||||
|
||||
tool->gdisp = gdisp;
|
||||
tool->state = ACTIVE;
|
||||
|
||||
/* initialize the statusbar display */
|
||||
blend_tool->context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "blend");
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), blend_tool->context_id, _("Blend: 0, 0"));
|
||||
blend_tool->context_id =
|
||||
gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "blend");
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
|
||||
blend_tool->context_id, _("Blend: 0, 0"));
|
||||
|
||||
/* Start drawing the blend tool */
|
||||
draw_core_start (blend_tool->core, gdisp->canvas->window, tool);
|
||||
@ -494,7 +543,7 @@ blend_button_release (Tool *tool,
|
||||
Argument *return_vals;
|
||||
int nreturn_vals;
|
||||
#else
|
||||
gimp_progress *progress;
|
||||
GimpProgress *progress;
|
||||
#endif
|
||||
|
||||
gimage = gdisp->gimage;
|
||||
@ -561,7 +610,7 @@ blend_button_release (Tool *tool,
|
||||
blend_tool->starty,
|
||||
blend_tool->endx,
|
||||
blend_tool->endy,
|
||||
progress ? progress_update_and_flush : (progress_func_t)NULL,
|
||||
progress ? progress_update_and_flush : (GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
@ -756,30 +805,30 @@ blend_options_drop_tool (GtkWidget *widget,
|
||||
|
||||
/* The actual blending procedure */
|
||||
void
|
||||
blend (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
int paint_mode,
|
||||
GradientType gradient_type,
|
||||
double opacity,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double startx,
|
||||
double starty,
|
||||
double endx,
|
||||
double endy,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data)
|
||||
blend (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
int paint_mode,
|
||||
GradientType gradient_type,
|
||||
double opacity,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double startx,
|
||||
double starty,
|
||||
double endx,
|
||||
double endy,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
TileManager *buf_tiles;
|
||||
PixelRegion bufPR;
|
||||
int has_alpha;
|
||||
int has_selection;
|
||||
int bytes;
|
||||
int x1, y1, x2, y2;
|
||||
PixelRegion bufPR;
|
||||
gint has_alpha;
|
||||
gint has_selection;
|
||||
gint bytes;
|
||||
gint x1, y1, x2, y2;
|
||||
|
||||
gimp_add_busy_cursors();
|
||||
|
||||
@ -1382,32 +1431,32 @@ gradient_put_pixel (int x,
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
int width,
|
||||
int height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double sx,
|
||||
double sy,
|
||||
double ex,
|
||||
double ey,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data)
|
||||
gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
int width,
|
||||
int height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double sx,
|
||||
double sy,
|
||||
double ex,
|
||||
double ey,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
RenderBlendData rbd;
|
||||
PutPixelData ppd;
|
||||
unsigned char r, g, b;
|
||||
int x, y;
|
||||
int endx, endy;
|
||||
void *pr;
|
||||
unsigned char *data;
|
||||
guchar r, g, b;
|
||||
gint x, y;
|
||||
gint endx, endy;
|
||||
gpointer *pr;
|
||||
guchar *data;
|
||||
color_t color;
|
||||
|
||||
/* Get foreground and background colors, normalized */
|
||||
|
||||
@ -53,26 +53,26 @@ typedef enum
|
||||
REPEAT_LAST /*< skip >*/
|
||||
} RepeatMode;
|
||||
|
||||
void blend (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
gint paint_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble opacity,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble startx,
|
||||
gdouble starty,
|
||||
gdouble endx,
|
||||
gdouble endy,
|
||||
progress_func_t progress_callback,
|
||||
gpointer progress_data);
|
||||
void blend (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
gint paint_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble opacity,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble startx,
|
||||
gdouble starty,
|
||||
gdouble endx,
|
||||
gdouble endy,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
|
||||
Tool * tools_new_blend (void);
|
||||
void tools_free_blend (Tool *tool);
|
||||
void tools_free_blend (Tool *tool);
|
||||
|
||||
|
||||
#endif /* __BLEND_H__ */
|
||||
|
||||
@ -162,66 +162,110 @@ static guint blend_n_targets = (sizeof (blend_target_table) /
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gradient_type_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gradient_type_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
static void blend_button_press (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_release (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_motion (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_cursor_update (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_control (Tool *tool,
|
||||
ToolAction action,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_press (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_button_release (Tool *tool,
|
||||
GdkEventButton *bevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_motion (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_cursor_update (Tool *tool,
|
||||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
static void blend_control (Tool *tool,
|
||||
ToolAction action,
|
||||
GDisplay *gdisp);
|
||||
|
||||
static void blend_options_drop_gradient (GtkWidget *, gradient_t *, gpointer);
|
||||
static void blend_options_drop_tool (GtkWidget *, ToolType, gpointer);
|
||||
static void blend_options_drop_gradient (GtkWidget *,
|
||||
gradient_t *,
|
||||
gpointer );
|
||||
static void blend_options_drop_tool (GtkWidget *,
|
||||
ToolType ,
|
||||
gpointer );
|
||||
|
||||
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_conical_asym_factor (double dist, double *axis, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_square_factor (double dist, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_radial_factor (double dist, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_linear_factor (double dist, double *vec, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_bilinear_factor (double dist, double *vec, double offset,
|
||||
double x, double y);
|
||||
static double gradient_calc_spiral_factor (double dist, double *axis, double offset,
|
||||
double x, double y, gint cwise);
|
||||
static double gradient_calc_shapeburst_angular_factor (double x, double y);
|
||||
static double gradient_calc_shapeburst_spherical_factor (double x, double y);
|
||||
static double gradient_calc_shapeburst_dimpled_factor (double x, double y);
|
||||
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_conical_asym_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_square_factor (gdouble dist,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_radial_factor (gdouble dist,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_linear_factor (gdouble dist,
|
||||
gdouble *vec,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_bilinear_factor (gdouble dist,
|
||||
gdouble *vec,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_spiral_factor (gdouble dist,
|
||||
gdouble *axis,
|
||||
gdouble offset,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gint cwise);
|
||||
|
||||
static double gradient_repeat_none (double val);
|
||||
static double gradient_repeat_sawtooth (double val);
|
||||
static double gradient_repeat_triangular (double val);
|
||||
static gdouble gradient_calc_shapeburst_angular_factor (gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_shapeburst_spherical_factor (gdouble x,
|
||||
gdouble y);
|
||||
static gdouble gradient_calc_shapeburst_dimpled_factor (gdouble x,
|
||||
gdouble y);
|
||||
|
||||
static void gradient_precalc_shapeburst (GImage *gimage, GimpDrawable *drawable,
|
||||
PixelRegion *PR, double dist);
|
||||
static gdouble gradient_repeat_none (gdouble val);
|
||||
static gdouble gradient_repeat_sawtooth (gdouble val);
|
||||
static gdouble gradient_repeat_triangular (gdouble val);
|
||||
|
||||
static void gradient_render_pixel (double x, double y,
|
||||
color_t *color, void *render_data);
|
||||
static void gradient_put_pixel (int x, int y,
|
||||
color_t color, void *put_pixel_data);
|
||||
static void gradient_precalc_shapeburst (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
gdouble dist);
|
||||
|
||||
static void gradient_fill_region (GImage *gimage, GimpDrawable *drawable, PixelRegion *PR,
|
||||
int width, int height,
|
||||
BlendMode blend_mode, GradientType gradient_type,
|
||||
double offset, RepeatMode repeat,
|
||||
int supersample, int max_depth, double threshold,
|
||||
double sx, double sy, double ex, double ey,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data);
|
||||
static void gradient_render_pixel (gdouble x,
|
||||
gdouble y,
|
||||
color_t *color,
|
||||
gpointer render_data);
|
||||
static void gradient_put_pixel (gint x,
|
||||
gint y,
|
||||
color_t color,
|
||||
gpointer put_pixel_data);
|
||||
|
||||
static void gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
gint width,
|
||||
gint height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble sx,
|
||||
gdouble sy,
|
||||
gdouble ex,
|
||||
gdouble ey,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
|
||||
|
||||
/* functions */
|
||||
@ -462,22 +506,27 @@ blend_button_press (Tool *tool,
|
||||
|
||||
/* Keep the coordinates of the target */
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y,
|
||||
&blend_tool->startx, &blend_tool->starty, FALSE, 1);
|
||||
&blend_tool->startx, &blend_tool->starty,
|
||||
FALSE, TRUE);
|
||||
|
||||
blend_tool->endx = blend_tool->startx;
|
||||
blend_tool->endy = blend_tool->starty;
|
||||
|
||||
/* Make the tool active and set the gdisplay which owns it */
|
||||
gdk_pointer_grab (gdisp->canvas->window, FALSE,
|
||||
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
|
||||
GDK_POINTER_MOTION_HINT_MASK |
|
||||
GDK_BUTTON1_MOTION_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK,
|
||||
NULL, NULL, bevent->time);
|
||||
|
||||
tool->gdisp = gdisp;
|
||||
tool->state = ACTIVE;
|
||||
|
||||
/* initialize the statusbar display */
|
||||
blend_tool->context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "blend");
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), blend_tool->context_id, _("Blend: 0, 0"));
|
||||
blend_tool->context_id =
|
||||
gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "blend");
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
|
||||
blend_tool->context_id, _("Blend: 0, 0"));
|
||||
|
||||
/* Start drawing the blend tool */
|
||||
draw_core_start (blend_tool->core, gdisp->canvas->window, tool);
|
||||
@ -494,7 +543,7 @@ blend_button_release (Tool *tool,
|
||||
Argument *return_vals;
|
||||
int nreturn_vals;
|
||||
#else
|
||||
gimp_progress *progress;
|
||||
GimpProgress *progress;
|
||||
#endif
|
||||
|
||||
gimage = gdisp->gimage;
|
||||
@ -561,7 +610,7 @@ blend_button_release (Tool *tool,
|
||||
blend_tool->starty,
|
||||
blend_tool->endx,
|
||||
blend_tool->endy,
|
||||
progress ? progress_update_and_flush : (progress_func_t)NULL,
|
||||
progress ? progress_update_and_flush : (GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
@ -756,30 +805,30 @@ blend_options_drop_tool (GtkWidget *widget,
|
||||
|
||||
/* The actual blending procedure */
|
||||
void
|
||||
blend (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
int paint_mode,
|
||||
GradientType gradient_type,
|
||||
double opacity,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double startx,
|
||||
double starty,
|
||||
double endx,
|
||||
double endy,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data)
|
||||
blend (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
int paint_mode,
|
||||
GradientType gradient_type,
|
||||
double opacity,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double startx,
|
||||
double starty,
|
||||
double endx,
|
||||
double endy,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
TileManager *buf_tiles;
|
||||
PixelRegion bufPR;
|
||||
int has_alpha;
|
||||
int has_selection;
|
||||
int bytes;
|
||||
int x1, y1, x2, y2;
|
||||
PixelRegion bufPR;
|
||||
gint has_alpha;
|
||||
gint has_selection;
|
||||
gint bytes;
|
||||
gint x1, y1, x2, y2;
|
||||
|
||||
gimp_add_busy_cursors();
|
||||
|
||||
@ -1382,32 +1431,32 @@ gradient_put_pixel (int x,
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
int width,
|
||||
int height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double sx,
|
||||
double sy,
|
||||
double ex,
|
||||
double ey,
|
||||
progress_func_t progress_callback,
|
||||
void *progress_data)
|
||||
gradient_fill_region (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
PixelRegion *PR,
|
||||
int width,
|
||||
int height,
|
||||
BlendMode blend_mode,
|
||||
GradientType gradient_type,
|
||||
double offset,
|
||||
RepeatMode repeat,
|
||||
int supersample,
|
||||
int max_depth,
|
||||
double threshold,
|
||||
double sx,
|
||||
double sy,
|
||||
double ex,
|
||||
double ey,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
RenderBlendData rbd;
|
||||
PutPixelData ppd;
|
||||
unsigned char r, g, b;
|
||||
int x, y;
|
||||
int endx, endy;
|
||||
void *pr;
|
||||
unsigned char *data;
|
||||
guchar r, g, b;
|
||||
gint x, y;
|
||||
gint endx, endy;
|
||||
gpointer *pr;
|
||||
guchar *data;
|
||||
color_t color;
|
||||
|
||||
/* Get foreground and background colors, normalized */
|
||||
|
||||
@ -53,26 +53,26 @@ typedef enum
|
||||
REPEAT_LAST /*< skip >*/
|
||||
} RepeatMode;
|
||||
|
||||
void blend (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
gint paint_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble opacity,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble startx,
|
||||
gdouble starty,
|
||||
gdouble endx,
|
||||
gdouble endy,
|
||||
progress_func_t progress_callback,
|
||||
gpointer progress_data);
|
||||
void blend (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BlendMode blend_mode,
|
||||
gint paint_mode,
|
||||
GradientType gradient_type,
|
||||
gdouble opacity,
|
||||
gdouble offset,
|
||||
RepeatMode repeat,
|
||||
gint supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gdouble startx,
|
||||
gdouble starty,
|
||||
gdouble endx,
|
||||
gdouble endy,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
|
||||
Tool * tools_new_blend (void);
|
||||
void tools_free_blend (Tool *tool);
|
||||
void tools_free_blend (Tool *tool);
|
||||
|
||||
|
||||
#endif /* __BLEND_H__ */
|
||||
|
||||
@ -307,15 +307,15 @@ perspective_tool_perspective (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Perspective..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -399,15 +399,15 @@ rotate_tool_rotate (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Rotating..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -509,15 +509,15 @@ scale_tool_scale (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Scaling..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -355,15 +355,15 @@ shear_tool_shear (GimpImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Shearing..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -307,15 +307,15 @@ perspective_tool_perspective (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Perspective..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -399,15 +399,15 @@ rotate_tool_rotate (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Rotating..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -509,15 +509,15 @@ scale_tool_scale (GImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Scaling..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -355,15 +355,15 @@ shear_tool_shear (GimpImage *gimage,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix)
|
||||
{
|
||||
gimp_progress *progress;
|
||||
TileManager *ret;
|
||||
GimpProgress *progress;
|
||||
TileManager *ret;
|
||||
|
||||
progress = progress_start (gdisp, _("Shearing..."), FALSE, NULL, NULL);
|
||||
|
||||
ret = transform_core_do (gimage, drawable, float_tiles,
|
||||
interpolation, matrix,
|
||||
progress ? progress_update_and_flush :
|
||||
(progress_func_t) NULL,
|
||||
(GimpProgressFunc) NULL,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
|
||||
@ -1140,13 +1140,13 @@ transform_core_recalc (Tool *tool,
|
||||
|
||||
/* Actually carry out a transformation */
|
||||
TileManager *
|
||||
transform_core_do (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
progress_func_t progress_callback,
|
||||
gpointer progress_data)
|
||||
transform_core_do (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
PixelRegion destPR;
|
||||
TileManager *tiles;
|
||||
|
||||
@ -138,20 +138,20 @@ void transform_core_grid_density_changed (void);
|
||||
void transform_core_showpath_changed (gint type);
|
||||
|
||||
/* transform functions */
|
||||
TileManager * transform_core_do (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
progress_func_t progress_callback,
|
||||
gpointer progress_data);
|
||||
TileManager * transform_core_cut (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean *new_layer);
|
||||
gboolean transform_core_paste (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *tiles,
|
||||
gboolean new_layer);
|
||||
TileManager * transform_core_do (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
TileManager * transform_core_cut (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean *new_layer);
|
||||
gboolean transform_core_paste (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *tiles,
|
||||
gboolean new_layer);
|
||||
|
||||
|
||||
#endif /* __TRANSFORM_CORE_H__ */
|
||||
|
||||
@ -1140,13 +1140,13 @@ transform_core_recalc (Tool *tool,
|
||||
|
||||
/* Actually carry out a transformation */
|
||||
TileManager *
|
||||
transform_core_do (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
progress_func_t progress_callback,
|
||||
gpointer progress_data)
|
||||
transform_core_do (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data)
|
||||
{
|
||||
PixelRegion destPR;
|
||||
TileManager *tiles;
|
||||
|
||||
@ -138,20 +138,20 @@ void transform_core_grid_density_changed (void);
|
||||
void transform_core_showpath_changed (gint type);
|
||||
|
||||
/* transform functions */
|
||||
TileManager * transform_core_do (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
progress_func_t progress_callback,
|
||||
gpointer progress_data);
|
||||
TileManager * transform_core_cut (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean *new_layer);
|
||||
gboolean transform_core_paste (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *tiles,
|
||||
gboolean new_layer);
|
||||
TileManager * transform_core_do (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
TileManager * transform_core_cut (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean *new_layer);
|
||||
gboolean transform_core_paste (GImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *tiles,
|
||||
gboolean new_layer);
|
||||
|
||||
|
||||
#endif /* __TRANSFORM_CORE_H__ */
|
||||
|
||||
Reference in New Issue
Block a user