app, libgimpcolor, plug-ins: move legacy luminance macros to private.

This was bothering me that we were keeping these macros marked as legacy
in our public headers. Now they aren't so we can delete the whole file
when we'll finally get rid of all usage later, without breaking API.
This commit is contained in:
Jehan 2024-11-02 00:09:39 +01:00
parent 0249c1c136
commit da8821169f
16 changed files with 60 additions and 10 deletions

View File

@ -27,6 +27,7 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpcolor/gimpcolor-private.h"
#include "core-types.h"

View File

@ -148,6 +148,7 @@
#include <gegl.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpcolor/gimpcolor-private.h"
#include "libgimpmath/gimpmath.h"
#include "core-types.h"

View File

@ -34,6 +34,7 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpcolor/gimpcolor-private.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"

View File

@ -28,6 +28,7 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpcolor/gimpcolor-private.h"
#include "libgimpmath/gimpmath.h"
#include "libgimpconfig/gimpconfig.h"

View File

@ -25,6 +25,7 @@
#include <gegl.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpcolor/gimpcolor-private.h"
#include "libgimpconfig/gimpconfig.h"
#include "operations-types.h"

View File

@ -26,6 +26,7 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpcolor/gimpcolor-private.h"
#include "libgimpconfig/gimpconfig.h"
#include "operations-types.h"

View File

@ -25,6 +25,7 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpcolor/gimpcolor-private.h"
#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -51,6 +51,7 @@
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpcolor/gimpcolor-private.h"
#include "libgimpmath/gimpmath.h"
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"

View File

@ -0,0 +1,40 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_COLOR_PRIVATE_H__
#define __GIMP_COLOR_PRIVATE_H__
/* Legacy definition to calculate luminance from sRGB.
*
* These values and macro are specific to a "RGB float" to "Y float"
* conversion within sRGB space. These should not be used in new code,
* where converting to "Y float", space aware, may often be what you
* wanted to do.
* Once we got rid of all remaining usages in plug-ins and app, we can
* delete this file as it's not distributed.
*/
#define GIMP_RGB_LUMINANCE_RED (0.22248840)
#define GIMP_RGB_LUMINANCE_GREEN (0.71690369)
#define GIMP_RGB_LUMINANCE_BLUE (0.06060791)
#define GIMP_RGB_LUMINANCE(r,g,b) ((r) * GIMP_RGB_LUMINANCE_RED + \
(g) * GIMP_RGB_LUMINANCE_GREEN + \
(b) * GIMP_RGB_LUMINANCE_BLUE)
#endif /* __GIMP_COLOR_PRIVATE_H__ */

View File

@ -93,16 +93,6 @@ GParamSpec * gimp_param_spec_color_from_string (const gchar *name,
gboolean gimp_param_spec_color_has_alpha (GParamSpec *pspec);
/* Legacy definition to calculate luminance from sRGB */
#define GIMP_RGB_LUMINANCE_RED (0.22248840)
#define GIMP_RGB_LUMINANCE_GREEN (0.71690369)
#define GIMP_RGB_LUMINANCE_BLUE (0.06060791)
#define GIMP_RGB_LUMINANCE(r,g,b) ((r) * GIMP_RGB_LUMINANCE_RED + \
(g) * GIMP_RGB_LUMINANCE_GREEN + \
(b) * GIMP_RGB_LUMINANCE_BLUE)
/*
* GIMP_TYPE_BABL_FORMAT

View File

@ -24,6 +24,8 @@
#include <stdlib.h>
#include "libgimpcolor/gimpcolor-private.h"
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>

View File

@ -31,6 +31,8 @@
#include <aalib.h>
#include "libgimpcolor/gimpcolor-private.h"
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>

View File

@ -33,6 +33,8 @@
#include <math.h>
#include <errno.h>
#include "libgimpcolor/gimpcolor-private.h"
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>

View File

@ -56,6 +56,8 @@
#include <glib/gstdio.h>
#include "libgimpcolor/gimpcolor-private.h"
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>

View File

@ -21,6 +21,8 @@
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor-private.h"
#include <libgimp/gimp.h>
#include "ppmtool.h"

View File

@ -44,6 +44,8 @@
#include <glib-object.h>
#include "libgimpcolor/gimpcolor-private.h"
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>