Commit Graph

51 Commits

Author SHA1 Message Date
Alx Sa c1f6a8f217 libgimpcolor: Remove unneeded GimpRGB functions
As the Van Gogh LIC plug-in was the last
area of the code that used gimp_rgba_add ()
and gimp_rgba_multiply (), they can be
removed.
2024-09-08 23:32:54 +00:00
Alx Sa b44687eb2f libgimpcolor, plugin: Remove gimp_rgb_luminance ()
This patch removes the two instances of
gimp_rgb_luminance_uchar () and one
instance of gimp_rgb_luminance () from
the codebase.
* plug-ins/common/checkerboard.c:
 Use gegl_color_get_pixel () to get the
 luminance value at the same time we're
 getting the RGBA value from the GeglColor.
 * plug-ins/gradient-flare/gradient-flare.c:
 Replace with GIMP_RGB_LUMINANCE ()
 macro, which does not use GimpRGB.
2024-09-02 02:41:47 +00:00
Jehan 0d39458d8d libgimpcolor: remove all gimp_rgb_*() utilities not in use anymore. 2024-04-19 23:58:18 +02:00
Jehan a50759cda8 app, libgimp*, pdb, plug-ins: remove GimpRGB support in GIMP protocol.
There are no plug-ins which uses GimpRGB for procedure argument, nor is there
any base PDB procedure. We don't pass this type anymore through from/to
core/plug-ins. So let's clean the whole code out as a next step to get rid of
GimpRGB from our codebase!
2024-04-19 14:34:22 +02:00
Jehan 49e534247a app, libgimp*, pdb, plug-ins: use g_memdup2() instead of g_memdup()
Since it appeared with GLib 2.68.0, we could not change this until we
bumped the dependency which has only become possible a few days ago
(since Debian testing is our baseline for dependency bumps). Cf.
previous commit.

As this is a drop-in replacement (just a guint parameter changed to
gsize to avoid integer overflow), search-and-replace with:

> sed -i 's/g_memdup\>/g_memdup2/g' `grep -rIl 'g_memdup\>' *`

… followed by a few manual alignment tweaks when necessary.

This gets rid of the many deprecation warnings which we had lately when
building with a recent GLib version.
2021-08-26 17:32:09 +02:00
Niels De Graef c2d4e7d265 gir: Fix some missing (out) annotations 2020-05-18 13:26:23 +02:00
Niels De Graef 7f58f2d6e5 gir: Add more missing (array) and (out) annotations 2020-05-04 21:29:42 +02:00
Niels De Graef 89f692cd73 libgimpcolor: Use G_DEFINE_BOXED_TYPE()
This isn't any functional change, but allows us to get rid of some of
the GObject boilerplate.
2019-11-05 10:14:29 +00:00
Michael Natterer e6d662e352 libgimp*: various doc fixes 2019-08-10 12:32:25 +02:00
Niels De Graef 1dda60154c Use "Returns:" to annotate return values
To be able to annotate return values through GObject-introspection, you
need to make sure it is tagged with `Returns:` and not something else.
2019-08-03 07:53:47 +00:00
Michael Natterer c12c031f2d pdb, libgimp*: add (out caller-allocates) to all GimpRGB* return values 2019-08-01 15:39:13 +02:00
Michael Natterer bbf4270437 libgimpcolor: fix "Since:" on gimp_param_spec_rgb_get_default() 2019-08-01 12:49:56 +02:00
Jehan 8c978f4301 libgimpcolor: some more (transfer) annotations. 2019-07-31 23:55:07 +02:00
Michael Natterer 3597e92a20 libgimpcolor: add gimp_param_spec_rgb_get_default() 2019-07-27 16:10:24 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 1ed586f0f1 libgimpcolor: remove most deprecated cruft, rest to follow 2018-05-20 21:06:29 +02:00
Michael Natterer ff44cb59d3 libgimpcolor: disable gimp_rgb_clamp() in GimpParamSpecRGB
so from now on all GimpRGB object properties will allow unbounded
sRGB, let's see what happens.
2017-05-16 22:39:55 +02:00
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00
Michael Natterer 8005eea835 Remove the "GIMP" from all "Since: GIMP 2.x" API doc comments
because it confuses gtk-doc and breaks some links. Also change the
"Index of new symbols in GIMP 2.x" sections to be what seems to be the
modern standard (looked at the GLib and GTK+ docs), and update some
other stuff.
2015-05-31 21:18:09 +02:00
Michael Natterer f1c46b3656 libgimpcolor: fix API docs of gimp_rgb[a]_get,set_pixel() 2015-05-31 02:33:38 +02:00
Michael Natterer 0d481702c7 libgimp*: add GIMP_DEPRECATED macros using G_DEPRECATED
and start using them instead of GIMP_DISABLE_DEPRECATED where possible.
2012-05-03 00:54:21 +02:00
Michael Natterer 3e119c5af7 libgimpcolor: add gimp_rgb[a]_set,get_pixel()
which converts from/to any pixel format using Babl. Added tons of
includes and CFLAGS now that libgimpcolor publically uses Babl.
2012-05-02 17:50:43 +02:00
Michael Natterer 7b335188b6 libgimpcolor: fix most gtk-doc warnings 2010-06-29 20:08:39 +02:00
Michael Natterer 1649241483 libgimpcolor: move docs from template files to inline comments
Only added section headers for now, there was nothing else in the
template files.
2010-06-29 19:46:37 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Sven Neumann de7d46d6e2 plugged tiny memory leak.
2007-07-17  Sven Neumann  <sven@gimp.org>

	* app/plug-in/gimppluginprocedure.c
	(gimp_plug_in_procedure_set_file_proc): plugged tiny memory 
leak.

	* libgimpcolor/gimprgb.c (gimp_rgb_min) (gimp_rgb_max): 
formatting.


svn path=/trunk/; revision=22940
2007-07-17 07:22:20 +00:00
Michael Natterer f8240964af fully initialize all bytes of "int1" and "int2" so we don't produce wrong
2007-05-26  Michael Natterer  <mitch@gimp.org>

	* libgimpcolor/gimprgb.c (gimp_param_rgb_values_cmp): fully
	initialize all bytes of "int1" and "int2" so we don't produce
	wrong color compare results (and shut up valgrind).
	Fixes bug #353696.


svn path=/trunk/; revision=22627
2007-05-26 15:41:53 +00:00
Sven Neumann 64e893e62f there's no need to make GTypeInfo and GInterfaceInfo structs static.
2006-10-18  Sven Neumann  <sven@gimp.org>

        * [lots of files]: there's no need to make GTypeInfo and
        GInterfaceInfo structs static.
2006-10-18 13:17:50 +00:00
Sven Neumann 5d45aed020 minor update for the API reference 2006-08-09 15:44:40 +00:00
Sven Neumann 0b9a9e4e88 hide the GimpParamSpecRGB struct again. Added getter for the has_alpha
2006-04-27  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimprgb.[ch]: hide the GimpParamSpecRGB struct
	again.  Added getter for the has_alpha field.

	* libgimpcolor/gimpcolor.def: updated.

	* app/config/gimpconfig-dump.c
	* libgimpconfig/gimpconfig-serialize.c: use
	gimp_param_spec_rgb_has_alpha() instead of accessing the
	GimpParamSpecRGB struct directly.
2006-04-27 16:01:16 +00:00
Sven Neumann e779cf0b0f added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct
2006-04-27  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimprgb.[ch]: added "has_alpha" to GimpParamSpecRGB.
	Made the GimpParamSpecRGB struct public. When validating a color,
	only look at the alpha channel if has_alpha is set.

	* libgimpconfig/gimpconfig-params.h: added "has_alpha" to
	GIMP_CONFIG_INSTALL_PROP_RGB macro definition.

	* libgimpconfig/gimpconfig-serialize.c: serialize color values as
	"(rgb r g b)" if the param-spec indicates that the alpha channel
	is meaningless.

	* app/config/gimpconfig-dump.c: take "has_alpha" into account when
	documenting color properties.

	* app/core/gimpcontext.c
	* app/core/gimpgrid.c
	* app/display/gimpdisplayoptions.c
	* app/text/gimptext.c
	* app/widgets/gimpaction.c
	* app/widgets/gimpcolorbar.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorbutton.c: specify whether color properties
	have an alpha channel.

	* tools/pdbgen/app.pl: handle "has_alpha" for color paramaters.

	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/context.pdb
	* tools/pdbgen/pdb/grid.pdb
	* tools/pdbgen/pdb/image.pdb: set the "has_alpha" flag where
	appropriate.

	* app/pdb/gimp-pdb-compat.c (gimp_pdb_compat_param_spec): set
	"has_alpha" to TRUE for GIMP_PDB_COLOR.

	* app/pdb/channel_cmds.c
	* app/pdb/context_cmds.c
	* app/pdb/gradient_cmds.c
	* app/pdb/grid_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/palette_cmds.c
	* app/pdb/palettes_cmds.c
	* app/pdb/selection_tools_cmds.c: regenerated.

	* app/config/gimpdisplayconfig.c (gimp_display_config_class_init):
	removed unused code.
2006-04-27 15:19:59 +00:00
Sven Neumann f2df31a50e converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* libgimp*/gimp*.[ch]: converted tabs to spaces.
2006-04-12 10:53:28 +00:00
Michael Natterer 8a856045f9 removed GIMP_TYPE_PARASITE, GIMP_TYPE_PARAM_PARASITE and the GimpRGB
2006-04-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpparamspecs.[ch]: removed GIMP_TYPE_PARASITE,
	GIMP_TYPE_PARAM_PARASITE and the GimpRGB utility functions. Some
	fixes/cleanup in the new array and string array code.

	* libgimpbase/gimpbase.def
	* libgimpbase/gimpparasite.[ch]
	* libgimpcolor/gimpcolor.def
	* libgimpcolor/gimprgb.[ch]: added the parasite and rgb stuff here.

	* app/pdb/gimpargument.c: #include "libgimpbase/gimpbase.h"

	* app/pdb/procedural_db.c: removed unused variable.
2006-04-02 09:39:46 +00:00
Michael Natterer 0cb9d1f887 remove trailing whitespace 2006-03-27 09:55:44 +00:00
Michael Natterer dd97fe409a default to fully opaque black instead of fully transparent.
2006-03-27  Michael Natterer  <mitch@gimp.org>

	* libgimpcolor/gimprgb.c (gimp_param_rgb_init): default to fully
	opaque black instead of fully transparent.

	(gimp_param_spec_rgb): allow a NULL default value. Simply use the
	opaque black set in init().
2006-03-27 09:47:40 +00:00
Sven Neumann 4f870bc132 deprecated RGB intensity functions and definitions. These coefficients do
2005-08-03  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimprgb.[ch]: deprecated RGB intensity functions
	and definitions. These coefficients do not accurately compute
	luminance for contemporary monitors. Instead the coefficients from
	the sRGB spec should be used which have now been added.

	* libgimpcolor/gimpcolor.def: updated.

	* libgimp/gimpdrawable.c
	* libgimp/gimppixelfetcher.c
	* app/base/colorize.c
	* app/base/levels.c
	* app/base/temp-buf.c
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable-convert.c
	* app/core/gimpdrawable-desaturate.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage.c
	* app/gui/splash.c
	* app/widgets/gimpgradienteditor.c
	* modules/colorsel_triangle.c
	* plug-ins/common/aa.c
	* plug-ins/common/bumpmap.c
	* plug-ins/common/colorify.c
	* plug-ins/common/despeckle.c
	* plug-ins/common/displace.c
	* plug-ins/common/engrave.c
	* plug-ins/common/gradmap.c
	* plug-ins/common/grid.c
	* plug-ins/common/mng.c
	* plug-ins/common/newsprint.c
	* plug-ins/common/png.c
	* plug-ins/common/whirlpinch.c
	* plug-ins/gflare/gflare.c
	* plug-ins/gfli/gfli.c
	* plug-ins/maze/handy.c
	* plug-ins/pagecurl/pagecurl.c: use gimp_rgb_luminance() and
	friends instead of the deprecated intensity functions.
2005-08-03 00:36:41 +00:00
William Skaggs 36f062d1a0 broken pipe on previous commit, finishing 2005-01-22 00:43:31 +00:00
Sven Neumann cace0a19a0 app/actions/qmask-commands.c just some cleanup.
2004-09-18  Sven Neumann  <sven@gimp.org>

	* app/actions/qmask-commands.c
	* libgimpcolor/gimprgb.c (gimp_rgba_distance): just some cleanup.

	* app/core/gimpimage-qmask.c (gimp_image_set_qmask_color): always
	set gimage->qmask_color regardless of the qmask state.

	* libgimpwidgets/gimpcolorbutton.c (gimp_color_button_new): set
	the type before setting the color.
2004-09-17 22:16:21 +00:00
Sven Neumann c03a5b837e register GimpRGB as a boxed type.
2004-07-26  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimprgb.[ch]: register GimpRGB as a boxed type.

	* libgimpcolor/gimpadaptivesupersample.c
	* libgimpcolor/gimpcolorspace.c
	* libgimpcolor/gimprgb-parse.c
	* libgimp/gimp.h: include <glib-object.h> instead of <glib.h>.
2004-07-26 18:14:48 +00:00
Sven Neumann a14bddae8a libgimpcolor/Makefile.am libgimpcolor/gimprgb-parse.c added more RGB
2004-07-22  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/Makefile.am
	* libgimpcolor/gimprgb-parse.c
	* libgimpcolor/gimprgb.[ch]: added more RGB parsers and moved the
	code to a dedicated file.

	* libgimpcolor/gimpcolor.def: added new symbols.

	* libgimpwidgets/gimpcolorscales.c: use gimp_rgb_parse_hex().
2004-07-22 17:26:22 +00:00
Sven Neumann fd36a39850 fixed gtk-doc comments and updated API docs 2004-07-22 13:21:44 +00:00
Sven Neumann b50ea15b26 rephrased the text for the dialog that appears if a new shortcut collides
2004-07-22  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpactionview.c: rephrased the text for the dialog
	that appears if a new shortcut collides with an existing one.

	* libgimpcolor/gimprgb.[ch]: added new function gimp_rgb_parse_name()
	which accepts RGB colors in hexadezimal notation or as SVG color
	keywords.
2004-07-22 12:42:57 +00:00
Sven Neumann e4c5b6b0ca added a GIMP_RGB prefix to the INTENSITY macros.
2003-11-17  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimprgb.[ch]: added a GIMP_RGB prefix to the
	INTENSITY macros.

	* libgimp/gimpcompat.h: document this change here.

	* app/base/colorize.c
	* app/base/temp-buf.c
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage.c
	* plug-ins/common/aa.c
	* plug-ins/common/bumpmap.c
	* plug-ins/common/colorify.c
	* plug-ins/common/displace.c
	* plug-ins/common/engrave.c
	* plug-ins/common/gradmap.c
	* plug-ins/common/newsprint.c
	* plug-ins/common/oilify.c
	* plug-ins/gflare/gflare.c
	* plug-ins/gfli/gfli.c
	* plug-ins/pagecurl/pagecurl.c: changed accordingly.

	* libgimpcolor/gimpcolor.h: removed trailing whitespace.

	* app/paint-funcs/paint-funcs.c: fixed indentation.
2003-11-17 14:58:31 +00:00
Sven Neumann f357b2cde0 libgimpcolor/Makefile.am libgimpcolor/makefile.msc new files that define a
2003-07-14  Sven Neumann  <sven@gimp.org>

        * libgimpcolor/Makefile.am
        * libgimpcolor/makefile.msc
        * libgimpcolor/gimpcmyk.[ch]: new files that define a GimpCMYK
        structure similar to GimpRGB.

        * libgimpcolor/gimpcolortypes.h: added the GimpCMYK typedef.

        * libgimpcolor/gimpcolorspace.[ch]: added conversions between RGB
        and CMYK. This implementation is the naive approach without any
        color calibration whatsoever.

        * libgimpcolor/gimphsv.[ch]
        * libgimpcolor/gimprgb.[ch]: purely cosmetic changes.
2003-07-14 20:15:43 +00:00
Sven Neumann aa4448db64 app/gui/info-window.c libgimpcolor/gimpcolorspace.c libgimpcolor/gimprgb.c
2003-06-13  Sven Neumann  <sven@gimp.org>

	* app/gui/info-window.c
	* libgimpcolor/gimpcolorspace.c
	* libgimpcolor/gimprgb.c
	* libgimpwidgets/gimpcolorscales.c
	* libgimpwidgets/gimpcolorselect.c: use ROUND() where appropriate.

	* libgimpwidgets/gimpcolorarea.c (gimp_color_area_render): use
	gimp_rgb_get_uchar().
2003-06-13 16:44:21 +00:00
Sven Neumann 08879c9f90 app/gui/info-window.c libgimpwidgets/gimpcolorscales.c applied some
2003-06-11  Sven Neumann  <sven@gimp.org>

	* app/gui/info-window.c
	* libgimpwidgets/gimpcolorscales.c
	* libgimpwidgets/gimpcolorselect.c: applied some slightly modified
	patches from Michael Bushey that fix rounding errors when
	converting between color values in gdouble and guchar
	representation (bug #109241).

	* libgimpcolor/gimpcolorspace.c
	* libgimpcolor/gimprgb.c: similar fixes here.
2003-06-11 15:55:48 +00:00
Sven Neumann 62052c0c62 fixed gimp_rgb_intensity_uchar() which used to return 0 or 1 instead of 0
2003-02-27  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimprgb.c: fixed gimp_rgb_intensity_uchar() which
	used to return 0 or 1 instead of 0 to 255. Fixes bug #107202.
2003-02-27 20:12:52 +00:00
Maurits Rijk c4a5cb39a4 Added mnemonics (#80804) to lic plug-in. Started code clean-up. Next time (hopefully) major speed improvements. 2002-06-23 13:08:21 +00:00
Sven Neumann 5439fe5b01 app/tools/airbrush.c app/tools/by_color_select.c include
2001-01-24  Sven Neumann  <sven@gimp.org>

	* app/tools/airbrush.c
	* app/tools/by_color_select.c
	* app/tools/color_picker.c: include gimpcolor/gimpcolor.h

	* libgimpcolor/gimprgb.c: optimized compositing functions.

	* plug-ins/Lighting/lighting_preview.c
	* plug-ins/MapObject/mapobject_preview.c: use gimp_rgb_composite
	functions instead of doing the blending manually

	* plug-ins/MapObject/map_object_shade.c: fixed a rendering bug when
	transparent_background == FALSE
2001-01-24 12:21:50 +00:00
Michael Natterer cb16697229 Makefile.am configure.in added stuff for the new library below.
2001-01-24  Michael Natterer  <mitch@gimp.org>

	* Makefile.am
	* configure.in
	* gimptool.in: added stuff for the new library below.

	* libgimpmath/.cvsignore
	* libgimpmath/Makefile.am
	* libgimpmath/gimpmath.def
	* libgimpmath/gimpmath.h
	* libgimpmath/gimpmathtypes.h
	* libgimpmath/gimpmatrix.c
	* libgimpmath/gimpmatrix.h
	* libgimpmath/gimpvector.c
	* libgimpmath/gimpvector.h
	* libgimpmath/makefile.mingw.in
	* libgimpmath/makefile.msc: new shared library. Depends on glib only.

	* libgimp/Makefile.am
	* libgimp/gimp.def
	* libgimp/gimp.h: removed the math stuff.

	* libgimp/gimpmath.h
	* libgimp/gimpmatrix.[ch]
	* libgimp/gimpvector.[ch]: removed.

	* app/Makefile.am
	* plug-ins/Lighting/Makefile.am
	* plug-ins/MapObject/Makefile.am
	* plug-ins/pagecurl/Makefile.am: link against libgimpmath.la

	* app/[many files]
	* libgimpcolor/gimpcolorspace.c
	* libgimpcolor/gimprgb.c
	* libgimp/gimpadaptivesupersample.c
	* libgimp/gimpbilinear.c
	* libgimp/gimpwidgets.c
	* modules/colorsel_gtk.c
	* modules/colorsel_triangle.c
	* modules/colorsel_water.c
	* plug-ins/libgck/gck/gckcolor.c
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/image.pdb: include "libgimpmath/gimpmath.h",
	removed the remaining includes of the old color stuff.
2001-01-23 23:56:18 +00:00