Commit Graph

59 Commits

Author SHA1 Message Date
Michael Natterer d092ee9102 libgimpcolor: add a new gimp_color_profile_get_format()
which takes a GimpColorProfile and a Babl format, and returns a new
format which uses the profile's RGB primaries and TRC, and the
original format's pixel layout; or NULL if babl couldn't create a
space from the profile's ICC data.
2017-09-02 20:31:11 +02:00
Michael Natterer c63d812be8 libgimpcolor: rename gimp_color_profile_get_format() to _get_lcms_format() 2017-09-02 18:47:04 +02:00
Michael Natterer ca349f88cd libgimpcolor: add gimp_color_transform_can_gegl_copy()
Which takes two profiles and returns TRUE if converting between
them works correctly without a GimpColorTransform. Use it in
gimp_color_transform_new() to return a NULL transform if none
is needed. Took the code from gimp-gegl-loops.c.
2016-05-26 23:14:57 +02:00
Michael Natterer cc92887908 libgimpcolor: add new object GimpColorTransform
which encapsulates a cmsHTRANSFORM and does all the pixel format
conversion magic. It has API to create transforms and proofing
transforms, and to convert pixels arrays and GeglBuffers.

Before, each place which has a transform had to keep around the
transform and its input and output Babl formats, and had to implement
lots of stuff itself. Now all that lives in GimpColorTransform,
removing lots of logic from many places, and pretty much removing lcms
from the public API entirely.

This removes including <lcms2.h>, LCMS_LIBS and LCMS_CFLAGS from
almost all directories and potentially allows to replace lcms by
something else.
2016-05-26 22:15:54 +02:00
Michael Natterer 46096a17e3 libgimpcolor: add gimp_color_profile_save_to_file() 2016-05-04 20:40:04 +02:00
Elle Stone db400d558a Make grayscale profile with LAB companding curve TRC 2016-04-21 05:05:00 -04:00
Michael Natterer f34aa5fa6b Bug 756389 - Color-managing grayscale images
Rename profile constructors to say "d65_gray" instead of just "gray",
"srgb_trc" instead of "srgb_gamma", and drop the "srgb" from
"srgb_linear" because we now say "d65". This should be a naming scheme
that doesn't conflict with whatever future functions we might add.
2016-04-09 18:47:51 +02:00
Michael Natterer 5e805c8b8b libgimpcolor: update gimpcolor.def 2015-12-15 20:49:46 +01:00
Michael Natterer 11e8cacf7e Bug 756389 - Color-managing grayscale images
Support creating linear/sRGB-gamma variants of gray profiles and
rename gimp_color_profile_new_linear_rgb_from_color_profile() to
gimp_color_profile_new_linear_gamma_from_color_profile() because it's
not RGB-specific any longer.
2015-12-13 23:36:31 +01:00
Michael Natterer b54a8d1939 Bug 756389 - Color-managing grayscale images
Add gimp_color_profile_new_srgb_gray() and
gimp_color_profile_new_linear_gray().

I know "srgb_gray" sounds odd but it's better than
"gray_with_srgb_trc"...

Please review, I have no clue if that code is right.
2015-12-13 19:43:02 +01:00
Michael Natterer 4780471c5f libgimpcolor: add gimp_color_profile_is_gray()
and improve gimp_color_profile_is_linear() to return TRUE for linear
gray matrix profiles.
2015-12-13 14:33:51 +01:00
Michael Natterer 0cf597d042 libgimpcolor: clean up gimp_color_profile_is_linear(), add it to gimpcolor.def 2015-11-23 01:29:17 +01:00
Michael Natterer 6eb9f9d4aa libgimpcolor: add API to create profile variants with linear/sRGB gamma
and the original profile's RGB chromacities and whitepoint.
2015-10-20 20:13:40 +02:00
Michael Natterer 9fc64e3664 Bug 492048 - Detect color space in Exif 2.21/DCF 2.0 option files
Add gimp_color_profile_new_adobe_rgb(), will need this later to fix
this bug.
2015-08-19 23:10:56 +02:00
Michael Natterer 46465b0c0a libgimpcolor: add gimp_color_profile_get_type to gimpcolor.def 2015-07-12 14:22:17 +02:00
Michael Natterer c102dde92b libgimpcolor, *: change GimpColorProfile to be a GObject
it used to be a typedef to gpointer and actually was a cmsHPROFILE.

Change its API to be more "standard", remove the public close()
function. The object caches both the cmsHPROFILE and the data/length
ICC blob, so conversions between the two become obsolete (simply call
get_lcms_profile() or get_icc_profile()).

Adapt everything to the new API, but port it in a naive way for now,
the code doesn't take advantage of the new possibilities yet (like
refcounting).
2015-07-10 22:53:59 +02:00
Michael Natterer 4422128ecc libgimpcolor: add gimp_pixbuf_get_icc_profile()
which decodes and returns the pixbuf's base64-encoded "icc-profile"
property.
2015-06-16 23:43:40 +02:00
Michael Natterer 4910c28957 libgimpcolor: rename the gimp_lcms_*() functions to gimp_color_profile_*()
because it doesn't make sense to call the typedef GimpColorProfile
but the function namespace gimp_lcms_*().
2015-06-03 09:41:23 +02:00
Michael Natterer cdb3b0aabb libgimpcolor: add GimpColorManaged::get_color_profile()
which returns a GimpColorProfile instead of just an ICC blob like
get_icc_profile(). Also, it will always return a profile, as in
fall back to the built-in profiles automatically.
2015-05-13 00:43:16 +02:00
Michael Natterer ff337409c1 libgimpcolor: add gimp_lcms_add_linear_rgb_profile()
taken from gegl:lcms-from-profile.
2015-05-12 22:47:12 +02:00
Michael Natterer e663c947a0 libgimpcolor: add gimp_lcms_get_format()
Which returns an lcms format given a Babl format. It also returns a
Babl format to be used instead of the passed format, but only if lcms
doesn't support the passed format.
2015-05-08 12:52:22 +02:00
Michael Natterer dcf21efcc2 libgimpcolor: add gimp_lcms_profile_close()
So code that only needs a profile's metadata doesn't need to depend on
lcms2 any longer.
2015-05-06 16:28:45 +02:00
Michael Natterer ba85bb78ba Bug 727185 - Converting to GIMP built-in sRGB produces the wrong RGB values
Profiles from disk have a lower precision than those created from
scratch via lcms API. Ensure identical profiles by returning a
"loaded" profile from gimp_lcms_create_srgb_profile() (simply do a
save/load roundtrip in memory).
2014-04-10 16:30:04 +02:00
Michael Natterer d7037650df libgimpcolor: add gimp_lcms_profile_get_label()
which returns a string meant to label the profile in the GUI, it's
either the profile's description, its model, or "(unnamed profile)" as
a fallback. Use the function instead of duplicating that logic
inconsistently and imcompletely all over the place.
2014-03-30 03:12:42 +02:00
Michael Natterer 32e47cf70d libgimpcolor: add gimp_lcms_profile_is_equal()
and remove all of our own MD5 digest code and API. is_equal() uses
lcms' own MD5 API which I missed before. Thanks Elle for pointing that
out :)
2014-03-29 10:40:47 +01:00
Michael Natterer f322be2fac libgimpcolor: add gimp_lcms_profile_open_from_file() and _from_data()
which work just like their lcms counterparts but return an optional
md5 digest of the ICC data and a GError in case opening fails.
2014-03-16 15:57:14 +01:00
Michael Natterer ebc53672cb libgimpcolor: add gimp_lcms_profile_is_rgb() and _is_cmyk()
And change all lcms code to use it.
2014-03-15 21:47:13 +01:00
Michael Natterer 6f62d6b11b libgimpcolor: add gimp_lcms_profile_get_summary()
Which returns an "executive summary" of the profile, much like lcms1's
"profile info" API. Refactor common code out of the other string
getters.
2014-03-14 20:26:15 +01:00
Michael Natterer eee6fa1e4b libgimpcolor: start adding profile utility functions to gimplcms.[ch]
Add functions to get a profile's description, manufacturer, model and
copyright, and use them instead of implementing the same 10 times.

Also add a GimpColorProfile typedef which avoids both having to
include lcms globally or using a gpointer instead (which looks bad and
non-descriptive in an API).
2014-03-14 01:48:39 +01:00
Michael Natterer d4fd13e440 libgimpcolor: add gimp_lcms_create_srgb_profile() to gimpcolor.def 2014-02-09 23:26:19 +01:00
Mikael Magnusson 6afc29543e app: add gimp_hsl_set_alpha to gimpcolor.def 2013-06-16 20:55:03 +02:00
Michael Natterer 00b3a9c745 libgimpcolor: add Cairo <-> GEGL utility functions from app/ 2012-05-03 04:07:16 +02:00
Michael Natterer 3ad73b3658 libgimpcolor: add GdkPixbuf <-> GeglBuffer utility functions
and update tons of includes in libgimp and app.
2012-05-03 03:37:20 +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 2b1807054f libgimp*: update .def files after cairo functions moved between libs 2011-05-01 11:24:26 +02:00
Sven Neumann f0938de1bf libgimp/gimp.def libgimpbase/gimpbase.def updated with new symbols.
2008-10-29  Sven Neumann  <sven@gimp.org>

	* libgimp/gimp.def
	* libgimpbase/gimpbase.def
	* libgimpcolor/gimpcolor.def: updated with new symbols.


svn path=/trunk/; revision=27470
2008-10-29 22:31:25 +00:00
Sven Neumann 6c73387066 libgimpcolor/Makefile.am libgimpcolor/gimpcolor.h
2007-06-01  Sven Neumann  <sven@gimp.org>

        * libgimpcolor/Makefile.am
        * libgimpcolor/gimpcolor.h
        * libgimpcolor/gimpcolortypes.h
        * libgimpcolor/gimpcolormanaged.[ch]: added an interface that 
will
        be used to implement the missing bits of color management.

        * libgimpcolor/gimpcolor.def: updated.


svn path=/trunk/; revision=22691
2007-06-01 11:19:37 +00:00
Michael Schumacher 4163f6df57 libgimpcolor/gimpcolor.def added some missing entries
2006-08-16  Michael Schumacher  <schumaml@cvs.gnome.org>

	* libgimpcolor/gimpcolor.def
	* libgimpwidgets/gimpwidgets.def: added some missing entries
2006-08-16 23:59:00 +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
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
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
Manish Singh 60aa23a658 add gimp_rgba_parse_css
2005-06-24  Manish Singh  <yosh@gimp.org>

        * libgimpcolor/gimpcolor.def: add gimp_rgba_parse_css
2005-06-24 18:27:37 +00:00
Sven Neumann 16296bcb13 libgimpbase/gimpbase.def libgimpcolor/gimpcolor.def added new symbols.
2005-01-22  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpbase.def
	* libgimpcolor/gimpcolor.def
	* libgimpmath/gimpmath.def: added new symbols.
2005-01-22 01:14:31 +00:00
Sven Neumann 89995843ab libgimpcolor/gimpcolor.def added new symbols.
2004-07-26  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimpcolor.def
	* libgimpwidgets/gimpwidgets.def: added new symbols.
2004-07-26 18:17:42 +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 d3caf7a3ed app/core/Makefile.am app/core/gimpgradient-load.[ch]
2004-07-22  Sven Neumann  <sven@gimp.org>

	* app/core/Makefile.am
	* app/core/gimpgradient-load.[ch]
	* app/core/gimpgradient-save.[ch]
	* app/core/gimpgradient.[ch]: moved gradient file handling out of
	gimpgradient.c to new files.

	* app/core/gimp.c
	* app/actions/gradients-commands.c: changed accordingly.

	* libgimpcolor/gimpcolor.def: added gimp_rgb_parse_name.
2004-07-22 13:58:29 +00:00
Sven Neumann f7d599851c libgimp/gimp.def libgimpcolor/gimpcolor.def updated based on a patch from
2003-11-15  Sven Neumann  <sven@gimp.org>

	* libgimp/gimp.def
	* libgimpcolor/gimpcolor.def
	* libgimpwdidgets/gimpwidgets.def: updated based on a patch from
	Michael Schumacher.
2003-11-15 22:20:05 +00:00
Sven Neumann 6d1b9fa9cb added gimp_rgb_to_cmyk_int().
2003-09-03  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimpcolor.def: added gimp_rgb_to_cmyk_int().
2003-09-03 13:11:49 +00:00
Hans Breuer b70d6c3317 renamed GimpOrientationType with Compat postfix to avoid name clashing
2003-07-26  Hans Breuer  <hans@breuer.org>

	* libgimp/gimpcompat.h : renamed GimpOrientationType
	with Compat postfix to avoid name clashing when using
	this header together with libgimp/gimpenums.h

	* app/composite/makefile.msc : (new file)
	  **/makefile.msc : updated

	* libgimp/gimp.c : use static defined _tile<widht|height>
	in this file instead of function call

	* libgimp/gimp.def libgimp/libgimpui.def : moved from former
	to latter : gimp_<brush|font|gradient|pattern>_select_<new|destroy>
	added to former gimp_<brushes|gradients|patterns>_popup

	* app/paint/gimppaintcore.h : removed double semicolon
	which gave msvc error C2059: syntax error : ';'

	* libgimpbase/gimpwin32-io.h : (new file) compatibilty defines
	which were spread over multiple files to make up mostly for
	missing unistd.h

	* app/base/tile-swap.c app/core/gimpimagefile.c
	  libgimpbase/gimpdatafiles.c
	  plug-ins/FractalExplorer/FractalExplorer.c : use new header

	* plug-ins/gflare/gflare.c
	  plug-ins/flame/flame.c
	  plug-ins/FractalExplorer/Dialogs.c :
	removed #ifdef G_OS_WIN32 special casing, not needed anymore
	due to g_file_test() usage

	* app/text/*.* : changes required for build with PangoWin32,
	but not commited ...
2003-07-26 17:37:32 +00:00
Tor Lillqvist 6eb1b80100 Sigh, one more addition. 2003-07-21 00:20:04 +00:00