Commit Graph

1205 Commits

Author SHA1 Message Date
Ell 6e314b5090 app: move brush-core loops to a separate file
Move gimp_brush_core_{subsample,pressurize,solidify}_mask() to a
separate gimpbrushcore-loops.cc file, so that they can be C++-ified
independently from the rest of the code.  The next commit
parallelizes them.
2018-04-05 17:41:29 -04:00
Ell f7ea9abc73 app: add include guards to gimppatincore-loops.h 2018-04-05 17:41:29 -04:00
Ell 082a6404c9 app: fix iterator area in canvas_buffer_to_paint_buf_alpha()
The entire ROI was processed in all threads, instead of only the
thread-specific area, causing artifacts.
2018-04-05 02:19:52 -04:00
Ell 3df757ffd7 app: parallelize gimppaintcore-loops.cc
Ditto.
2018-04-04 17:49:47 -04:00
Ell e8a14deecf app: switch gimppaintcore-loops.c to C++
Ditto.
2018-04-04 17:49:46 -04:00
shark0r e55c94eff0 Bug 794854 - Brush color is not added to color history in smudge tool
Add the color in gimp_smudge_paint(INIT) like GimpPaintbrush does.

Achieve this by calling gimp_palettes_add_color_history() directly,
not by inheriting GimpPaintbrush because GimpPaintbrush and GimpSmudge seem to share few common features.
2018-04-01 12:57:27 +02:00
Jehan 04a798d786 app: do not copy needlessly paint_mask GimpTempBuf.
We are not doing any write operation on this mask data so copying all
the data just to read it and unreffing it in the end is only a cost on
performance.
See also bug 694917.
2018-03-31 16:54:53 +02:00
Massimo Valentini f561231e1f app: various speedups to gimp_brush_core_color_area_with_pixmap()
In gimp_brush_core_color_area_with_pixmap(), use the native area
format when painting the brush, instead of always going through
"RGBA float", and create the pixmap -> area fish only once, instead
of once per scanrow.

In gimp_brush_core_paint_line_pixmap_mask(), avoid modulus
calculation at each pixel.

See bug #694917.
2018-03-25 15:22:47 -04:00
Ell 1be002254d Bug 793392 - Issue when painting with some layer modes ...
... on perceptual gamma image

When constructing the paint core's paint buffer, in GimpBrushCore
and GimpInk, use the drawable's format as the preferred format in
the call to gimp_layer_mode_get_format(), instead of NULL.

Subsequently, use the paint buffer's format, instead of the source
buffer's format, as the preferred iterator format in
do_layer_blend(), since the iterator format must match the paint
buffer format.
2018-02-12 13:49:03 -05:00
Michael Natterer 6f324b867a Bug 783755 - Smudge should blend the smudged colors using linear RGB
This reverts commit 94c6bb4603, because
unlike what the bug title suggests, Smudge apparently *should* use
perceptual RGB, so now everything works as before.
2018-02-12 17:27:05 +01:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
shark0r 32280a170b app: Add "No erasing effect" parameter to MyPaint brush
Last and unrelated patch of bug #785001.
2018-01-03 02:23:53 +01:00
Piotr Drąg 4df282a6fb app: fix a typo (realtive) 2017-12-23 00:13:18 +01: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
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 067277340d app: fix brush zoom verification in gimp_brush_core_pre_paint() 2017-12-22 17:52:29 -05:00
Ell 984ed6cefd app: constrain line angles in display space, not image space
Add an offset_angle parameter to gimp_constrain_line(), which
offsets the radial lines by a given angle.

Add gimpdisplayshell-utils.[ch], with two new functions:

  - gimp_display_shell_get_constrained_line_offset_angle():
    Returns the offset angle to be passed to
    gimp_constrain_line(), in order to constrain line angles in
    display space, according to the shell's rotation angle and
    flip mode.

  - gimp_display_shell_constrain_line():  A convenience function
    which calls gimp_constrain_line() with the said offset angle.

Use the new functions in all instances where we constrain line
angles, so that angles are constrained in display space, rather
than image space.

The only exception is GimpEditSelectionTool, which keeps
constraining angles in image space, since it's not entirely obvious
that we want to constrain angles of dragged layers/selections in
display space.
2017-12-22 06:32:24 -05:00
Michael Natterer b05cfc6050 pdb: (try 3) move PDB generation and sources to toplevel/pdb
It never belonged inside "tools". Also rename its "pdb" subdirectory
to "groups". This had to happen before 2.10 so cherry-picking between
branches doesn't become a nightmare in the future.
2017-12-17 14:16:08 -05:00
Ell f7d6805ebb */Makefile.am: add abbreviations to generated enum files
Update the dprod production of generated enum files to include
abbreviated value descriptions, as per the previous commits.

Add a comment for translators above the abbreviated descriptions,
specifying the full description they abbreviate.
2017-11-30 03:10:14 -05:00
Ell 58fdaae3ad enums: add intermediate generated enum files to .gitignore 2017-08-24 15:35:27 -04:00
Michael Natterer 94c6bb4603 Bug 783755 - Smudge should blend the smudged colors using linear RGB
Looked a bit deeper into heal: while I didn't try to understand what
it's actually doing, this is strange: there is a comment that says
that healing should done in perceptual space, and the code uses
R'G'B'A float (at least it completely did before the last commit).

On the other hand, the code adds and subtracts temporary buffers,
which screams "gamma artifacts" unless done in linear space.

This commit changes everything to use linear float buffers,
and removes the comment. It "looks" right to me now, please test.
2017-08-18 23:54:26 +02:00
Ell 71bbd88e00 app: layer mode code shuffling
Commit 3635cf04ab moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses.  As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes.  This is the reckoning :)

Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions.  Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.

Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.

Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.)  This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)

Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.

Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags.  This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.

Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.

Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.

Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 11:19:37 -04:00
Michael Natterer b926de5ada Bug 783755 - Smudge should blend the smudged colors using linear RGB
Use GIMP_LAYER_MODE_NORMAL (not NORMAL_LEGACY) when falling back from
gimp_paint_core_replace() to gimp_paint_core_paste() for layers
without alpha. Adapt the format of the used paint buffers accordingly.
2017-08-12 21:35:47 +02:00
Michael Natterer bcda53ee7b Bug 785001 - Enhanced smudge tool: Smudge with painting
Apply patches from shark0r that alow to mix in both constant and
gradient color while smudging; and clean up the patches.
2017-07-23 14:44:22 +02: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
Michael Natterer f3561549bb app: fix leaks when freeing the list of accum_buffers in gimpsmudge.c 2017-07-15 18:42:43 +02:00
Ell 3ca48a0b30 enums: don't use comments in generated enum recipes
Works in bash, but apparently not portable.
2017-06-02 11:15:43 -04:00
Ell 5bcde32caf enums: run gimp-mkenums from the build dir
Commit 1e6acbd4e1 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
2017-05-22 20:29:18 -04:00
Ell f9fa0d1b18 enums: don't write generated enum files to src-dir if unchanged
When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
2017-05-22 17:58:04 -04:00
Ell 1e6acbd4e1 enums: generate enum files in source dir
We check them into git, so this makes it easier to keep them in
sync when using a separate build directory.

Case in point -- this commit also syncs a few enum files that went
out-of-sync with their headers.
2017-05-06 17:26:16 -04:00
Jehan ab56f524e4 app: "Reset to default values" does not properly reset generated...
... brush features.
My previous commit only fixed aspect ratio reset, but I realize that
much more brush options are affected by defaults of generated brushes
(size, hardness, aspect ratio, angle and spacing). Let's reset all these
after the basic property reset.
2017-05-04 04:59:59 +02:00
Jehan 129a0e4bcd app: "Reset to default values" does not properly reset aspect ratio.
Generated brushes can have specific aspect ratio, hence resetting to
fixed property defaults may be wrong. Therefore GimpPaintOptions needs
to redefine the reset() method from GimpConfigInterface.
Note: the specific "Reset aspect ratio to brush's native aspect ratio"
button was alright. But the broader "Reset to default values" was not.
2017-05-04 04:57:42 +02:00
Jehan b0d2d4fb49 app: indentation fix. 2017-04-22 20:53:08 -03:00
Joao S. O. Bueno c2b643d043 app: For clone tool, pattern source, use the pattern center
Spotted by José Americo Gobbo: when using a pattern source
for the clone tool, the top left corner was picked
as starting control point, which made the "fixed" aligment
rather useless. Using the pattern center allows the
better control of a pattern source.
2017-04-20 00:35:20 -03:00
Ell d4bb12d8b8 app: fix painting with force == 0
Should be a nop, but instead does the same thing as force == 0.5.
2017-04-10 09:57:54 -04:00
Ell 6c8ba75021 Bug 779632 - Clone tool jittering
The expression `src_offset_x - coords->x + origin->x` is parsed as
`(src_offset_x - coords->x) + origin->x`; since floating point
arithmetic is not generally associative, even when
`coords->x == origin->x` (in particular, when there is no active
symmetry), it may still yield a different result than plain
`src_offset_x` if there's not enough precision for the intermediary
result (which is usually the case when `{origin,coords}->x` is
noninteger.)  Since `src_offset_x` is an integer, and since the result
of this expression is rounded to an integer, if the error happens to
be in the direction of the rounding, it's magnified to a whole pixel,
which causes visible "jitter".  (Ditto for `src_offset_y` and co.)

Regardless of this issue, we want to individually round `origin->[xy]`
and `coord->[xy]` down before taking their difference, since the
original offset is calculated according to rounded-down coordinates.
This solves the original issue along the way.
2017-04-03 15:38:27 -04:00
Ell 7c7a1b6383 app: integer-ify position/offset members of GimpSourceCore
We don't support subpixel source sampling, so there's no use in
pretending that we do.  Demoting everything to int as soon as
possible helps guarantee that these values are at least rounded
properly and in fewer places.

Make sure we always round coordinates down, and not toward zero.

Keep using floats only in the signatures of the relevant PDB
functions.
2017-04-03 15:32:27 -04:00
Michael Natterer 3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +01:00
Massimo Valentini 3d58a23342 Bug 764619: Color paint dynamic parameter and square artifacts when one or two channel are disabled 2017-02-21 23:47:01 +01:00
Ell 7402127505 app: remove GIMP_LAYER_MODE_FLAG_WANTS_LINEAR_DATA and friends
Instead, add a gimp_layer_mode_get_format() function, which takes
the layer mode, composite space, and blend space, and returns the
I/O format.

Currently, we always use the composite space format as the I/O
format.  This simplifies gimp_composite_blend(), and gives us
composite-space support for the "special" layer mode ops for free.
2017-02-17 18:19:32 -05:00
Michael Natterer ebd939cb6d app: merge the GimpLayerModeFunc into gimp-layer-modes.c's array
and remove gimplayermodefunctions.[ch].

Make gimp_operation_normal_process() a normal function and redirect to
SSE internally.
2017-02-15 02:25:44 +01:00
Michael Natterer 57360a0ddc Bug 778597 - Eraser paints transparent areas with BG color
Add a "paint_composite_mode" field to GimpLayerModeInfo and set the
mode of the eraser to SRC_ATOP. Defaulting to SRC_OVER for all
painting didn't quite do it for all modes.
2017-02-14 23:04:28 +01:00
Michael Natterer 8634b5cbc3 app: make layer blend color space and compositing color space configurable
...they say it's going to get worse before it gets better...
2017-02-12 23:49:26 +01:00
Michael Natterer e1e41b86d0 app: allow painting on transparent layers with modes != normal
by using GIMP_LAYER_COMPOSITE_SRC_OVER. Please test.
2017-02-05 23:08:16 +01:00
Michael Natterer 2950fecf07 app: move layer mode enums and gimp-layer-modes.[ch] to operations/
and to operations/layer-modes/, respectively.

Add gimp_layer_modes_init() which asserts on the correct order of the
GimpLayerModeInfo array, and switch to accessing the array directly in
gimp_layer_mode_info().
2017-02-05 15:59:29 +01:00
Michael Natterer 2a96d598c3 app: add internal and PDB API and UI to control a layer's composite mode
Largely based on a patch by Ell, with the enum type renamed and
various small changes. Adds another axis of configurability to the
existing layer mode madness, and is WIP too.
2017-02-02 00:38:25 +01:00
Michael Natterer 2dbf1b46b2 app: rename gimp_layer_mode_is_linear() to gimp_layer_mode_wants_linear_data() 2017-01-31 01:43:48 +01:00
Øyvind Kolås 2537d3d0e9 app: refer to (color) space instead of trc for blend/composite
Since CIE Lab is one of the supported color spaces for doing the blending -
this enum is not only about transfer functions/curves or gamma. This finishes
already started cleanups.
2017-01-22 16:04:50 +01:00
Michael Natterer b10fc58802 app: add a "layer-mode" property to GimpOperationLayerMode 2017-01-22 14:41:21 +01:00
Michael Natterer 05f3d38acb app: rename GimpOperationPointLayerMode to GimpOperationLayerMode
and formatting cleanup.
2017-01-21 21:35:52 +01:00
Øyvind Kolås c993adf91e app: remove a trampoline in layer/paint mode dispatch
Fully removes one trampoline level and passing fewer args through the remaining
trampoline.
2017-01-21 14:10:03 +01:00
Michael Natterer a1b844897c app: make GimpPaintOptions' "use-applicator" default to FALSE again 2017-01-21 00:29:41 +01:00
Michael Natterer 485094b9da app: fix painting with the new layer mode code
by creating temp buffers matching the format needed by the
GimpLayerMode's process_pixels() function.
2017-01-21 00:27:48 +01:00
Michael Natterer 2acd2fe74c app: do_layer_blend(): pass the right blend/composite parameters
based on the used GimpLayerMode.
2017-01-21 00:02:22 +01:00
Øyvind Kolås e9d72ef2a8 app: finish GimpLayerColorSpace rename 2017-01-19 19:22:40 +00:00
Michael Natterer 349cff8c16 app: remove "gboolean linear" from gimp_get_layer_mode_function()
and get rid of the two process_pixels() functions in the LCH modes,
they always take linear now.
2017-01-19 18:43:31 +01:00
Øyvind Kolås 41fff6990e app: make layer modes more configurable
Implement a common utility function gimp_blend_composite that uses utility
functions for implementing layer modes, with separate (possibly SIMD) optimized
loops for blending and compositing, with configured linear TRC, perceptual
gamma TRC or even using CIE Lab as the space.
2017-01-19 01:04:15 +01:00
Michael Natterer 1262370544 app: remove "gboolean linear" parameters
from gimp_applicator_new() and gimp_gegl_mode_node_set_mode().
Compositing doesn't depend on the layer format any longer, only on the
layer mode. Painting with "use applicator" unchecked is still broken
in some cases and needs more fixing.
2017-01-18 00:15:55 +01:00
Michael Natterer 69c4644e15 app: rename GimpLayerModeFunction to GimpLayerModeFunc
like all other function typedefs and add GimpBlendFunc typedef which
will be needed soon. Also rename get_layer_mode_function() to
gimp_get_layer_mode_function().
2017-01-16 22:44:01 +01:00
Øyvind Kolås 0bc45c8cd0 app: default to use gegl applicator in paint tools
Temporarily slower - but permits paint modes like overlay/softlight to work at
all for linear TRC pixel encodings. Should be reverted when the non-graph
approach works properly again.
2017-01-12 18:55:38 +01:00
Michael Natterer 77f9659c98 app: move gimplayermodefunctions.[ch] to layer-modes/ 2017-01-11 14:58:43 +01:00
Michael Natterer 66060e3307 app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode
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.
2017-01-08 23:00:19 +01:00
Michael Natterer 350c6ca1f7 Bug 775134 - mypaint-brush: Saved color in a brush isn't taken into account
gimp_mybrush_core_create_brushes(): don't set the current FG or BG on
the brush if its RESTORE_COLOR setting is 1.0 (TRUE).
2016-12-11 19:39:33 +01:00
Alexia Death 43681a6d4c app: flush blur cache and other caches when invalid 2016-11-29 21:25:25 +02:00
Alexia Death 0c04275a32 app: cache bitmap brushes expensive hardness and disable dynamic change 2016-11-26 19:11:26 +02:00
Jehan 4a0653e12d Bug 773960 - smudge tool not working in tiling symmetry.
Initialization was failing when a paint buffer could not be returned for
a stroke (which was bound to happen in tiling). Instead it must just
ignore the coordinates which won't result in painting, and continue to
the next ones.
2016-11-06 17:14:55 +01: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 f40e36ffab Bug 770171 - Mypaint eraser won't work unless there is an alpha channel
In eraser mode, paint with the background color on layers without alpha.
2016-09-03 15:48:02 +02:00
Michael Natterer 73c664ec97 app: fix code duplication in GimpMybrushCore, and clean up coding style
Also fixes a case where converting to the color managed image color
via gimp_pickable_srgb_to_image_color() was forgotten.
2016-08-20 23:46:23 +02:00
Michael Natterer 4fefc3817c Bug 766988 - Colors applied to images are not color managed
Color manage colors applied when painting, and when filling, merging,
resizing and transforming drawables.
2016-05-29 17:51:06 +02:00
Michael Natterer 5080da50e6 app: move the undo impl object typedefs out of the *-types.h files
They are completely private to the undo system and don't need to
be used anywhere else. Removes some clutter from the typed headers.
2016-05-20 18:29:13 +02:00
Michael Natterer 265dfec525 app: split GimpApplicator's opacity and mode API into two functions
Added gimp_applicator_set_opacity() and remove the opacity argument
from set_mode().
2016-05-18 01:51:09 +02:00
Michael Natterer 4110840382 app: the range of GimpInkOption's and GimpBlobEditor's angle is [-PI..PI]
not [-90..90]. This will warn on startup for saved values which are
now out-of-range, but only until the tool options got saved again.
2016-03-21 10:37:56 +01:00
Michael Natterer d588bff8be Bug 763547 - GIMP git segfaults on exit when the airbrush tool is active
Fix GimpAirbrush to not keep a GimpSymmetry instance around across
paint strokes. The symmetry refs its drawable but lacks the code of
dropping the reference when the drawable is removed from the image, or
the image is closed.

Also cleaned up gimp_airbrush_paint() a bit.
2016-03-13 13:15:19 +01:00
Michael Natterer ed821c8184 app: formatting cleanup in gimppaintbrush.c 2016-03-13 13:15:19 +01:00
Michael Natterer a0b18c7929 app: make GimpApplicator's preview feature optional
Don't add the preview nodes if use_preview_cache is FALSE in
gimp_applicator_new().
2016-02-16 21:36:35 +01:00
Michael Natterer e5b6806fe2 app: port tons of files to the new GIMP_CONFIG_PROP_FOO() macros
and remove lots of labels from calls to gimp_prop_foo_new(). Also
had to manually remove some unwanted labels that are now added
automatically, fixes bug #761880.
2016-02-11 23:46:24 +01:00
Michael Natterer 02f76b4c7b app: rename GimpImage.selected_symmetry to .active_symmetry
because that's the usual naming. Also change the set/get API accordingly.
2016-02-03 21:25:17 +01:00
Jehan 76f573c981 Bug 648776 - mirror symmetries.
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.
2016-02-02 21:15:13 +01:00
Daniel Sabo 71e8ef6103 app: mypaint: Honor selection mask 2016-01-27 08:47:26 -08:00
Mukund Sivaraman e14c1a0156 Use GQueue for strokes list 2016-01-25 10:56:15 +05:30
Jehan 2cf381d211 app: fix typos in comment. 2016-01-20 21:30:55 +01:00
Michael Natterer dd171bbf0c Bug 760175 - paintbrush size not applied in python scripts in version 2.9
Remove the code that links size, spacing etc. to brush defaults from
the GimpPaintOptions class impl and add it to gimppaintoptions-gui.c
as a callback instead.

It's not a core thing and that magic with side effects should only be
applied to the GimpPaintOptions behind the tool options GUI.
2016-01-06 01:24:56 +01:00
Daniel Sabo 78cdbdb794 app: mypaint: Remove inaccurate comment 2015-12-30 08:21:30 -08:00
Daniel Sabo dd0b253fea app: mypaint: Add some hacky code to allow line drawing 2015-12-29 14:30:28 -08:00
Daniel Sabo 6d9aee3d73 app: mypaint: Remove another stray #if 0 2015-12-29 14:30:28 -08:00
Daniel Sabo b48ac23690 app: mypaint: Remove #if 0'ed code for libmypaint-gegl 2015-12-29 09:56:38 -08:00
Michael Natterer 660a7aed16 app: formatting cleanup in the last commit 2015-12-29 17:08:51 +01:00
Alexia Death 53eb8677ea app: Allow for mypaint tool to differentiate extended and non-extended events
This adds a boolean to GimpCoords struct that is true for enabled
extended non-mouse devices and false for all the rest allowing
the mypaint brush to override the the pressure sent to the paint library.
2015-12-29 15:44:53 +02:00
Michael Natterer 2e40af5dcf app: remove virtual function GimpToolOptions::reset()
and use GimpConfig::reset() instead.
2015-12-29 12:47:04 +01:00
Daniel Sabo eec556f614 app: mypaint: Use GimpConfig->reset instead of GimpToolOptions->reset 2015-12-28 17:07:45 -08:00
Daniel Sabo d6b52b7f0c app: mypaint: Fix missing chain up in gimp_mybrush_options_reset 2015-12-28 16:47:45 -08:00
Daniel Sabo cba2f07854 app: mypaint: Make the reset-to-defaults button reset to the current myb's defaults 2015-12-28 16:02:36 -08:00
Daniel Sabo 677b1f2d82 app: mypaint: Add a toggle to change between erase & paint mode 2015-12-28 15:25:47 -08:00
Daniel Sabo e0fc362b12 app: mypaint: Add colorize mode 2015-12-28 13:58:38 -08:00
Daniel Sabo 315972fea8 app: mypaint: Get rid of mixbuf, fix transparent pixel color when masking is active 2015-12-28 13:42:04 -08:00
Daniel Sabo c97a529968 app: Change mypaint dependency from libmypaint-gegl to just libmypaint 2015-12-28 09:18:46 -08:00
Michael Natterer d01ba07ed6 configure.ac, app: make libmypaint a hard dependency
and move the MyPaint brush tool out of the playground.
2015-12-21 21:39:48 +01:00
Michael Natterer ccd8ec5dee app: connect the MyPaint brush core with the new brush container
and remove all hackish temp code that did the same. Remove quite
some #ifdefs around code that doesn't depend on libmypaint.
2015-12-21 12:28:46 +01:00
Daniel Sabo bf161e7b14 app: MyBrush: Improve blend math 2015-12-20 17:04:18 -08:00
Michael Natterer d4aa39a7cd app, libgimpwidgets, icons: rename mypaint brush icons and help ID
from "mybrush" to "mypaint brush".
2015-12-21 00:09:55 +01:00
Michael Natterer c6586ec6e4 app: rename GimpMybrush to GimpMybrushCore
so GimpMybrush can be used for the actual brush object.
2015-12-20 01:03:56 +01:00
Daniel Sabo 812526f0f0 app: GimpMybrush: Don't treat time == 0 as a magic value 2015-12-19 15:27:44 -08:00
Daniel Sabo df21e07855 app: Fix MyPaint brush rendering, implement MyPaintSurface in a native format 2015-12-15 14:48:18 -08:00
Jehan bcbc83dc5a app: replace some tabs with spaces in app/paint. 2015-12-15 23:45:18 +01:00
Michael Natterer 93fdaa0597 Bug 731279 - Tool Preset Editor not working correctly
This (doesn't quite) fix an obscure part of the tool preset bugs: when
changing the brush on a GimpPaintOptions instance, we might or might
not change the brush size, aspect etc. to the set brush's native
values, possibly overwriting the intended values from a tool preset.

Implement GimpConfig::copy() and copy the affected values again after
the entire object has been copied, so we actually use the value of
gimp_config_copy()'s "source" object.

This would fix that particular tool preset problem if there wasn't
another bug that is still unfixed, stay tuned...
2015-10-14 23:02:07 +02:00
Jehan c7adff4f6f Revert "app: save gradient first and last color with dynamics color output..."
This reverts commit 15b5b2c8b3.
This feature is "undiscoverable" according to Mitch, and we are not sure
how much the endpoint colors are special to the user.
2015-10-08 19:33:07 +02:00
Jehan 15b5b2c8b3 app: save gradient first and last color with dynamics color output...
in the recently used colors palette.
2015-09-30 17:30:50 +02:00
Jehan 52f6a2aeb4 app: save color history when a color is used.
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.
2015-09-30 16:39:05 +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
Michael Natterer 4479cedf13 app: rename mask enum values GIMP_COMPONENT_RED,GREEN,BLUE etc.
to GIMP_COMPONENT_MASK_RED,GREEN,BLUE etc.
2015-09-07 00:35:02 +02:00
Michael Natterer db386eb361 app: fix selection mask offset in do_layer_blend()
Fixes painting when there is both a layer offset and a selection.
Offsets between offsets are hard...
2015-07-04 13:28:59 +02:00
Michael Natterer 5422646d91 Bug 750674 - Stroke selection doesn't honor brush size set in paint tool options
Implement GimpConfigInterface::duplicate() and after duplicating the
paint options, copy the brush-related properties again, because they
might have been changed by setting the brush on the copy (if they are
set to be linked to the brush's native values).
2015-06-14 20:43:45 +02:00
Thomas Manni a7b84ded8e Bug 325564 - Use CIE LCH instead of HSL for layer mode Color
Add Hue, Chroma, Color and Lightness layer modes in LCH color space.
2015-06-02 01:37:26 +02:00
Michael Natterer 9f9865afb8 app: fix the build with MyPaint brushes enabled, and some formatting foo 2015-05-25 02:15:03 +02:00
Øyvind Kolås 7e6320497e follow gegl api changes from commit af5361ca8d, with an abyss policy argument
to gegl_buffer_copy.
2015-05-25 01:27:31 +02:00
Michael Natterer 7449316898 app: add gimp_dynamics_is_output_enabled()
and use it to further simplify stuff. Almost no place needs to use a
GimpDynamicsOutput directly now.
2015-04-19 21:58:36 +02:00
Michael Natterer ca07026642 app: simplify handling of the force output in paint methods 2015-04-19 21:27:48 +02:00
Jehan 5217900748 configure/app: libmypaint becomes an optional dependency. 2015-03-30 22:38:35 +02:00
Jehan 5460c414db app: move the MyPaint brush into the playground. 2015-03-30 22:38:35 +02:00
Jehan 77b04551c8 app: clean compilation with external libmypaint.
The work-in-progress was using a source tree of libmypaint embedded
into GIMP tree. This is a cleaning with pkg-config test in configure,
and correct includes.
2015-03-30 22:38:35 +02:00
Michael Natterer 9629befec6 app: make a copy of the drawable's buffer in MyPaint native format 2015-03-30 22:38:34 +02:00
Michael Natterer 071ede915a app: first draft of GimpMybrushTool, which uses MyPaint brushes 2015-03-30 22:38:34 +02:00
Michael Natterer a75a479d81 app: #include "core/gimpdynamicsoutput.c" in some files in paint/ 2015-02-15 20:05:30 +01:00
Alexia Death ace4234a98 app: make all tools capable of dynamic force respect the options slider 2015-01-19 10:55:56 +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
Michael Natterer a101ed2aef app, pdb: change range of brush-spacing to 0.01..5.0
And only use percent in the GUI.
2014-11-17 23:56:16 +01:00
Michael Natterer 7c2e226566 app: simplify logic in gimp_paint_options_get_brush_mode() 2014-11-17 23:35:10 +01:00
Michael Natterer 548df1fa32 app: change brush-hardness and brush-force range to [0.0..1.0]
and set a factor of 100 on the GUI.
2014-11-17 23:17:13 +01:00
Michael Natterer c9e75b1fa0 app: some cleanup in the new paint options code 2014-11-17 21:45:01 +01:00
Alexia Death 2a7dbbd438 app: fix force slider dynamics interacttion to just dynamics when activated 2014-11-17 17:05:54 +02:00
Alexia Death d0862180c4 app: fix force default handling 2014-11-17 15:40:33 +02:00
Alexia Death 32e545277b app: fixes for force and hardness 2014-11-17 15:24:59 +02:00
Alexia Death 4421070a6a app: add explicit paint options sliders for hardness and force 2014-11-17 13:13:18 +02:00
Alexia Death 6ef522b38b app: fix spacing to copy between paint tools 2014-11-17 00:03:15 +02:00
Alexia Death 9a953a9239 app: locking brush size to zoom 2014-11-17 00:03:10 +02:00
Alexia Death 7f6cdf635a Revert "app: apply a cap on brush scaling"
This reverts commit 5a22fb5799.
2014-11-15 22:25:59 +02:00
Alexia Death 5a22fb5799 app: apply a cap on brush scaling 2014-11-15 21:56:51 +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
Alexia Death 69e09e0775 app: whitespace fix 2014-11-13 00:08:38 +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
Simon Budig 9a8d2f577e fix some pieces of nonsensical code
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:13 +02:00
Michael Natterer b5530e9e3d Use the new GeglAccessMode enum instead of the old values 2014-07-02 02:00:35 +02:00
Michael Natterer db2ea536da app: add an optional gegl:cache at the output of GimpApplicator
Add "gboolean use_cache" to gimp_applicator_new(). Don't use a cache
anywhere but in GimpImageMap because it incrementally fills that cache
via the projection update. In gimp_drawable_merge_filter(), get that
cache and pass it to gimp_gegl_apply_cached_operation() which then
avoids doing the work twice for the already cached results. Win!
2014-06-18 18:50:53 +02:00
Michael Natterer 23037b5230 app: convert all stock IDs kept around by the core by icon names
Particularly GimpViewable's stock_id. Make sure old config files
containing stock IDs are still properly parsed.
2014-05-07 01:01:56 +02:00
Michael Natterer a4223766f2 all,libgimp*: move GimpConvolveType and GimpInkBlobType to libgimpbase
and make GimpConvolveType's values sane.
2014-04-29 22:44:58 +02:00
Michael Natterer 5a89c15ba1 app: remove unused enum value GIMP_CUSTOM_CONVOLVE 2014-04-29 21:06:42 +02:00
Michael Natterer 22c222291d libgimpbase,*: clean up enum values in gimpbaseenums.h
GIMP_ADD_foo_MASK -> GIMP_ADD_MASK_foo
GIMP_foo_MODE -> GIMP_BLEND_foo
GIMP_foo_CLONE -> GIMP_CLONE_foo
GIMP_foo -> GIMP_DODGE_BURN_TYPE_foo
GIMP_foo -> GIMP_TRANSFER_foo

Add compat values for the old names and compat code to script-fu
and pygimp.
2014-04-29 20:58:30 +02:00