2008-08-08 23:27:40 +08:00
|
|
|
/* GIMP Wheel ColorSelector
|
|
|
|
* Copyright (C) 2008 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2008-08-08 23:27:40 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2008-08-08 23:27:40 +08:00
|
|
|
* (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/>.
|
2008-08-08 23:27:40 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2012-05-03 09:36:22 +08:00
|
|
|
#include <gegl.h>
|
2008-08-08 23:27:40 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
|
|
|
#include "libgimpmath/gimpmath.h"
|
|
|
|
#include "libgimpmodule/gimpmodule.h"
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2013-01-06 09:37:41 +08:00
|
|
|
#include "gimpcolorwheel.h"
|
|
|
|
|
2008-08-08 23:27:40 +08:00
|
|
|
#include "libgimp/libgimp-intl.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define COLORSEL_TYPE_WHEEL (colorsel_wheel_get_type ())
|
|
|
|
#define COLORSEL_WHEEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLORSEL_TYPE_WHEEL, ColorselWheel))
|
|
|
|
#define COLORSEL_WHEEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COLORSEL_TYPE_WHEEL, ColorselWheelClass))
|
|
|
|
#define COLORSEL_IS_WHEEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLORSEL_TYPE_WHEEL))
|
|
|
|
#define COLORSEL_IS_WHEEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COLORSEL_TYPE_WHEEL))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _ColorselWheel ColorselWheel;
|
|
|
|
typedef struct _ColorselWheelClass ColorselWheelClass;
|
|
|
|
|
|
|
|
struct _ColorselWheel
|
|
|
|
{
|
|
|
|
GimpColorSelector parent_instance;
|
|
|
|
|
|
|
|
GtkWidget *hsv;
|
2023-12-17 22:22:18 +08:00
|
|
|
GtkWidget *label;
|
|
|
|
|
2023-12-17 13:28:29 +08:00
|
|
|
const Babl *format;
|
2008-08-08 23:27:40 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _ColorselWheelClass
|
|
|
|
{
|
|
|
|
GimpColorSelectorClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-05-22 09:51:36 +08:00
|
|
|
GType colorsel_wheel_get_type (void);
|
2008-08-08 23:27:40 +08:00
|
|
|
|
|
|
|
static void colorsel_wheel_set_color (GimpColorSelector *selector,
|
app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:
1. Take into account the image space, and this is what we must navigate
through, in particular for various representations of RGB or HSV.
I.e. that if the active image is in anyRGB, the RGB values shown must
be within anyRGB. Right now, everything is still shown/used as sRGB
(even though it's properly retrieved and transformed to the target
space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
label somewhere.
3. Allow to switch between image and softproof spaces, regarding
out-of-gamut display. I.e. that while RGB/HSV must be shown within
the image space (assuming it's anyRGB), we may want to show
out-of-gamut area (pink areas) within the softproof space. This may
mean adding a checkbox. Or maybe simply taking into account whether
we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
gimp_widget_get_render_space() for display drawing. We don't need any
soft-proofing or black point compensation for any of these widgets so
pure babl is fine. Indeed we want to show any in-gamut color
correctly (and not transformed according to specific intents or
through soft-proofing). We will take care of the proofing case with
out-of-gamut area showing only.
5. In the various drawing functions, we should move to
CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
that it makes sense to be more accurate, especially as we are
essentially showing color gradients in 1 or 2 directions in these
various widgets.
2023-12-12 16:01:17 +08:00
|
|
|
GeglColor *color);
|
2023-12-17 13:28:29 +08:00
|
|
|
static void colorsel_wheel_set_format (GimpColorSelector *selector,
|
|
|
|
const Babl *format);
|
2016-05-27 07:12:35 +08:00
|
|
|
static void colorsel_wheel_set_config (GimpColorSelector *selector,
|
|
|
|
GimpColorConfig *config);
|
2013-01-06 09:37:41 +08:00
|
|
|
static void colorsel_wheel_changed (GimpColorWheel *hsv,
|
2008-08-08 23:27:40 +08:00
|
|
|
GimpColorSelector *selector);
|
|
|
|
|
|
|
|
static const GimpModuleInfo colorsel_wheel_info =
|
|
|
|
{
|
|
|
|
GIMP_MODULE_ABI_VERSION,
|
|
|
|
N_("HSV color wheel"),
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"v1.0",
|
|
|
|
"(c) 2008, released under the GPL",
|
|
|
|
"08 Aug 2008"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
G_DEFINE_DYNAMIC_TYPE (ColorselWheel, colorsel_wheel,
|
|
|
|
GIMP_TYPE_COLOR_SELECTOR)
|
|
|
|
|
|
|
|
|
|
|
|
G_MODULE_EXPORT const GimpModuleInfo *
|
|
|
|
gimp_module_query (GTypeModule *module)
|
|
|
|
{
|
|
|
|
return &colorsel_wheel_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
G_MODULE_EXPORT gboolean
|
|
|
|
gimp_module_register (GTypeModule *module)
|
|
|
|
{
|
2013-07-14 19:41:29 +08:00
|
|
|
color_wheel_register_type (module);
|
2008-08-08 23:27:40 +08:00
|
|
|
colorsel_wheel_register_type (module);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
colorsel_wheel_class_init (ColorselWheelClass *klass)
|
|
|
|
{
|
|
|
|
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
|
|
|
|
|
2016-05-27 07:12:35 +08:00
|
|
|
selector_class->name = _("Wheel");
|
|
|
|
selector_class->help_id = "gimp-colorselector-triangle";
|
2017-03-05 23:01:59 +08:00
|
|
|
selector_class->icon_name = GIMP_ICON_COLOR_SELECTOR_TRIANGLE;
|
2016-05-27 07:12:35 +08:00
|
|
|
selector_class->set_color = colorsel_wheel_set_color;
|
|
|
|
selector_class->set_config = colorsel_wheel_set_config;
|
2023-12-17 13:28:29 +08:00
|
|
|
selector_class->set_format = colorsel_wheel_set_format;
|
2018-06-24 21:36:00 +08:00
|
|
|
|
|
|
|
gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "ColorselWheel");
|
2008-08-08 23:27:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
colorsel_wheel_class_finalize (ColorselWheelClass *klass)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
colorsel_wheel_init (ColorselWheel *wheel)
|
|
|
|
{
|
2013-01-06 09:37:41 +08:00
|
|
|
wheel->hsv = gimp_color_wheel_new ();
|
2016-05-27 07:12:35 +08:00
|
|
|
g_object_add_weak_pointer (G_OBJECT (wheel->hsv),
|
|
|
|
(gpointer) &wheel->hsv);
|
2018-06-24 21:36:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (wheel), wheel->hsv, TRUE, TRUE, 0);
|
2008-08-08 23:27:40 +08:00
|
|
|
gtk_widget_show (wheel->hsv);
|
|
|
|
|
2023-12-17 22:22:18 +08:00
|
|
|
wheel->label = gtk_label_new (NULL);
|
|
|
|
gtk_widget_set_halign (wheel->label, GTK_ALIGN_START);
|
|
|
|
gtk_widget_set_vexpand (wheel->label, FALSE);
|
|
|
|
gtk_label_set_justify (GTK_LABEL (wheel->label), GTK_JUSTIFY_LEFT);
|
|
|
|
gtk_label_set_text (GTK_LABEL (wheel->label), _("Profile: sRGB"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (wheel), wheel->label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (wheel->label);
|
|
|
|
|
2008-08-08 23:27:40 +08:00
|
|
|
g_signal_connect (wheel->hsv, "changed",
|
|
|
|
G_CALLBACK (colorsel_wheel_changed),
|
|
|
|
wheel);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
colorsel_wheel_set_color (GimpColorSelector *selector,
|
app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:
1. Take into account the image space, and this is what we must navigate
through, in particular for various representations of RGB or HSV.
I.e. that if the active image is in anyRGB, the RGB values shown must
be within anyRGB. Right now, everything is still shown/used as sRGB
(even though it's properly retrieved and transformed to the target
space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
label somewhere.
3. Allow to switch between image and softproof spaces, regarding
out-of-gamut display. I.e. that while RGB/HSV must be shown within
the image space (assuming it's anyRGB), we may want to show
out-of-gamut area (pink areas) within the softproof space. This may
mean adding a checkbox. Or maybe simply taking into account whether
we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
gimp_widget_get_render_space() for display drawing. We don't need any
soft-proofing or black point compensation for any of these widgets so
pure babl is fine. Indeed we want to show any in-gamut color
correctly (and not transformed according to specific intents or
through soft-proofing). We will take care of the proofing case with
out-of-gamut area showing only.
5. In the various drawing functions, we should move to
CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
that it makes sense to be more accurate, especially as we are
essentially showing color gradients in 1 or 2 directions in these
various widgets.
2023-12-12 16:01:17 +08:00
|
|
|
GeglColor *color)
|
2008-08-08 23:27:40 +08:00
|
|
|
{
|
|
|
|
ColorselWheel *wheel = COLORSEL_WHEEL (selector);
|
2024-04-21 05:31:58 +08:00
|
|
|
gfloat hsv[3];
|
app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:
1. Take into account the image space, and this is what we must navigate
through, in particular for various representations of RGB or HSV.
I.e. that if the active image is in anyRGB, the RGB values shown must
be within anyRGB. Right now, everything is still shown/used as sRGB
(even though it's properly retrieved and transformed to the target
space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
label somewhere.
3. Allow to switch between image and softproof spaces, regarding
out-of-gamut display. I.e. that while RGB/HSV must be shown within
the image space (assuming it's anyRGB), we may want to show
out-of-gamut area (pink areas) within the softproof space. This may
mean adding a checkbox. Or maybe simply taking into account whether
we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
gimp_widget_get_render_space() for display drawing. We don't need any
soft-proofing or black point compensation for any of these widgets so
pure babl is fine. Indeed we want to show any in-gamut color
correctly (and not transformed according to specific intents or
through soft-proofing). We will take care of the proofing case with
out-of-gamut area showing only.
5. In the various drawing functions, we should move to
CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
that it makes sense to be more accurate, especially as we are
essentially showing color gradients in 1 or 2 directions in these
various widgets.
2023-12-12 16:01:17 +08:00
|
|
|
|
2024-04-21 05:31:58 +08:00
|
|
|
gegl_color_get_pixel (color, babl_format_with_space ("HSV float", wheel->format), hsv);
|
app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:
1. Take into account the image space, and this is what we must navigate
through, in particular for various representations of RGB or HSV.
I.e. that if the active image is in anyRGB, the RGB values shown must
be within anyRGB. Right now, everything is still shown/used as sRGB
(even though it's properly retrieved and transformed to the target
space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
label somewhere.
3. Allow to switch between image and softproof spaces, regarding
out-of-gamut display. I.e. that while RGB/HSV must be shown within
the image space (assuming it's anyRGB), we may want to show
out-of-gamut area (pink areas) within the softproof space. This may
mean adding a checkbox. Or maybe simply taking into account whether
we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
gimp_widget_get_render_space() for display drawing. We don't need any
soft-proofing or black point compensation for any of these widgets so
pure babl is fine. Indeed we want to show any in-gamut color
correctly (and not transformed according to specific intents or
through soft-proofing). We will take care of the proofing case with
out-of-gamut area showing only.
5. In the various drawing functions, we should move to
CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
that it makes sense to be more accurate, especially as we are
essentially showing color gradients in 1 or 2 directions in these
various widgets.
2023-12-12 16:01:17 +08:00
|
|
|
g_signal_handlers_block_by_func (wheel->hsv,
|
|
|
|
G_CALLBACK (colorsel_wheel_changed),
|
|
|
|
wheel);
|
|
|
|
gimp_color_wheel_set_color (GIMP_COLOR_WHEEL (wheel->hsv), hsv[0], hsv[1], hsv[2]);
|
|
|
|
g_signal_handlers_unblock_by_func (wheel->hsv,
|
|
|
|
G_CALLBACK (colorsel_wheel_changed),
|
|
|
|
wheel);
|
2008-08-08 23:27:40 +08:00
|
|
|
}
|
|
|
|
|
2023-12-17 13:28:29 +08:00
|
|
|
static void
|
|
|
|
colorsel_wheel_set_format (GimpColorSelector *selector,
|
|
|
|
const Babl *format)
|
|
|
|
{
|
|
|
|
ColorselWheel *wheel = COLORSEL_WHEEL (selector);
|
|
|
|
|
|
|
|
if (wheel->format != format)
|
|
|
|
{
|
|
|
|
wheel->format = format;
|
|
|
|
gimp_color_wheel_set_format (GIMP_COLOR_WHEEL (wheel->hsv), format);
|
2023-12-17 22:22:18 +08:00
|
|
|
|
|
|
|
if (format == NULL || babl_format_get_space (format) == babl_space ("sRGB"))
|
|
|
|
{
|
|
|
|
gtk_label_set_text (GTK_LABEL (wheel->label), _("Profile: sRGB"));
|
|
|
|
gimp_help_set_help_data (wheel->label, NULL, NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GimpColorProfile *profile = NULL;
|
|
|
|
const gchar *icc;
|
|
|
|
gint icc_len;
|
|
|
|
|
|
|
|
icc = babl_space_get_icc (babl_format_get_space (format), &icc_len);
|
|
|
|
profile = gimp_color_profile_new_from_icc_profile ((const guint8 *) icc, icc_len, NULL);
|
|
|
|
|
|
|
|
if (profile != NULL)
|
|
|
|
{
|
|
|
|
gchar *text;
|
|
|
|
|
|
|
|
text = g_strdup_printf (_("Profile: %s"), gimp_color_profile_get_label (profile));
|
|
|
|
gtk_label_set_text (GTK_LABEL (wheel->label), text);
|
|
|
|
gimp_help_set_help_data (wheel->label,
|
|
|
|
gimp_color_profile_get_summary (profile),
|
|
|
|
NULL);
|
|
|
|
g_free (text);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_label_set_markup (GTK_LABEL (wheel->label), _("Profile: <i>unknown</i>"));
|
|
|
|
gimp_help_set_help_data (wheel->label, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_clear_object (&profile);
|
|
|
|
}
|
2023-12-17 13:28:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-27 07:12:35 +08:00
|
|
|
static void
|
|
|
|
colorsel_wheel_set_config (GimpColorSelector *selector,
|
|
|
|
GimpColorConfig *config)
|
|
|
|
{
|
|
|
|
ColorselWheel *wheel = COLORSEL_WHEEL (selector);
|
|
|
|
|
|
|
|
if (wheel->hsv)
|
|
|
|
gimp_color_wheel_set_color_config (GIMP_COLOR_WHEEL (wheel->hsv), config);
|
|
|
|
}
|
|
|
|
|
2008-08-08 23:27:40 +08:00
|
|
|
static void
|
app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:
1. Take into account the image space, and this is what we must navigate
through, in particular for various representations of RGB or HSV.
I.e. that if the active image is in anyRGB, the RGB values shown must
be within anyRGB. Right now, everything is still shown/used as sRGB
(even though it's properly retrieved and transformed to the target
space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
label somewhere.
3. Allow to switch between image and softproof spaces, regarding
out-of-gamut display. I.e. that while RGB/HSV must be shown within
the image space (assuming it's anyRGB), we may want to show
out-of-gamut area (pink areas) within the softproof space. This may
mean adding a checkbox. Or maybe simply taking into account whether
we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
gimp_widget_get_render_space() for display drawing. We don't need any
soft-proofing or black point compensation for any of these widgets so
pure babl is fine. Indeed we want to show any in-gamut color
correctly (and not transformed according to specific intents or
through soft-proofing). We will take care of the proofing case with
out-of-gamut area showing only.
5. In the various drawing functions, we should move to
CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
that it makes sense to be more accurate, especially as we are
essentially showing color gradients in 1 or 2 directions in these
various widgets.
2023-12-12 16:01:17 +08:00
|
|
|
colorsel_wheel_changed (GimpColorWheel *wheel,
|
2008-08-08 23:27:40 +08:00
|
|
|
GimpColorSelector *selector)
|
|
|
|
{
|
app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:
1. Take into account the image space, and this is what we must navigate
through, in particular for various representations of RGB or HSV.
I.e. that if the active image is in anyRGB, the RGB values shown must
be within anyRGB. Right now, everything is still shown/used as sRGB
(even though it's properly retrieved and transformed to the target
space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
label somewhere.
3. Allow to switch between image and softproof spaces, regarding
out-of-gamut display. I.e. that while RGB/HSV must be shown within
the image space (assuming it's anyRGB), we may want to show
out-of-gamut area (pink areas) within the softproof space. This may
mean adding a checkbox. Or maybe simply taking into account whether
we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
gimp_widget_get_render_space() for display drawing. We don't need any
soft-proofing or black point compensation for any of these widgets so
pure babl is fine. Indeed we want to show any in-gamut color
correctly (and not transformed according to specific intents or
through soft-proofing). We will take care of the proofing case with
out-of-gamut area showing only.
5. In the various drawing functions, we should move to
CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
that it makes sense to be more accurate, especially as we are
essentially showing color gradients in 1 or 2 directions in these
various widgets.
2023-12-12 16:01:17 +08:00
|
|
|
GeglColor *color = gegl_color_new (NULL);
|
2024-04-21 05:31:58 +08:00
|
|
|
gfloat hsv[3];
|
2008-08-08 23:27:40 +08:00
|
|
|
|
app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:
1. Take into account the image space, and this is what we must navigate
through, in particular for various representations of RGB or HSV.
I.e. that if the active image is in anyRGB, the RGB values shown must
be within anyRGB. Right now, everything is still shown/used as sRGB
(even though it's properly retrieved and transformed to the target
space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
label somewhere.
3. Allow to switch between image and softproof spaces, regarding
out-of-gamut display. I.e. that while RGB/HSV must be shown within
the image space (assuming it's anyRGB), we may want to show
out-of-gamut area (pink areas) within the softproof space. This may
mean adding a checkbox. Or maybe simply taking into account whether
we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
gimp_widget_get_render_space() for display drawing. We don't need any
soft-proofing or black point compensation for any of these widgets so
pure babl is fine. Indeed we want to show any in-gamut color
correctly (and not transformed according to specific intents or
through soft-proofing). We will take care of the proofing case with
out-of-gamut area showing only.
5. In the various drawing functions, we should move to
CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
that it makes sense to be more accurate, especially as we are
essentially showing color gradients in 1 or 2 directions in these
various widgets.
2023-12-12 16:01:17 +08:00
|
|
|
gimp_color_wheel_get_color (wheel, &hsv[0], &hsv[1], &hsv[2]);
|
2024-04-21 05:31:58 +08:00
|
|
|
gegl_color_set_pixel (color, babl_format_with_space ("HSV float",
|
2023-12-17 13:28:29 +08:00
|
|
|
COLORSEL_WHEEL (selector)->format),
|
|
|
|
hsv);
|
app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:
1. Take into account the image space, and this is what we must navigate
through, in particular for various representations of RGB or HSV.
I.e. that if the active image is in anyRGB, the RGB values shown must
be within anyRGB. Right now, everything is still shown/used as sRGB
(even though it's properly retrieved and transformed to the target
space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
label somewhere.
3. Allow to switch between image and softproof spaces, regarding
out-of-gamut display. I.e. that while RGB/HSV must be shown within
the image space (assuming it's anyRGB), we may want to show
out-of-gamut area (pink areas) within the softproof space. This may
mean adding a checkbox. Or maybe simply taking into account whether
we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
gimp_widget_get_render_space() for display drawing. We don't need any
soft-proofing or black point compensation for any of these widgets so
pure babl is fine. Indeed we want to show any in-gamut color
correctly (and not transformed according to specific intents or
through soft-proofing). We will take care of the proofing case with
out-of-gamut area showing only.
5. In the various drawing functions, we should move to
CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
that it makes sense to be more accurate, especially as we are
essentially showing color gradients in 1 or 2 directions in these
various widgets.
2023-12-12 16:01:17 +08:00
|
|
|
gimp_color_selector_set_color (selector, color);
|
|
|
|
g_object_unref (color);
|
2008-08-08 23:27:40 +08:00
|
|
|
}
|