Commit Graph

139 Commits

Author SHA1 Message Date
Ell 8ef1113dee Issue #2372 - Reduced quality of the Parametric brush in 2.10
Promote the precision of generated brushes to 32-bit float, and
modify brush preview generation, and gimpbrushcore-loops, to handle
float brushes.  This avoids posterization in large brushes.

Note that non-generated brushes are still uint8.
2019-02-06 14:30:48 -05:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell a0b73420ec app: add support for brush reflection
Add support for reflecting brushes as part of their transformation.
The reflection is performed as the last step of the transformation,
across the vertical axis.

The option to reflect the brush is not exposed in the UI, or
through the PDB, but is intended to be used for linking the brush
transformation to the view transformation, in the next commit.
2017-12-22 17:52:29 -05:00
Ell 27688ee752 app: fix angle calculation of generated brushes
... so that we don't effectively take the absolute values of
angles.
2017-12-22 17:52:29 -05:00
Ell 089bfe4e3d app: copy brush spacing when copying generated brushes
When copying a generated brush, copy its "spacing" property, in
addition to the other properties, which hasn't been previously
copied by ::duplicate().
2017-11-04 22:00:29 -04:00
Ell 880d3bd182 app: port GimpData subclasses from ::duplicate() to ::copy()
Finish up commit 17583ff04a, which
ported GimpGradient from ::duplicate() to ::copy(), by doing the
same for the rest of the GimpData subclasses that implement
::duplicate().

We still keep GimpData's ::duplicate() virtual function around,
even though it now points to the default implementation (which uses
::copy()) for all subclasses, since ::copy() is stronger than
::duplicate(), and we might want to have certain GimpData types
that are duplicatable, but not copyable.
2017-11-04 22:00:29 -04:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Ell c690ed6bf1 Bug 771616 - Changing parametric brush Hardness parameter doesn't work properly
Check if the brush parameters match the identity parameters, and
return the original brush mask/pixmap if they do, in the actual
mask/pixmap transformation virtual functions, instead of in their
wrappers.  While the identity parameters for raster brushes are
always scale=1, aspect-ratio=0, angle=0, and hardness=1, for
generated brushes they depend on the specific brush
parameterization.
2017-06-14 15:21:23 -04: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 28e1a379e6 app: remove const qualifiers from all object parameters
They are unreliable because every type checking cast discards them,
they are useless anyway, visual clutter, added inconsistently, and
generally suck. Wanted to do this a long time ago, it was a bad idea
in the first place.
2016-05-19 23:54:14 +02:00
Alexia Death d27030413d app: make generated brushes draw at given hardness
Old behavior drew brushes at native * given making the new slider
inefective.
2014-11-19 23:07:21 +02:00
Michael Natterer 9dc13116ae Bug 419256 - Optimize mask buffer size for VBR generated brushes
Change gimp_brush_generated_get_half_size() to get_size() and
calculate its exact size in float. This is really a minor change that
seems to work well.
2014-10-21 12:54:30 +02:00
Michael Natterer 5d8824f42e app: move all GimpBrush members to a private struct
Add and use accessors for width, height, x_axis and y_axis.
2014-10-12 01:16:32 +02:00
Michael Natterer 697572ccc0 app,libgimp*: fix includes to follow our include policy
- 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
2013-10-15 01:58:39 +02:00
Michael Natterer cd0143c350 app: clarify operator precedence in an expression with % and ? 2012-09-21 10:40:44 +02:00
Michael Natterer 1bbd3d40a8 app: make the GimpTempBuf struct private and add accessors 2012-05-02 17:51:12 +02:00
Michael Natterer bdf6b48138 app: move GimpTempBuf from base/ to core/
and forget about include policy in base/, it's scheduled for removal
anyway.
2012-05-02 17:51:01 +02:00
Michael Natterer dccb909009 app: make GimpTempBuf reference counted
and remove the "take_ownership" parameter from
gimp_temp_buf_create_buffer(), simply always ref the buf.
2012-05-02 17:51:00 +02:00
Michael Natterer d5d8e36d21 app: gimp_-namespace all GimpTempBuf functions 2012-05-02 17:51:00 +02:00
Michael Natterer 42a5f01be3 app: rename TempBuf to GimpTempBuf 2012-05-02 17:51:00 +02:00
Michael Natterer 7441a1f6f7 app: turn the TempBuf's "bytes" into "format" and port everything to it 2012-05-02 17:50:59 +02:00
Michael Natterer 8202dcb44e app: don't set mask->x and ->y to bogus and completely unused values 2012-05-02 17:50:58 +02:00
Michael Natterer ff86f85744 app: remove x, y and color parameters from temp_buf_new()
Fix the places that passed the color by either temp_buf_data_clear()
or memset(), and assign x and y manually, they are going to vanish
completely soon.
2012-05-02 17:50:58 +02:00
Alexia Death 4fe9955b3e app: fix some brushes not going small enough correctly
That limit may need to be removed completely some day...
2012-01-20 21:12:19 +02:00
Alexia Death 63c0db45ae app: For generated brushes scale is applied to radius, so divide by 2 2012-01-08 13:45:09 +02:00
Alexia Death 452819143a app: half-sane aspect ratio implementation 2011-01-25 23:28:02 +02:00
Alexia Death b0d02666a3 app: A few more generic aspect ratio fixes 2010-05-14 20:58:27 +03:00
Alexia Death 4816a61dcb app: Aspect ratio fixes 2010-05-10 00:21:55 +03:00
Alexia Death 20d77451fd app: Fix brush tools behavior at very small scale values
Tiny scale value now results in no stamp.
2010-03-07 15:56:38 +02:00
Alexia Death 9774988f30 Real dynamic hardness support for both generated and pixmap brushes.
For generated brushes, dynamic input is applied on top of the set hardness as a factor.
For pixmaps, it influences the amount of blur applied to the stamp. Be warned, process is slow
for large pixmaps. The odd feature previously advertised as hardness is left in but disabled.
If I figure out what it should be exposed as, it might be made available again.
2010-01-01 15:54:31 +02:00
Alexia Death e79834b75e app: Fix garbage appearing in generated brushes with dynamic angles
Rounds angle used in generated brushes to avoid floating point precision problems.
2009-12-30 15:10:34 +02:00
Alexia Death c5b4643d69 Revert "app: Fix garbage appearing in 1:1 apect ratio 2 spike generated brushes"
This reverts commit 54844e8ab8.
An unneded pseudofix. Proper fix will be commited soon.
2009-12-30 13:21:26 +02:00
Alexia Death 54844e8ab8 app: Fix garbage appearing in 1:1 apect ratio 2 spike generated brushes 2009-12-27 00:27:29 +02:00
Michael Natterer 5a145ae4c3 Whitespace cleanup that reduces the diff against master 2009-10-12 13:00:16 +02:00
Alexia Death 04bad5609a Move scale limit so it does not bother generated brushes. 2009-10-11 12:17:29 +03:00
Martin Nordholts 957cf2cfa9 app: Always use gimp_object_get_name()
Begin to consider GimpObject::name as private and always use
gimp_object_get_name(). Change gimp_object_get_name() to take an
untyped pointer so we don't have to do so awfully many casts. There is
a runtime check for the type inside the function anyway.
2009-08-29 12:41:29 +02:00
Alexia Death c3be07e937 Fixes to brush aspect ratio dynamics
Fixes to brush aspect ratios for parametric brushes
2009-04-26 12:08:41 +03:00
Alexia Death 6aafd34380 Adds dynamic aspect ratio for brushes. 2009-04-25 20:53:09 +03:00
Sven Neumann 640afea581 Bug 471681 – Keyboard shortcuts for brush size/params need feedback
2009-03-19  Sven Neumann  <sven@gimp.org>

	Bug 471681 – Keyboard shortcuts for brush size/params need 
feedback

	* app/core/gimpbrushgenerated.c
	* app/core/gimpcontext.c
	* app/paint/gimppaintoptions.c: applied patch from Stephen G. 
that
	marks some strings for translation.


svn path=/trunk/; revision=28182
2009-03-19 20:40:43 +00:00
Sven Neumann 306374a851 Bug 99457 – Support for dynamics on tilt
2009-02-14  Sven Neumann  <sven@gimp.org>

	Bug 99457 – Support for dynamics on tilt

	* app/core/gimpbrush.[ch]
	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrush-transform.[ch]
	* app/paint/gimpbrushcore.c
	* app/paint/gimpsmudge.c: applied patch from Alexia Death,
	separates brush scaling for x and y.


svn path=/trunk/; revision=28036
2009-02-14 22:00:48 +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
Martin Nordholts 2716d25dd5 Rename brush stuff with 'scale' to 'transform'.
Applied patch from Alexia Death that prepares brushes for
arbitrary transforms by renaming stuff with 'scale' to
'transform'. Takes us one step closer to fixing bug #520078.

* app/core/gimpbrush.[ch]
* app/core/gimpbrushgenerated.c
* app/paint/gimpbrushcore.[ch]
* app/paint/gimpsmudge.c

* app/core/gimpbrush-transform.[ch]: New names of
* app/core/gimpbrush-scale.[ch]

* app/core/Makefile.am: Update.

svn path=/trunk/; revision=27975
2009-02-01 11:08:22 +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
Martin Nordholts ddaa0b48ec s/temp_buf_data/temp_buf_get_data/
* app/base/pixel-region.c
* app/base/temp-buf.c
* app/base/temp-buf.h
* app/core/gimpbrush-load.c
* app/core/gimpbrush-scale.c
* app/core/gimpbrush.c
* app/core/gimpbrushgenerated.c
* app/core/gimpgradient.c
* app/core/gimpimage.c
* app/core/gimppalette.c
* app/core/gimppattern-load.c
* app/core/gimppattern.c
* app/core/gimppreviewcache.c
* app/core/gimpviewable.c
* app/paint-funcs/paint-funcs-generic.h
* app/paint/gimpbrushcore.c
* app/paint/gimpclone.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimpink.c
* app/paint/gimppaintbrush.c
* app/pdb/brush-cmds.c
* app/pdb/brushes-cmds.c
* app/pdb/drawable-cmds.c
* app/pdb/image-cmds.c
* app/pdb/pattern-cmds.c
* app/pdb/patterns-cmds.c
* app/text/gimpfont.c
* app/tools/gimpiscissorstool.c
* app/vectors/gimpvectors-preview.c
* app/widgets/gimpbrushselect.c
* app/widgets/gimppatternselect.c
* app/widgets/gimpviewrenderer.c

svn path=/trunk/; revision=27782
2008-12-13 10:35:53 +00:00
Michael Natterer c985f2e2a5 changed GimpBrush::get_extension() to return const gchar* instead of
2008-09-12  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdata.h: changed GimpBrush::get_extension() to return
	const gchar* instead of gchar*

	* app/core/gimpbrush.c
	* app/core/gimpbrushgenerated.c
	* app/core/gimpcurve.c
	* app/core/gimpgradient.c
	* app/core/gimppalette.c
	* app/core/gimppattern.c: changed accordingly.


svn path=/trunk/; revision=26935
2008-09-12 10:35:35 +00:00
Michael Natterer ad01c883db reorder and rename local functions and prototypes to be consistent with
2008-03-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpbrushgenerated.c: reorder and rename local
	functions and prototypes to be consistent with other objects. Misc
	minor cleanup.


svn path=/trunk/; revision=25083
2008-03-11 11:01:19 +00:00
Sven Neumann 410d8a5546 cosmetisc
svn path=/trunk/; revision=22194
2007-03-29 14:09:12 +00:00
Sven Neumann ed93588115 moved generation of the lookup table to it's own function. Also changed
2007-03-29  Sven Neumann  <sven@gimp.org>

	* app/core/gimpbrushgenerated.c (gimp_brush_generated_calc): moved
	generation of the lookup table to it's own function. Also changed
	SUPERSAMPLING from 5 to 4. Let's see if someone complains...


svn path=/trunk/; revision=22193
2007-03-29 14:04:54 +00:00
Michael Natterer 94fe72a220 app/core/gimpbrush.c some minor fixes and stylistic paranoia i overlooked
2007-03-14  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpbrush.c
	* app/core/gimpbrushgenerated.c: some minor fixes and stylistic
	paranoia i overlooked in last night's late review.


svn path=/trunk/; revision=22119
2007-03-14 10:23:18 +00:00
Martin Nordholts e3d9198cc4 Made brushes upscalable by using scale_region. Downscaling still uses
2007-03-14  Martin Nordholts  <martinn@svn.gnome.org>

	Made brushes upscalable by using scale_region. Downscaling still
	uses functions in app/base/brush-scale.c (because of better
	performance). Parametric brushes of course recalculates masks
	instead of using bitmap scaling. Fixes bug #65030.

	* app/core/gimpbrush.[ch]: Added a private scale_buf method which
	uses scale_region (with GIMP_INTERPOLATION_LINEAR) to scale its
	masks and pixmaps. Also added public virtual method scale_size to
	GimpBrush (overridden by GimpBrushGenerated) which calculates the
	buffer sizes for a given brush scaled with a given scale.

	* app/core/gimpbrushgenerated.c: Implemented the new scale_size
	method inherited from GimpBrush, and modified
	gimp_brush_generated_calc to use this helper function.

	* app/tools/gimppaintoptions-gui.c (gimp_paint_options_gui): Made
	the brush Scale-slider logarithmic.

	* app/paint/gimppaintoptions.c (gimp_paint_options_class_init):
	Changed Scale scale to [0.0, 10.0].

	* app/paint/gimpbrushcore.c:
	(gimp_brush_core_calc_brush_size): Refactored 'get brush size' code
	to where it belongs, in GimpBrush-classes, and allowed scales
	larger than 1.0.


svn path=/trunk/; revision=22113
2007-03-14 00:18:01 +00:00