The whole bucket fill specific enum stuff is on its way out, so let's
keep this one out of libgimp for now until we decide how to present
line art filling in the PDB.
In GimpTileHandlerValidate, when rendering a whole tile in respone
to a TILE_GET command, use gegl_tile_handler_get_tile() to get the
tile without preserving its data, so that we avoid unnecessarily
fetching the tile from storage, or copying its data during
uncloning.
...palette views despite selected color being in the currently
selected pallette
As suggested by Massimo, changing the color comparison EPSILON in
gimppalette.c from 1e-10 to 1e-6 fixes this, and is really small
enough.
Also, generally clean up color comparison epsilons:
- use a #define, not hardcoded values for all uses of
gimp_rgb[a]_distance()
- call the #defines RGB_EPSILON and RGBA_EPSILON
- make them all 1e-6 or larger
...text layer, not an image of the text
In gimp_edit_paste_get_layer(), when pasting as floating selection,
collapse the pasted layer into an ordinary layer only if it's a group
layer. There is nothing that speaks against having a floating text
layer, it works just fine.
Add gimp_image_colormap_update_formats() which does:
- always update the cached palette formats based on the current space
of the image
- always set the palette entries on the palette formats
Make sure the function is called whenever the space or the colormap
change.
Fix gimp_image_convert_profile_colormap() to convert the colormap
entries between the right spaces.
The raw PDB wrapper _gimp_drawable_get_format() only transfers the
format's encoding, so we need to add the space from the image's color
profile.
Also fix handling of indexed formats: remove our own indexed format
cache and rely on babl_new_palette_with_space() to return the same
format for any (encoding, space) combination.
Also update the PDB docs to reflect that most magic is happening in
the libgimp C wrapper.
Don't just pass the input format's encoding because that loses the
palette. Instead, pass the input format directly so
babl_format_with_space() can do its job of preserving the palette.
In GimpDrawableTreeView, show an error message when attempting to
select a different drawable while the image has an active floating
selection. In GimpLayerTreeView, also blink the editor button-row
when this happens, as a hint that the floating selection can be
committed/canceled through the buttons (we already highlight the
relevant ones.)
This includes gimp-tool-cursors-x2.xcf and cursorname-x2.png files,
they are simply 72x72 upscaled versions of the 36x36 fies with no
changes.
Anyone can now improve on cursors without having to deal with the
bulid process.
If the scale factor is 2 or larger, look for cursor images named
"filename-x2.png" and use them via
gdk_cairo_surface_create_from_pixbuf() and
gdk_cursor_new_from_surface().
Manually scale up the default cursor if there is no "x2" image, using
NEAREST interpolation, which looks better than the default smooth
scaling done by gdk_cursor_new_from_pixbuf() on HiDPI monitors.
Next: adding better HiDPI cursor images.
In gimp_drawable_edit_fill(), if the fill only affects the alpha
channel, and if the drawable has no alpha channel, or the alpha
channel is masked out, do nothing, instead of unnecessarily
performing the fill, which has no effect.
In gimp_gegl_apply_cached_operation(), intersect the cached rects
with the dest rect, so that we don't unnecessarily (if not
erroneously) copy cached regions outside the dest rect to the dest
buffer. This can happen when the op's applicator crop-rect changes
dynamically.
In the warp tool, set the drawable-filter's crop area to the
combined stroke bounds, so that, when comitting the tool, only this
area is processed, instead of the entire drawable area.
In GimpDrawableFilter, when updating the entire filter area, only
update the crop/preview area (as set by
gimp_drawable_filter_set_{crop,preview}()), instead of the entire
drawable.
Add gimp_drawable_filter_set_crop(), which allows setting an output
crop rectangle for the filter; anything outside the rectangle
doesn't get filtered. The crop area is combined with the preview
area to determine the filtered area during preview, however, unlike
the preview area, the crop area remains in effect while committing
the filter.
Consequently, when merging a drawable filter, if the filter has a
crop, only process the cropped area.
We're going to use GimpApplicator's output crop for more than just
split previews. Rename gimp_applicator_set_preview() to
gimp_applicator_set_crop(), and add gimp_applicator_get_crop(),
which returns the output crop rectangle, or NULL if cropping is
disabled.
In GimpFilterTool, show the region combo when applying a non-point
op, as well as when applying a position-dependent point op. The
result of non-point ops may depend on the choice of input region,
even if the op is not position-dependent.
In gimp_drawable_apply_operation(), use a temporary
GimpDrawableFilter to apply the operation, instead of using a
shadow buffer. This renders and composits the op directly into the
drawable buffer, avoiding an intermediate buffer, requiring less
space and speeding up processing.
Remove the use_split_preview and use_result_cache parameters of
gimp_applicator_new(), and allow enabling/disabling the cache
(through gimp_applicator_set_cache()) and the preview crop (through
gimp_applicator_set_preview()) after construction.
Move the preview crop node after the result cache, and remove the
separate preview cache node. This eliminates an extra cache
buffer, reducing the space consumed by filters, and speeds up split
preview, since the cached result now includes the output
compositing.
We now perform the conversion of filter output to the drawable
format as part of the individual filter nodes (see the last few
commits), so there's no need for another conversion after the
filter stack.
This reverts commit d6e0ca5054.
Set the output format of floating-selection applicators to the
target drawable format. We're going to remove the global
GipDrawable convert-format node, which we use to get correct
previews for indexed drawables, so that each filter now has to do
its own format conversion.
In GimpDrawableFilter, set the applicator's output format to the
drawable format, so that the cache uses the drawable format, and so
copying the cached result to the drawble's buffer when comitting
the filter becomes much cheaper, and, in particular, doesn't
require reading tiles out of the swap. This notably improves
commit speed in large images, at the expense of requiring a few
extra conversions during preview.
In GimpApplicator, add gimp_applicator_set_output_format(), which
can be used to explicitly set the format of the result. In
particular, this allows controlling the output cache format, which
can speed up the merging of cached filters.
In GimpLineArt, use the "invalidate-preview" signal of the input
viewable, instead of its "painted" or "rendered" signals, for
asynchronously computing the line art. Subsequently, remove the
aforementioned signals from GimpDrawable and GimpProjection,
respectively. This simplifies the code, and reduces the number of
signals.
This commit completely removes the "Edit -> Fade..." feature,
because...
- The main reason is that "fade" requires us to keep two buffers,
instead of one, for each fadeable undo step, doubling (or worse,
since the extra buffer might have higher precision than the
drawable) the space consumed by these steps. This has notable
impact when editing large images. This overhead is incurred even
when not actually using "fade", and since it seems to be very
rarely used, this is too wasteful.
- "Fade" is broken in 2.10: when comitting a filter, we copy the
cached parts of the result into the apply buffer. However, the
result cache sits after the mode node, while the apply buffer
should contain the result of the filter *before* the mode node,
which can lead to wrong results in the general case.
- The same behavior can be trivially achieved "manually", by
duplicating the layer, editing the duplicate, and changing its
opacity/mode.
- If we really want this feature, now that most filters are GEGL
ops, it makes more sense to just add opacity/mode options to the
filter tool, instead of having this be a separate step.