[gimp] app: make luminance blend mode depend on space
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: make luminance blend mode depend on space
- Date: Sun, 9 Jun 2019 18:36:32 +0000 (UTC)
commit 19e74f0e286df21c6fb655a3f98dc444ba8ef6a6
Author: Elle Stone <ellestone ninedegreesbelow com>
Date: Sun Jun 9 13:59:30 2019 -0400
app: make luminance blend mode depend on space
Fixes issue #3451 Space invasion/AnyRGB: Luminance blend mode doesn't work
It might be faster to fetch the RGB luminance and do the computation
ourselves than looking up the same fish for each processing request, at
least now we're faster. (commit message and code slightly revised by pippin)
app/operations/layer-modes/gimpoperationlayermode-blend.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpoperationlayermode-blend.c
b/app/operations/layer-modes/gimpoperationlayermode-blend.c
index e107462d09..8087f98bf9 100644
--- a/app/operations/layer-modes/gimpoperationlayermode-blend.c
+++ b/app/operations/layer-modes/gimpoperationlayermode-blend.c
@@ -891,13 +891,14 @@ gimp_operation_layer_mode_blend_luminance (GeglOperation *operation,
gfloat *comp,
gint samples)
{
- static const Babl *fish;
- gfloat *scratch;
- gfloat *in_Y;
- gfloat *layer_Y;
-
- if (! fish)
- fish = babl_fish ("RGBA float", "Y float");
+ const Babl *fish;
+ gfloat *scratch;
+ gfloat *in_Y;
+ gfloat *layer_Y;
+ const Babl *space = gegl_operation_get_source_space (operation, "input");
+
+ fish = babl_fish (babl_format_with_space ("RGBA float", space),
+ babl_format_with_space ("Y float", space));
scratch = gegl_scratch_new (gfloat, 2 * samples);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]