app: add gimp_gegl_apply_feather()

and use it in gimp_channel_real_feather() so the magic factor of 3.5
to turn feather radius into gegl:gaussian-blur's std_dev is hidden
behind an API.
This commit is contained in:
Michael Natterer 2013-04-08 14:16:33 +02:00
parent d49e33da4a
commit 586bb73293
3 changed files with 34 additions and 8 deletions

View File

@ -1270,14 +1270,11 @@ gimp_channel_real_feather (GimpChannel *channel,
else
gimp_drawable_invalidate_boundary (drawable);
/* 3.5 is completely magic and picked to visually match the old
* gaussian_blur_region() on a crappy laptop display
*/
gimp_gegl_apply_gaussian_blur (gimp_drawable_get_buffer (drawable),
NULL, NULL,
gimp_drawable_get_buffer (drawable),
radius_x / 3.5,
radius_y / 3.5);
gimp_gegl_apply_feather (gimp_drawable_get_buffer (drawable),
NULL, NULL,
gimp_drawable_get_buffer (drawable),
radius_x,
radius_y);
channel->bounds_known = FALSE;

View File

@ -163,6 +163,28 @@ gimp_gegl_apply_flatten (GeglBuffer *src_buffer,
g_object_unref (node);
}
void
gimp_gegl_apply_feather (GeglBuffer *src_buffer,
GimpProgress *progress,
const gchar *undo_desc,
GeglBuffer *dest_buffer,
gdouble radius_x,
gdouble radius_y)
{
g_return_if_fail (GEGL_IS_BUFFER (src_buffer));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
g_return_if_fail (GEGL_IS_BUFFER (dest_buffer));
/* 3.5 is completely magic and picked to visually match the old
* gaussian_blur_region() on a crappy laptop display
*/
gimp_gegl_apply_gaussian_blur (src_buffer,
progress, undo_desc,
dest_buffer,
radius_x / 3.5,
radius_y / 3.5);
}
void
gimp_gegl_apply_gaussian_blur (GeglBuffer *src_buffer,
GimpProgress *progress,

View File

@ -49,6 +49,13 @@ void gimp_gegl_apply_flatten (GeglBuffer *src_buffer,
GeglBuffer *dest_buffer,
const GimpRGB *background);
void gimp_gegl_apply_feather (GeglBuffer *src_buffer,
GimpProgress *progress,
const gchar *undo_desc,
GeglBuffer *dest_buffer,
gdouble radius_x,
gdouble radius_y);
void gimp_gegl_apply_gaussian_blur (GeglBuffer *src_buffer,
GimpProgress *progress,
const gchar *undo_desc,