mirror of https://github.com/GNOME/gimp.git
app: use gegl:dither instead of gegl:reduction
This commit is contained in:
parent
75be560e2a
commit
5627ad589f
|
@ -152,10 +152,10 @@ static const GimpStringActionEntry filters_actions[] =
|
|||
"gegl:color-exchange",
|
||||
NULL /* FIXME GIMP_HELP_FILTER_COLOR_EXCHANGE */ },
|
||||
|
||||
{ "filters-color-reduction", GIMP_STOCK_GEGL,
|
||||
NC_("filters-action", "Color _Reduction..."), NULL, NULL,
|
||||
"gegl:color-reduction",
|
||||
NULL /* FIXME GIMP_HELP_FILTER_COLOR_TEMPERATURE */ },
|
||||
{ "filters-dither", GIMP_STOCK_GEGL,
|
||||
NC_("filters-action", "Dithe_r..."), NULL, NULL,
|
||||
"gegl:dither",
|
||||
NULL /* FIXME GIMP_HELP_FILTER_DITHER */ },
|
||||
|
||||
{ "filters-color-rotate", GIMP_STOCK_GEGL,
|
||||
NC_("filters-action", "_Rotate Colors..."), NULL, NULL,
|
||||
|
@ -665,7 +665,7 @@ filters_actions_update (GimpActionGroup *group,
|
|||
SET_SENSITIVE ("filters-checkerboard", writable);
|
||||
SET_SENSITIVE ("filters-color-enhance", writable && !gray);
|
||||
SET_SENSITIVE ("filters-color-exchange", writable);
|
||||
SET_SENSITIVE ("filters-color-reduction", writable);
|
||||
SET_SENSITIVE ("filters-dither", writable);
|
||||
SET_SENSITIVE ("filters-color-rotate", writable);
|
||||
SET_SENSITIVE ("filters-color-temperature", writable && !gray);
|
||||
SET_SENSITIVE ("filters-color-to-alpha", writable && !gray && alpha);
|
||||
|
|
|
@ -975,9 +975,9 @@ gimp_channel_convert_type (GimpDrawable *drawable,
|
|||
bits = (babl_format_get_bytes_per_pixel (new_format) * 8 /
|
||||
babl_format_get_n_components (new_format));
|
||||
|
||||
gimp_gegl_apply_color_reduction (gimp_drawable_get_buffer (drawable),
|
||||
gimp_gegl_apply_dither (gimp_drawable_get_buffer (drawable),
|
||||
NULL, NULL,
|
||||
dest_buffer, bits, mask_dither_type);
|
||||
dest_buffer, 1 << bits, mask_dither_type);
|
||||
}
|
||||
|
||||
gimp_drawable_set_buffer (drawable, push_undo, NULL, dest_buffer);
|
||||
|
|
|
@ -1071,7 +1071,7 @@ gimp_drawable_convert_type (GimpDrawable *drawable,
|
|||
if (old_bits <= new_bits || new_bits > 16)
|
||||
{
|
||||
/* don't dither if we are converting to a higher bit depth,
|
||||
* or to more than 16 bits (gegl:color-reduction only does
|
||||
* or to more than 16 bits (gegl:dither only does
|
||||
* 16 bits).
|
||||
*/
|
||||
layer_dither_type = GEGL_DITHER_NONE;
|
||||
|
|
|
@ -1100,9 +1100,9 @@ gimp_layer_convert_type (GimpDrawable *drawable,
|
|||
bits = (babl_format_get_bytes_per_pixel (new_format) * 8 /
|
||||
babl_format_get_n_components (new_format));
|
||||
|
||||
gimp_gegl_apply_color_reduction (gimp_drawable_get_buffer (drawable),
|
||||
gimp_gegl_apply_dither (gimp_drawable_get_buffer (drawable),
|
||||
NULL, NULL,
|
||||
src_buffer, bits, layer_dither_type);
|
||||
src_buffer, 1 << bits, layer_dither_type);
|
||||
}
|
||||
|
||||
dest_buffer =
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
|
||||
/* Don't offer dithering when converting down to more than this
|
||||
* number of bits per component. Note that gegl:color-reduction would
|
||||
* number of bits per component. Note that gegl:dither would
|
||||
* do 16 bit, so this is a limitation of the GUI to values that make
|
||||
* sense. See bug #735895.
|
||||
*/
|
||||
|
|
|
@ -271,11 +271,11 @@ gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_gegl_apply_color_reduction (GeglBuffer *src_buffer,
|
||||
gimp_gegl_apply_dither (GeglBuffer *src_buffer,
|
||||
GimpProgress *progress,
|
||||
const gchar *undo_desc,
|
||||
GeglBuffer *dest_buffer,
|
||||
gint bits,
|
||||
gint levels,
|
||||
gint dither_type)
|
||||
{
|
||||
GeglNode *node;
|
||||
|
@ -284,14 +284,14 @@ gimp_gegl_apply_color_reduction (GeglBuffer *src_buffer,
|
|||
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
|
||||
g_return_if_fail (GEGL_IS_BUFFER (dest_buffer));
|
||||
|
||||
bits = CLAMP (bits, 1, 16);
|
||||
levels = CLAMP (levels, 2, 65536);
|
||||
|
||||
node = gegl_node_new_child (NULL,
|
||||
"operation", "gegl:color-reduction",
|
||||
"red-bits", bits,
|
||||
"green-bits", bits,
|
||||
"blue-bits", bits,
|
||||
"alpha-bits", bits,
|
||||
"operation", "gegl:dither",
|
||||
"red-levels", levels,
|
||||
"green-levels", levels,
|
||||
"blue-levels", levels,
|
||||
"alpha-bits", levels,
|
||||
"dither-method", dither_type,
|
||||
NULL);
|
||||
|
||||
|
|
|
@ -47,11 +47,11 @@ gboolean gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer,
|
|||
|
||||
/* apply specific operations */
|
||||
|
||||
void gimp_gegl_apply_color_reduction (GeglBuffer *src_buffer,
|
||||
void gimp_gegl_apply_dither (GeglBuffer *src_buffer,
|
||||
GimpProgress *progress,
|
||||
const gchar *undo_desc,
|
||||
GeglBuffer *dest_buffer,
|
||||
gint bits,
|
||||
gint levels,
|
||||
gint dither_type);
|
||||
|
||||
void gimp_gegl_apply_flatten (GeglBuffer *src_buffer,
|
||||
|
|
|
@ -601,7 +601,7 @@
|
|||
</menu>
|
||||
<separator />
|
||||
<menuitem action="filters-color-to-alpha" />
|
||||
<menuitem action="filters-color-reduction" />
|
||||
<menuitem action="filters-dither" />
|
||||
<menuitem action="filters-color-temperature" />
|
||||
<menuitem action="filters-exposure" />
|
||||
<placeholder name="Modify" />
|
||||
|
|
Loading…
Reference in New Issue