[gimp] app: drop alpha from all fishes in gimpgradient.c
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: drop alpha from all fishes in gimpgradient.c
- Date: Sat, 14 Apr 2018 19:10:15 +0000 (UTC)
commit 0c066f311e3024a90fe835feb9f89906d7882fb4
Author: Michael Natterer <mitch gimp org>
Date: Sat Apr 14 21:09:01 2018 +0200
app: drop alpha from all fishes in gimpgradient.c
Alpha is calculated separately, ne need to run it through babl.
Also some formatting cleanup.
app/core/gimpgradient.c | 58 +++++++++++++++++++++++++---------------------
1 files changed, 31 insertions(+), 27 deletions(-)
---
diff --git a/app/core/gimpgradient.c b/app/core/gimpgradient.c
index 3a269b4..1d9e2fc 100644
--- a/app/core/gimpgradient.c
+++ b/app/core/gimpgradient.c
@@ -101,7 +101,7 @@ G_DEFINE_TYPE_WITH_CODE (GimpGradient, gimp_gradient, GIMP_TYPE_DATA,
static const Babl *fish_srgb_to_linear_rgb = NULL;
static const Babl *fish_linear_rgb_to_srgb = NULL;
static const Babl *fish_srgb_to_cie_lab = NULL;
-static const Babl *fish_cie_lab_a_to_srgb = NULL;
+static const Babl *fish_cie_lab_to_srgb = NULL;
static void
@@ -128,12 +128,12 @@ gimp_gradient_class_init (GimpGradientClass *klass)
fish_srgb_to_linear_rgb = babl_fish (babl_format ("R'G'B' double"),
babl_format ("RGB double"));
- fish_linear_rgb_to_srgb = babl_fish (babl_format ("RGBA double"),
- babl_format ("R'G'B'A double"));
+ fish_linear_rgb_to_srgb = babl_fish (babl_format ("RGB double"),
+ babl_format ("R'G'B' double"));
fish_srgb_to_cie_lab = babl_fish (babl_format ("R'G'B' double"),
babl_format ("CIE Lab double"));
- fish_cie_lab_a_to_srgb = babl_fish (babl_format ("CIE Lab alpha double"),
- babl_format ("R'G'B'A double"));
+ fish_cie_lab_to_srgb = babl_fish (babl_format ("CIE Lab double"),
+ babl_format ("R'G'B' double"));
}
static void
@@ -522,19 +522,21 @@ gimp_gradient_get_color_at (GimpGradient *gradient,
{
switch (blend_color_space)
{
- case GIMP_GRADIENT_BLEND_CIE_LAB:
- babl_process (fish_srgb_to_cie_lab,
- &left_color, &left_color, 1);
- babl_process (fish_srgb_to_cie_lab,
- &right_color, &right_color, 1);
- break;
- case GIMP_GRADIENT_BLEND_RGB_LINEAR:
- babl_process (fish_srgb_to_linear_rgb,
- &left_color, &left_color, 1);
- babl_process (fish_srgb_to_linear_rgb,
- &right_color, &right_color, 1);
- case GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL:
- break;
+ case GIMP_GRADIENT_BLEND_CIE_LAB:
+ babl_process (fish_srgb_to_cie_lab,
+ &left_color, &left_color, 1);
+ babl_process (fish_srgb_to_cie_lab,
+ &right_color, &right_color, 1);
+ break;
+
+ case GIMP_GRADIENT_BLEND_RGB_LINEAR:
+ babl_process (fish_srgb_to_linear_rgb,
+ &left_color, &left_color, 1);
+ babl_process (fish_srgb_to_linear_rgb,
+ &right_color, &right_color, 1);
+
+ case GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL:
+ break;
}
rgb.r = left_color.r + (right_color.r - left_color.r) * factor;
@@ -543,15 +545,17 @@ gimp_gradient_get_color_at (GimpGradient *gradient,
switch (blend_color_space)
{
- case GIMP_GRADIENT_BLEND_CIE_LAB:
- babl_process (fish_cie_lab_a_to_srgb,
- &rgb, &rgb, 1);
- break;
- case GIMP_GRADIENT_BLEND_RGB_LINEAR:
- babl_process (fish_linear_rgb_to_srgb,
- &rgb, &rgb, 1);
- case GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL:
- break;
+ case GIMP_GRADIENT_BLEND_CIE_LAB:
+ babl_process (fish_cie_lab_to_srgb,
+ &rgb, &rgb, 1);
+ break;
+
+ case GIMP_GRADIENT_BLEND_RGB_LINEAR:
+ babl_process (fish_linear_rgb_to_srgb,
+ &rgb, &rgb, 1);
+
+ case GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL:
+ break;
}
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]