diff --git a/libgimpcolor/gimpcolor.def b/libgimpcolor/gimpcolor.def index af00162153..aa85f82420 100644 --- a/libgimpcolor/gimpcolor.def +++ b/libgimpcolor/gimpcolor.def @@ -91,9 +91,6 @@ EXPORTS gimp_rgb_add gimp_rgb_clamp gimp_rgb_composite - gimp_rgb_distance - gimp_rgb_gamma - gimp_rgb_get_pixel gimp_rgb_get_type gimp_rgb_get_uchar gimp_rgb_list_names @@ -107,19 +104,14 @@ EXPORTS gimp_rgb_parse_name gimp_rgb_set gimp_rgb_set_alpha - gimp_rgb_set_pixel gimp_rgb_set_uchar - gimp_rgb_subtract gimp_rgb_to_cmyk gimp_rgb_to_hsl gimp_rgb_to_hsv gimp_rgba_add gimp_rgba_distance - gimp_rgba_get_pixel gimp_rgba_get_uchar gimp_rgba_multiply gimp_rgba_parse_css gimp_rgba_set - gimp_rgba_set_pixel gimp_rgba_set_uchar - gimp_rgba_subtract diff --git a/libgimpcolor/gimprgb.c b/libgimpcolor/gimprgb.c index 8f7e786c7d..abe8b6e2af 100644 --- a/libgimpcolor/gimprgb.c +++ b/libgimpcolor/gimprgb.c @@ -95,58 +95,6 @@ gimp_rgb_set_alpha (GimpRGB *rgb, rgb->a = a; } -/** - * gimp_rgb_set_pixel: - * @rgb: a #GimpRGB struct - * @format: a Babl format - * @pixel: pointer to the source pixel - * - * Sets the red, green and blue components of @rgb from the color - * stored in @pixel. The pixel format of @pixel is determined by - * @format. - * - * Since: 2.10 - **/ -void -gimp_rgb_set_pixel (GimpRGB *rgb, - const Babl *format, - gconstpointer pixel) -{ - g_return_if_fail (rgb != NULL); - g_return_if_fail (format != NULL); - g_return_if_fail (pixel != NULL); - - babl_process (babl_fish (format, - babl_format ("R'G'B' double")), - pixel, rgb, 1); -} - -/** - * gimp_rgb_get_pixel: - * @rgb: a #GimpRGB struct - * @format: a Babl format - * @pixel: (out caller-allocates): pointer to the destination pixel - * - * Writes the red, green, blue and alpha components of @rgb to the - * color stored in @pixel. The pixel format of @pixel is determined by - * @format. - * - * Since: 2.10 - **/ -void -gimp_rgb_get_pixel (const GimpRGB *rgb, - const Babl *format, - gpointer pixel) -{ - g_return_if_fail (rgb != NULL); - g_return_if_fail (format != NULL); - g_return_if_fail (pixel != NULL); - - babl_process (babl_fish (babl_format ("R'G'B' double"), - format), - rgb, pixel, 1); -} - /** * gimp_rgb_set_uchar: * @rgb: a #GimpRGB struct @@ -205,18 +153,6 @@ gimp_rgb_add (GimpRGB *rgb1, rgb1->b += rgb2->b; } -void -gimp_rgb_subtract (GimpRGB *rgb1, - const GimpRGB *rgb2) -{ - g_return_if_fail (rgb1 != NULL); - g_return_if_fail (rgb2 != NULL); - - rgb1->r -= rgb2->r; - rgb1->g -= rgb2->g; - rgb1->b -= rgb2->b; -} - void gimp_rgb_multiply (GimpRGB *rgb, gdouble factor) @@ -228,18 +164,6 @@ gimp_rgb_multiply (GimpRGB *rgb, rgb->b *= factor; } -gdouble -gimp_rgb_distance (const GimpRGB *rgb1, - const GimpRGB *rgb2) -{ - g_return_val_if_fail (rgb1 != NULL, 0.0); - g_return_val_if_fail (rgb2 != NULL, 0.0); - - return (fabs (rgb1->r - rgb2->r) + - fabs (rgb1->g - rgb2->g) + - fabs (rgb1->b - rgb2->b)); -} - gdouble gimp_rgb_max (const GimpRGB *rgb) { @@ -273,24 +197,6 @@ gimp_rgb_clamp (GimpRGB *rgb) rgb->a = CLAMP (rgb->a, 0.0, 1.0); } -void -gimp_rgb_gamma (GimpRGB *rgb, - gdouble gamma) -{ - gdouble ig; - - g_return_if_fail (rgb != NULL); - - if (gamma != 0.0) - ig = 1.0 / gamma; - else - ig = 0.0; - - rgb->r = pow (rgb->r, ig); - rgb->g = pow (rgb->g, ig); - rgb->b = pow (rgb->b, ig); -} - /** * gimp_rgb_luminance: * @rgb: a #GimpRGB struct @@ -374,58 +280,6 @@ gimp_rgb_composite (GimpRGB *color1, /* RGBA functions */ -/** - * gimp_rgba_set_pixel: - * @rgba: a #GimpRGB struct - * @format: a Babl format - * @pixel: pointer to the source pixel - * - * Sets the red, green, blue and alpha components of @rgba from the - * color stored in @pixel. The pixel format of @pixel is determined - * by @format. - * - * Since: 2.10 - **/ -void -gimp_rgba_set_pixel (GimpRGB *rgba, - const Babl *format, - gconstpointer pixel) -{ - g_return_if_fail (rgba != NULL); - g_return_if_fail (format != NULL); - g_return_if_fail (pixel != NULL); - - babl_process (babl_fish (format, - babl_format ("R'G'B'A double")), - pixel, rgba, 1); -} - -/** - * gimp_rgba_get_pixel: - * @rgba: a #GimpRGB struct - * @format: a Babl format - * @pixel: (out caller-allocates): pointer to the destination pixel - * - * Writes the red, green, blue and alpha components of @rgba to the - * color stored in @pixel. The pixel format of @pixel is determined by - * @format. - * - * Since: 2.10 - **/ -void -gimp_rgba_get_pixel (const GimpRGB *rgba, - const Babl *format, - gpointer pixel) -{ - g_return_if_fail (rgba != NULL); - g_return_if_fail (format != NULL); - g_return_if_fail (pixel != NULL); - - babl_process (babl_fish (babl_format ("R'G'B'A double"), - format), - rgba, pixel, 1); -} - /** * gimp_rgba_set: * @rgba: a #GimpRGB struct @@ -517,19 +371,6 @@ gimp_rgba_add (GimpRGB *rgba1, rgba1->a += rgba2->a; } -void -gimp_rgba_subtract (GimpRGB *rgba1, - const GimpRGB *rgba2) -{ - g_return_if_fail (rgba1 != NULL); - g_return_if_fail (rgba2 != NULL); - - rgba1->r -= rgba2->r; - rgba1->g -= rgba2->g; - rgba1->b -= rgba2->b; - rgba1->a -= rgba2->a; -} - void gimp_rgba_multiply (GimpRGB *rgba, gdouble factor) diff --git a/libgimpcolor/gimprgb.h b/libgimpcolor/gimprgb.h index 07bf3cc40f..e0128d4e7b 100644 --- a/libgimpcolor/gimprgb.h +++ b/libgimpcolor/gimprgb.h @@ -60,13 +60,6 @@ void gimp_rgb_set (GimpRGB *rgb, void gimp_rgb_set_alpha (GimpRGB *rgb, gdouble alpha); -void gimp_rgb_set_pixel (GimpRGB *rgb, - const Babl *format, - gconstpointer pixel); -void gimp_rgb_get_pixel (const GimpRGB *rgb, - const Babl *format, - gpointer pixel); - void gimp_rgb_set_uchar (GimpRGB *rgb, guchar red, guchar green, @@ -88,20 +81,13 @@ gboolean gimp_rgb_parse_css (GimpRGB *rgb, void gimp_rgb_add (GimpRGB *rgb1, const GimpRGB *rgb2); -void gimp_rgb_subtract (GimpRGB *rgb1, - const GimpRGB *rgb2); void gimp_rgb_multiply (GimpRGB *rgb1, gdouble factor); -gdouble gimp_rgb_distance (const GimpRGB *rgb1, - const GimpRGB *rgb2); gdouble gimp_rgb_max (const GimpRGB *rgb); gdouble gimp_rgb_min (const GimpRGB *rgb); void gimp_rgb_clamp (GimpRGB *rgb); -void gimp_rgb_gamma (GimpRGB *rgb, - gdouble gamma); - gdouble gimp_rgb_luminance (const GimpRGB *rgb); guchar gimp_rgb_luminance_uchar (const GimpRGB *rgb); @@ -121,13 +107,6 @@ void gimp_rgba_set (GimpRGB *rgba, gdouble blue, gdouble alpha); -void gimp_rgba_set_pixel (GimpRGB *rgba, - const Babl *format, - gconstpointer pixel); -void gimp_rgba_get_pixel (const GimpRGB *rgba, - const Babl *format, - gpointer pixel); - void gimp_rgba_set_uchar (GimpRGB *rgba, guchar red, guchar green, @@ -145,8 +124,6 @@ gboolean gimp_rgba_parse_css (GimpRGB *rgba, void gimp_rgba_add (GimpRGB *rgba1, const GimpRGB *rgba2); -void gimp_rgba_subtract (GimpRGB *rgba1, - const GimpRGB *rgba2); void gimp_rgba_multiply (GimpRGB *rgba, gdouble factor);