I also changed a bit the new color serialization by adding a (color …)
symbol framing the contents, for cases where we don't have a specific
property name, e.g. for the color history list stored in colorrc, unlike
for GimpConfig GeglColor properties.
While doing this, I moved GeglColor property deserialization code into
gimp_scanner_parse_color() which is now able to recognize both older
(color-rgb|rgba|hsv|hsva with no color space) and newer serialization
formats ("color", color model agnostic and space aware).
- app: gimp_context_get_(foreground|background)() are now returning a GeglColor.
- libgimp: PDB functions named similarly in libgimp are returning a newly
allocated GeglColor too.
- A few other PDB functions (the ones using these functions) were updated and
their signature changed to use GeglColor too, when relevant. Plug-ins which
use any of the changed libgimp functions were fixed.
- GimpContext: signals "(foreground|background)-changed" are now passing a
GeglColor.
- libgimpconfig: new macro GIMP_CONFIG_PROP_COLOR using gegl_param_spec_color().
- GimpContext: properties "foreground" and "background" are now GeglParamColor
properties.
- app: All code interacting with GimpContext objects were updated to receive a
GeglColor (that they may still convert, or no, to GimpRGB for now).
- app: gimp_prop_gegl_color_button_new() was added as an alternative to
gimp_prop_color_button_new() when the property is a GeglParamColor. Eventually
the former should replace completely the latter.
- libgimpwidgets: gimp_prop_color_area_new() now works on GeglParamColor
properties only.
- libgimp: gimp_procedure_dialog_get_widget() will generate a GimpColorArea for
GeglTypeParamColor arguments.
In GimpPaintbrush, calculate grad_point in
_gimp_paintbrush_motion() independently of any stroke, and pass
its value down to GimpPaintbrush::get_paint_params() at each
stroke, so that the color is the same for all strokes, even when
using a color/random dynamics.
Add GimpPaintbrush::get_color_history_color() virtual function,
which should return the color to be added to the color history upon
painting, if any. The default implementation returns the
foreground color, when not using a pixmap brush or color-from-
gradient.
Override this function in GimpEraser, to return the background
color when the affected drawable has no alpha channel, instead of
overriding GimpPaintCore::paint() for this purpose. This avoids
erroneously adding both the background and foreground colors to the
history.
In GimpPaintbrush, factor out the code responsible for determining
the current dab's paint parameters and content to a new
GimpPaintbrush::get_paint_params() virtual function.
Derive GimpEraser from GimpPaintbrush, instead of directly from
GimpBrushCore, implementing get_paint_params() appropriately.
This allows GimpEraser to reuse the paint-buffer content across
dabs, improving performance.
Use gimp_symmetry_get_transform() instead of
gimp_symmetry_get_operation() throughout the paint code, where
possible. This allows us to combine the symmetry transform with
the ordinary brush transform, simplifying the code, improving
performance, and avoiding multiple resamplings. This also fixes
the paint-buffer size when using mandala symmetry with non-round
brushes, avoiding artifacts.
Add a Babl space parameter to gimp_gegl_color_new() and all utility
functions using it. Pass NULL if the GimpRGB actually is sRGB, pass
the image's layer space if the color was already converted using
gimp_pickable_srgb_to_image_color() or similar.
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
You can now set any paint tool to mirror painting relatively
horizontal/vertical axis or a central point (any combination of these 3
symmetries).
This has been implemented as a new multi-stroke core, where every stroke
is actually handled as a multi-stroke (default of size 1).
This is also the first usage of custom guides for symmetry guiding.
Current version has to be activated in the playground.
Now the history of recently used colors is not updated when selecting
in the color dialog anymore, but when a color is actually used.
Tools supported right now are: Ink, MyPaint brush, all PaintBrush tools,
bucket fill and eraser (background color on non-alpha drawables).
Moreover from now on, colors already saved are properly moved to first
position when reused.
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
finally acknowledging the fact that app/ depends on gdk-pixbuf almost
globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
* app/paint/gimppaintoptions.c: Add initialization for fading dynamics. Add fading related variables similar to Random. Adjust get_dynamics_mix function. Add fading calculation in get_dynamics_x functions. Adjust get_dynamic_x functions for fade dynamics.
* app/paint/gimppaintoptions.h: Add fading_options in GimpDynamicOptions.
* app/tools/gimppaintoptions-gui.c: Add the function fading_options_gui.
* app/paint/gimpclone.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimppaintbrush.c
* app/paint/gimpsmudge.c
* app/paint/gimpairbrush.c
* app/paint/gimpbrushcore.c
* app/paint/gimpconvolve.c: Adjust function calls. get_dynamic_opacity function calls were adjusted to have one more parameter, paint_core->pixel_dist.
some key words:
get_dynamic_
pixel_dist
paint_core->pixel_dist
* app/paint/gimppaintcore.[ch]: add
gimp_paint_core_{get|set}_{current|last}_coords(), add "const GimpCoords*"
parameter to ::paint() which gets core->cur_coords passed.
* app/paint/gimpsourcecore.[ch]: add "const GimpCoords*" to ::motion().
* app/paint/gimpbrushcore.c: use the new coords getters/setters instead
of accessing GimpPaintCore members directly.
* app/paint/gimpairbrush.c
* app/paint/gimpclone.c
* app/paint/gimpconvolve.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimpink.c
* app/paint/gimppaintbrush.[ch]
* app/paint/gimpperspectiveclone.c
* app/paint/gimpsmudge.c: change implementations of GimpPaintCore::paint()
and GimpSourceCore::motion() accordingly. app/paint/ is now virtually
free of direct access to the paint core's coords members. More to come...
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-10-09 Michael Natterer <mitch@gimp.org>
Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
had a GEGL dependency (they will have in the next commit, but I
wanted to keep the commit separate).
* app/dialogs/Makefile.am
* app/file/Makefile.am
* app/gui/Makefile.am
* app/menus/Makefile.am
* app/paint/Makefile.am
* app/plug-in/Makefile.am
* app/text/Makefile.am
* app/vectors/Makefile.am
* app/widgets/Makefile.am
* app/xcf/Makefile.am: add GEGL_CFLAGS.
* app/actions/*.c
* app/core/*.c
* app/dialogs/*.c
* app/display/*.c
* app/file/*.c
* app/gui/*.c
* app/menus/*.c
* app/paint/*.c
* app/pdb/gimppdb-utils.c
* app/pdb/gimpprocedure.c
* app/plug-in/*.c
* app/text/*.c
* app/tools/*.c
* app/vectors/*.c
* app/widgets/*.c
* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
to all files which include a drawable subclass or gimpimage.h
* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
in all generated files.
* app/pdb/*-cmds.c: regenerated.
* data/images/gimp-splash.png: the goat is still sleeping.
By Aurore Derriennic.
svn path=/trunk/; revision=27202
2008-05-22 Michael Natterer <mitch@gimp.org>
Applied slightly modified and fixed patch from Alexia Death which
adds a "random" axis to the paint dynamics and fixes some issues
in the previous paint dynamics commits. Fixes bug #529431.
* app/core/core-types.h: add a "random" axis to GimpCoords.
* app/display/gimpdisplayshell-coords.c: set it to a random value.
* app/display/gimpdisplayshell-callbacks.c: on button_press,
use the dynamics from the last motion event to avoid blotches
at the beginning of paint strokes.
* app/paint/gimppaintoptions.[ch]: add random properties the same
way we do pressure and velocity. Add get_dynamic_size(),
get_dynamic_color() and get_dynamic_hardness() functions which
look at all dynamic parameters of the passed coords.
* app/tools/gimppaintoptions-gui.c: add gui for the random options.
* app/paint/gimpbrushcore.[ch]: remove calc_brush_scale() and use
gimp_paint_options_get_dynamic_size_instead().
Add "dynamic_hardness" parameters to paste_canvas(),
replace_canvas() and get_brush_mask().
* app/paint/gimpairbrushoptions.c
* app/paint/gimpclone.c
* app/paint/gimpconvolve.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimppaintbrush.c
* app/paint/gimpsmudge.c: calculate the dynamic hardness and pass
it to above brush core functions. Use the get_dynamic_color() to
calculate the gradient color.
svn path=/trunk/; revision=25758
2008-05-10 Michael Natterer <mitch@gimp.org>
Applied modified patch from Alexia Death which adds velocity
support to paint tools in the spirit of the pressure support we
already have. Fixes bug #529431.
* app/display/gimpdisplayshell-coords.c
(gimp_display_shell_eval_event): tweak velocity calculation to
work in screen coordinates.
* app/paint/gimppaintoptions.[ch]: add velocity options in the
same way as there are pressure options. Add utility functions
which return dynamic opatity and dynamic rate according to the the
option's settings and some GimpCoords' pressure and velocity.
* app/tools/gimppaintoptions-gui.c: add GUI for the velocity
options.
* app/paint/gimpbrushcore.h: remove PRESSURE_SCALE define, it's
now in gimppaintoptions.h.
* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate):
inerpolate velocity too.
(gimp_brush_core_calc_brush_scale): take velocity into account.
(gimp_brush_core_get_brush_mask): always pressurize the mask in
the GIMP_BRUSH_PRESSURE because there always is velocity (unlike
pressure which is only there on tablets).
* app/paint/gimpairbrush.c
* app/paint/gimpclone.c
* app/paint/gimpconvolve.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimppaintbrush.c
* app/paint/gimpsmudge.c: get opacity and rate from the new paint
options utility functions which take both pressure and velocity
into account.
* app/paint/gimppaintbrush.c: take velocity into account when
calculating the gradient color offset.
* app/paint/gimpairbrush.c: do some additional fiddling with
velocity in the asynchronous airbrush timeout.
* app/paint/gimpairbrushoptions.c: override the velocity-size
property and have it default to FALSE.
svn path=/trunk/; revision=25604