2014-05-31 15:52:44 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2014-05-31 15:52:44 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_PICKABLE_CONTIGUOUS_REGION_H__
|
|
|
|
#define __GIMP_PICKABLE_CONTIGUOUS_REGION_H__
|
|
|
|
|
|
|
|
|
app: add gimp_pickable_contiguous_region_prepare_line_art_async() ...
... and use in bucket-fill tool
Add gimp_pickable_contiguous_region_prepare_line_art_async(), which
computes a line-art asynchronously, and use it in the bucket-fill
tool, instead of having the tool create the async op.
This allows the async to keep running even after the pickable dies,
since we only need the pickable's buffer, and not the pickable
itself. Previously, we reffed the pickable for the duration of the
async, but we could still segfault when unreffing it, if the
pickable was a drawable, and its parent image had already died.
Furthermore, let the async work on a copy of the pickable's buffer,
rather than the pickable's buffer directly. This avoids some race
conditions when the pickable is the image (i.e., when "sample
merged" is active), since then we're using image projection's
buffer, which is generally unsafe to use in different threads
concurrently.
Also, s/! has_alpha/has_alpha/ when looking for transparent pixels,
and quit early, at least during this stage, if the async in
canceled.
2018-11-20 03:48:26 +08:00
|
|
|
GeglBuffer * gimp_pickable_contiguous_region_by_seed (GimpPickable *pickable,
|
2018-12-02 01:33:51 +08:00
|
|
|
GimpLineArt *line_art,
|
app: add gimp_pickable_contiguous_region_prepare_line_art_async() ...
... and use in bucket-fill tool
Add gimp_pickable_contiguous_region_prepare_line_art_async(), which
computes a line-art asynchronously, and use it in the bucket-fill
tool, instead of having the tool create the async op.
This allows the async to keep running even after the pickable dies,
since we only need the pickable's buffer, and not the pickable
itself. Previously, we reffed the pickable for the duration of the
async, but we could still segfault when unreffing it, if the
pickable was a drawable, and its parent image had already died.
Furthermore, let the async work on a copy of the pickable's buffer,
rather than the pickable's buffer directly. This avoids some race
conditions when the pickable is the image (i.e., when "sample
merged" is active), since then we're using image projection's
buffer, which is generally unsafe to use in different threads
concurrently.
Also, s/! has_alpha/has_alpha/ when looking for transparent pixels,
and quit early, at least during this stage, if the async in
canceled.
2018-11-20 03:48:26 +08:00
|
|
|
gboolean antialias,
|
|
|
|
gfloat threshold,
|
|
|
|
gboolean select_transparent,
|
|
|
|
GimpSelectCriterion select_criterion,
|
|
|
|
gboolean diagonal_neighbors,
|
|
|
|
gint x,
|
|
|
|
gint y);
|
|
|
|
|
|
|
|
GeglBuffer * gimp_pickable_contiguous_region_by_color (GimpPickable *pickable,
|
|
|
|
gboolean antialias,
|
|
|
|
gfloat threshold,
|
|
|
|
gboolean select_transparent,
|
|
|
|
GimpSelectCriterion select_criterion,
|
|
|
|
const GimpRGB *color);
|
2014-05-31 15:52:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GIMP_PICKABLE_CONTIGUOUS_REGION_H__ */
|