Commit Graph

65 Commits

Author SHA1 Message Date
Michael Natterer b0beb0197a Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename the tool and its options, and the gradient sub-struct of paint
options.
2018-04-14 00:52:20 +02:00
Michael Natterer bf49b47620 Bug 795207 - Add color space to blend(gradient) tool options
First WIP commit, adds:

- enum GimpGradientBlendColorSpace { RGB_PERCEPTUAL, RGB_LINEAR }
- linear blending mode for gradient segments
- tool options GUI for the blend and paint tools which use gradients
2018-04-13 22:33:16 +02:00
Ell eded91e118 Bug 753412 - New Canvas rotation feature rotates brush.
Replace the "lock brush size to zoom" paint option with a "lock
brush to view" option, which links the entire brush transform to
the view transform, so that the brush remains invariant in display
space under scaling, rotation, and reflection.
2017-12-22 17:52:29 -05:00
Michael Natterer 184f0929ce Bug 771678 - Parametric Brush Aspect Ratio and Angle values...
...are not submitted to respective Tool Options sliders

Treat brush angle and aspect ratio like all other paint options values
that can be linked to brush defaults and take their default values
from the brush. They were special casing their defaults to constants,
and GimpBrushGenerated was adding the passed dynamic radius and aspect
values to its own. This was totally incomprehensible.

Now GimpBrushGenerated's transform_size() and transform_mask()
implementations just translate between these APIs value ranges and the
brush's own value range and only use the passed values (not the
brush's native values), which makes the editor <-> tool options
interaction and the painted brush shape predictable.

Also connect the active brush's property notifications to the paint
options properties, so the paint options follow a brush edit live if
the respective "linked" toggles are checked.

And some cleanup.
2016-10-12 00:21:12 +02:00
Michael Natterer 22fc50c279 app: rename all values of enum GimpContextPropMask
from GIMP_CONTEXT_FOO_MASK to GIMP_CONTEXT_PROP_MASK_FOO.
Also rename the FIRST and LAST values of enum GimpContextPropType.
2015-09-08 21:18:49 +02:00
Alexia Death b0dbb2edf2 Bug 741200 - paint options spacing differs from brush spacing
Add "link" buttons to the tool options that are duplicates of brush
properties, so the tool options values can be set to change along with
the current brush.
2015-01-11 23:20:31 +01:00
Alexia Death 4421070a6a app: add explicit paint options sliders for hardness and force 2014-11-17 13:13:18 +02:00
Alexia Death 9a953a9239 app: locking brush size to zoom 2014-11-17 00:03:10 +02:00
Michael Natterer 9f492273cb Revert "app: reorder spacing after size in the new spacing override code/ui"
This reverts commit 492e1ab560,
but keeps the code cleanups, and adds some more.
2014-11-13 00:37:19 +01:00
Michael Natterer 492e1ab560 app: reorder spacing after size in the new spacing override code/ui 2014-11-12 23:55:46 +01:00
Alexia Death 0c6848e79e app: make spacing override part of paint options 2014-11-13 00:08:40 +02:00
Michael Natterer ef85845372 app: add gimp_paint_options_set_default_brush_size()
and use it globally instead of two different methods, one of which was
forgotten to be ported to the new aspect ratio range where 0.0 means
1:1. Add a FIXME comment in paint_tools.pdb where I think setting the
default size is a bug, see #721249.
2014-01-04 15:48:34 +01:00
Michael Natterer 741792875e app: add the GimpApplicator back for painting, but make its use optional
Default to using the new code. This is out of pure curiosity how
GEGL changes affect painting with a purely graph-based method.
2013-05-21 18:55:03 +02:00
Alexia Death 41b00e2e6b app: Make palette part of paint tools context mask 2012-02-06 21:57:20 +02:00
Michael Natterer 4300612962 app: separate handling of reverse-gradient from paint dynamics
because it belongs to the gradient and should be changed whenever the
gradient gets changed.

Introduce gimp_paint_options_copy_gradient_props() and call it at the
right places in the tool manager.
2011-12-06 22:39:29 +01:00
Alexia Death 52cd1b9043 app: share brush modifiers along with the brush or dynamics 2011-06-02 21:17:52 +03:00
Alexia Death 339deed1da app: Clean up smooth so it would be acceptable for master 2011-01-08 22:19:27 +02:00
Alexia Death 082aa272a4 app: G-Pen algorithm for GIMP trunk. Now smoothing function works for Ink and Brush tools.
Rebased/fixed to go on top of current master. Next commit will add cleanup.
Had to change author tag because gnome is not accepting random stuff
in email fields. Original author is tarai, from gimp painter project
in sourceforge.
2011-01-08 22:17:26 +02:00
Michael Natterer bbc3943638 app: some cleanup in the new paint options code 2010-11-25 21:30:29 +01:00
Alexia Death 904048cdcb app: Clearly present Fade and Color dynamics options as such 2010-11-25 19:06:16 +02:00
Alexia Death 5d42803d7f app: Expose brush size in pixels, not as ratio 2010-10-30 19:51:07 +03:00
Alexia Death e8df164366 app: Add dynamics selector to the tool options 2010-10-27 21:49:24 +03:00
Alexia Death d2ad292848 app: Remove repeat options from gradient for paint tools
Repeat for gradient/color or any other dynamic driving is provided by fade.
2009-12-18 20:51:23 +02:00
Alexia Death a736b8f972 Adding repeat option to fade.
Now fade can be applied either as sawtooth or triangular wave.
Also fade can be reversed.
2009-12-06 20:06:34 +02:00
Alexia Death 943e8c9009 Last bit for dynamics switching. 2009-10-11 01:04:35 +03:00
zhenfeng zhao 8e0a214121 Write dynamics objects separately. Needs debug. 2009-07-21 07:31:02 -03:00
zhenfeng zhao 96baac783f Fade dynamics. Add fade as one more dynamics driving factor on GUI. Implement fading dynamics calculation. Let fade work with all driven factors. Add pixel_dist parameter to get_dynamic_x. Adjusted function calls for get_dynamic_x.
* 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
2009-07-11 15:45:54 -03:00
Alexia Death 6aafd34380 Adds dynamic aspect ratio for brushes. 2009-04-25 20:53:09 +03:00
Sven Neumann d1684f5424 Bug 99457 – Support for dynamics on tilt
2009-02-18  Sven Neumann  <sven@gimp.org>

	Bug 99457 – Support for dynamics on tilt

	* app/tools/gimppaintoptions-gui.c
	* app/paint/gimppaintoptions.[ch]: applied patch from Alexia 
Death
	that allows to map tilt to the dynamic brush parameters.


svn path=/trunk/; revision=28049
2009-02-18 20:19:47 +00:00
Michael Natterer 9999ccf790 Bug 520078 – Rotate brushes
2009-02-08  Michael Natterer  <mitch@gimp.org>

	Bug 520078 – Rotate brushes

	Applied a slightly modified patch from Alexia Death:

	* app/core/core-types.h (struct GimpCoords): add "direction" member.

	* app/core/gimpcoords.c: take direction into account in mix(),
	scalarprod(), length_squared(), manhattan_dist() and equal().

	* app/core/gimpcoords-interpolate.c
	(gimp_coords_interpolate_catmull): same here.
	* app/display/gimpdisplayshell-coords.c

	(gimp_display_shell_eval_event): same here.

	* app/paint/gimppaintoptions.[ch]: add properties for direction
	dynamics and adapt dynamics mixing accordingly.

	* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate):
	"interpolate" direction too (in fact, just copy it from
	last_coords since it doesn't change along a straight line).

	* app/paint/gimppaintcore-stroke.c
	(gimp_paint_core_stroke_emulate_dynamics): emulate direction too.

	* app/tools/gimppaintoptions-gui.c: add GUI for direction dynamics.


svn path=/trunk/; revision=28001
2009-02-08 12:55:20 +00:00
Sven Neumann 30c118b53c Bug 520078 – Rotate brushes
2009-02-05  Sven Neumann  <sven@gimp.org>

	Bug 520078 – Rotate brushes

	Applied patch from Alexia Death:

	* app/core/gimpbrush.[ch]
	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrush-transform.[ch]: affine transformations for
	brushes. So far only scaling and rotation is supported. The
	transformation is done using nearest-neighbour. This is a
	regression and we need to add back interpolation before the next
	release.

	* app/paint/gimpsmudge.c
	* app/paint/gimppaintoptions.[ch]
	* app/paint/gimpbrushcore.[ch]: allow to control the brush
	rotation angle.

	* app/tools/gimppaintoptions-gui.c
	* app/tools/gimpbrushtool.c: added UI for controlling the
	brush rotation angle.

	* app/actions/tools-actions.c
	* app/actions/tools-commands.[ch]: add actions for controlling 
the
	brush rotation angle.


svn path=/trunk/; revision=27987
2009-02-05 21:47:57 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
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
2009-01-17 22:28:01 +00:00
Michael Natterer f096382af5 formatting.
2008-10-25  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintoptions.h: formatting.


svn path=/trunk/; revision=27395
2008-10-25 09:18:49 +00:00
Sven Neumann caa4c529f5 removed 'use_pressure' field from GimpPaintCore.
2008-07-17  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.[ch]: removed 'use_pressure' field 
from
	GimpPaintCore.
	
	* app/paint/gimppaintoptions.[ch]: removed 'use_pressure' 
parameter.

	* app/paint/gimpairbrush.c
	* app/paint/gimpbrushcore.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
	* app/tools/gimppainttool.c: changed accordingly.


svn path=/trunk/; revision=26225
2008-07-17 19:00:13 +00:00
Michael Natterer b819602590 Applied modified patch from Alexia Death. Addresses bug #534770:
2008-05-26  Michael Natterer  <mitch@gimp.org>

	Applied modified patch from Alexia Death. Addresses bug #534770:

	* app/paint/gimppaintoptions.[ch]: add properties for scaling
	the effects of pressure, velocity and hardness and honor them
	in the various get_dynamic_foo() functions.

	(gimp_paint_options_get_dynamic_size): look at
	pressure_options->size again, that code got lost in one of the
	earlier patches.

	* app/tools/gimppaintoptions-gui.c: add GimpScaleButtons to the
	table for the new properties.

	* app/display/gimpdisplayshell-coords.c: don't let "velocity"
	reach 1.0, use 0.9999 instead.


svn path=/trunk/; revision=25816
2008-05-26 19:52:09 +00:00
Michael Natterer cd2c6fee40 replace the identical GimpPressureOptions, GimpVelocityOptions and
2008-05-26  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintoptions.[ch]: replace the identical
	GimpPressureOptions, GimpVelocityOptions and GimpRandomOptions
	struct by a single GimpDynamicOptions struct.

	* app/tools/gimppaintoptions-gui.c: don't pass the various
	sub-structs to the _options_gui() function because they are not
	needed.


svn path=/trunk/; revision=25814
2008-05-26 18:54:28 +00:00
Michael Natterer d66828c883 replace the pressure-expanded, velocity-expanded and random-expanded
2008-05-22  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintoptions.[ch]: replace the pressure-expanded,
	velocity-expanded and random-expanded properties by a single
	dynamics-expanded property.

	* app/tools/gimppaintoptions-gui.c: pack the toggle matrix into an
	expander, some cleanup.


svn path=/trunk/; revision=25765
2008-05-22 19:06:51 +00:00
Michael Natterer fe70064f00 Applied slightly modified and fixed patch from Alexia Death which adds a
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-22 16:38:57 +00:00
Michael Natterer 82c2616f0f Applied modified patch from Alexia Death which adds velocity support to
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
2008-05-10 10:03:21 +00:00
Michael Natterer 7ee6ebcaaf reorder jitter options stuff to be consistently ordered all over the
2008-04-25  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintoptions.[ch]: reorder jitter options stuff to
	be consistently ordered all over the place.


svn path=/trunk/; revision=25523
2008-04-25 10:52:01 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer 6eb7089577 Made all brushes scalable from the tool options. So far only downscaling
2006-11-16  Michael Natterer  <mitch@gimp.org>

	Made all brushes scalable from the tool options. So far only
	downscaling is supported since we lack an algorithm for bitmap
	brush upscaling. Addresses bug #65030.

	* app/paint/gimppaintoptions.[ch]: added "brush-scale" property.

	* app/paint/gimpbrushcore.[ch]: separate pressure logic from brush
	scaling logic and take paint_options->brush_scale into account.
	Added gimp_brush_core_create_bound_segs() which returns BoundSegs
	of the correctly scaled brush mask for the brush preview on the
	canvas.

	* app/tools/gimpbrushtool.c: use gimp_brush_core_create_bound_segs()
	instead of doing this here (also removes all knowledge about lowlevel
	stuff from this file). Connect to notify::brush-scale of the
	paint options and invalidate the brush core's brush accordingly.

	* app/tools/gimppaintoptions-gui.c: added brush scale slider.
2006-11-16 15:11:27 +00:00
Sven Neumann 905fdfcbed did a global gimage -> image substitution.
2006-03-28  Sven Neumann  <sven@gimp.org>

	* app/*: did a global gimage -> image substitution.
2006-03-28 17:08:36 +00:00
Michael Natterer 5d8b25a27d variant of gimp_config_connect() which allows the connected objects to
2006-01-14  Michael Natterer  <mitch@gimp.org>

	* app/config/gimpconfig-utils.[ch] (gimp_config_connect_full):
	variant of gimp_config_connect() which allows the connected
	objects to have different propertynames.

	* app/widgets/widgets-enums.[ch]: removed enum GimpViewType...

	* app/core/core-enums.[ch]: ...and added it here.

	* app/widgets/gimpviewablebutton.[ch] (gimp_viewable_button_new):
	added "button_preview_size" parameter so the button and popup
	preview sizes can be specified separately.

	* app/widgets/gimptemplateeditor.c: changed accordingly.

	* app/widgets/gimpviewablebox.[ch] (gimp_prop_*_box_new):
	new functions which take additional "view_type_prop" and
	"view_size_prop" parameters and sync the passed context's
	properties with the resp. properties of the viewable button.

	* app/paint/gimppaintoptions.[ch]
	* app/tools/gimpbucketfilloptions.c
	* app/tools/gimpclonetool.c
	* app/tools/gimppaintoptions-gui.c
	* app/tools/gimptextoptions.[ch]: added view-type and view-size
	properties to the options objects and use the new viewable box
	constructors so the selected view types and sizes are persistant
	across sessions. Fixes bug #315443.
2006-01-14 00:09:22 +00:00
William Skaggs d452942483 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* gimp/app/paint/gimpbrushcore.c
	* gimp/app/paint/gimpbrushcore.h
	* gimp/app/paint/gimpclone.c
	* gimp/app/paint/gimppaintbrush.c
	* gimp/app/paint/gimppaintoptions.c
	* gimp/app/paint/gimppaintoptions.h
	* gimp/app/tools/gimppaintoptions-gui.c: Apply patch from
	Adrian Likins to add "jitter" to paint tools (bug #163049),
	with small fixes for coding style and default jitter set
	to 0.2 instead of 0.0.
2005-10-03 19:03:14 +00:00
Sven Neumann 24786d2b73 added gimp_prop_expander_new().
2005-01-22  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimppropwidgets.[ch]: added gimp_prop_expander_new().

	* app/paint/gimppaintoptions.[ch]: added a property to track the
	state of the "Pressure sensitivity" expander.

	* app/tools/gimppaintoptions-gui.c: use gimp_prop_expander_new()
	to create the "Pressure sensitivity" expander.
2005-01-22 20:32:34 +00:00
Michael Natterer fcc856868f app/paint/gimpbrushcore.c app/paint/gimppaintoptions.[ch] renamed
2005-01-03  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimpbrushcore.c
	* app/paint/gimppaintoptions.[ch]
	* app/tools/gimppaintoptions-gui.c: renamed "invsize" to
	"inverse-size" and reordered it to be after "size".
2005-01-03 12:08:56 +00:00
William Skaggs 7a3eee51f0 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/paint/gimpbrushcore.c
	* app/paint/gimppaintoptions.c
	* app/paint/gimppaintoptions.h
	* app/tools/gimppaintoptions-gui.c: reverted last change, and
	applied full patch from Dave Ahlswede in bug #149576.
2005-01-01 00:04:37 +00:00
Michael Natterer 9e76c5a4bc added "GimpPaintInfo *paint_info" member and construct property. Changed
2004-08-31  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintoptions.[ch]: added "GimpPaintInfo *paint_info"
	member and construct property. Changed gimp_paint_options_new()
	to take only a GimpPaintInfo parameter.

	* app/core/gimpitem.c (gimp_item_stroke)
	* app/core/gimppaintinfo.c (gimp_paint_info_new): changed accordingly.

	* app/core/gimpchannel.c (gimp_channel_stroke)
	* app/vectors/gimpvectors.c (gimp_vectors_stroke): use
	paint_options->paint_info->paint_type directly instead of casting
	to GimpToolOptions and using
	tool_options->tool_info->paint_info->paint_type (eek). Fixes crash
	when stroking via the PDB because newly created GimpToolOptions
	instances have no "tool_info" pointer yet.

	* tools/pdbgen/pdb/paint_tools.pdb: changed all paint PDB wrappers
	accordingly.

	* app/pdb/paint_tools_cmds.c: regenerated.
2004-08-31 13:20:57 +00:00
Philip Lafleur 234cb4c61c renamed all "pressure-pressure" variables to "pressure-hardness".
2004-06-12  Philip Lafleur  <plafleur@cvs.gnome.org>

	* app/paint/gimppaintoptions.[ch]: renamed all "pressure-pressure"
	variables to "pressure-hardness".

	* app/paint/gimpairbrush.c:
	* app/tools/gimppaintoptions-gui.c: changed accordingly.
2004-06-12 12:44:24 +00:00