Commit Graph

35 Commits

Author SHA1 Message Date
Michael Natterer 76ff1c1584 Revert "app: add ::get_color_profile() to GimpPickable and GimpProjectable"
This reverts commit 5c8ffdf6c5.

It was a bad idea, we have the GimpColorManaged interface for that.
2015-09-03 00:21:09 +02:00
Michael Natterer 5c8ffdf6c5 app: add ::get_color_profile() to GimpPickable and GimpProjectable
which currently all end in a call to gimp_color_managed_get_color_profile()
except for channels and masks. This is currently unused infrastructure but
will be used for things like layer previews, and return NULL if called
on a mask or channel, or if color management is disabled, or whatever.
2015-09-01 22:27:31 +02:00
Michael Natterer 8c80ee14ff Bug 748749 - picked colors don't match image colors...
...when a color profile is active

This commit doesn't fix anything, but it prepares the code to do the
right thing:

It passes the actual raw image pixels through the entire color picking
mechanism to the widgets which display colors, particularly
GimpColorFrame.

This is needed for GimpColorFrame's "Pixel" mode (as opposed to its
RGB, HSV etc. modes) which is supposed to show the raw pixel values
from the image.

Before this commit, it was recreating the raw pixel values from the
GimpRGB value it knows, which will become impossible when we correctly
pick color managed GimpRGB values soon.
2015-08-25 00:05:59 +02:00
Michael Natterer a4dd86fcda app: add a read-only "buffer" property to GimpPickableInterface
and implement it in GimpDrawable and GimpProjection. Will need this
later.
2013-09-05 10:37:09 +02:00
Michael Natterer 330d511b33 app: gimp_pickable_pick_color(): return the right color index 2013-06-10 00:30:17 +02:00
Michael Natterer 4e9661bd20 app: use RGBA double to pick and average in gimp_pickable_pick_color()
It was still putting all picked colors through a guchar[4].
2013-06-09 20:13:50 +02:00
Michael Natterer 69893e4f72 app: remove GimpPickable::get_tiles()
and change some legacy places to get their tiles from the buffer
returned by GimpPickable::get_buffer().
2012-05-06 01:01:54 +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 9e73e7ebfe app: gimp_pickable_get_color_at(): 4 bytes is not enough for pixels any longer 2012-05-02 17:51:18 +02:00
Michael Natterer 3ea0e3f090 app: return double not int from GimpPickable::get_opacity_at()
and fix GimpLayer's impl to honor the mask also for layers without
alpha.
2012-05-02 17:51:07 +02:00
Michael Natterer e6975ed065 app: add format parameter to GimpPickable::get_pixel_at()
allowing NULL for the pickable's native format. Fix and simplify auto
cropping to always use "R'G'B'A u8".
2012-05-02 17:51:07 +02:00
Michael Natterer 7ec6c48636 app: use gimp_rgba_set,get_pixel() instead of babl_process() directly 2012-05-02 17:50:53 +02:00
Michael Natterer 2a853cd1ee app: remove GimpPickable::get_bytes() 2012-05-02 17:50:42 +02:00
Michael Natterer 5e754a9641 app: remove GimpPickable::get_image_type() 2012-05-02 17:50:42 +02:00
Michael Natterer 5713e6ecfb app: don't use gimp_image_get_color() in GimpPickable
A fish does the job just fine.
2012-05-02 17:50:39 +02:00
Michael Natterer 9a09d3a762 app: drop "babl" from gimp_foo_get_babl_format[_with_alpha]() 2012-05-02 17:45:58 +02:00
Michael Natterer e9ecc40f02 app: add GimpPickable::get_babl_format_with_alpha() 2012-05-02 17:45:58 +02:00
Michael Natterer f05de34cd6 app: add GimpPickable::get_babl_format() 2012-05-02 17:45:55 +02:00
Michael Natterer 7c3a796dfc app: added GimpPickable::get_buffer()
Add cached buffers to GimpProjection and GimpImageMap, and use
the new API where possible.
2012-05-02 17:45:50 +02:00
Michael Natterer cc47b2a600 libgimpwidgets/color: move the cairo color utility functions to libgimpcolor
Add CAIRO_CFLAGS to a lot of Makefiles to make this possible, and
because they pull in cairo via the libgimp headers.
2011-04-28 15:50:39 +02:00
Barak Itkin 18b9ba1c87 app: Add some comment documentation to code 2011-02-07 03:29:23 +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
Martin Nordholts e38ca5490a Rename the convenient channel offset defines from FOO_PIX to FOO as this
* app/base/base-types.h: Rename the convenient channel offset
defines from FOO_PIX to FOO as this increases readability.

* app/base/color-balance.c
* app/base/colorize.c
* app/base/desaturate.c
* app/base/hue-saturation.c
* app/base/siox.c
* app/base/threshold.c

* app/core/gimp-edit.c
* app/core/gimp-transform-region.c
* app/core/gimpchannel.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-convert.c
* app/core/gimpdrawable-stroke.c
* app/core/gimpdrawable.c
* app/core/gimpimage-convert.c
* app/core/gimpimage.c
* app/core/gimppalette-import.c
* app/core/gimppickable.c

* app/gegl/gimpoperation*mode.c
* app/gegl/gimpoperationcolorbalance.c
* app/gegl/gimpoperationcolorize.c
* app/gegl/gimpoperationhuesaturation.c
* app/gegl/gimpoperationlevels.c
* app/gegl/gimpoperationposterize.c
* app/gegl/gimpoperationthreshold.c

* app/paint-funcs/subsample-region.c

* app/paint/gimpclone.c
* app/paint/gimppaintbrush.c

* app/widgets/gimpviewrenderer.c: Adapt.

svn path=/trunk/; revision=27324
2008-10-19 13:47:09 +00:00
Michael Natterer 5503e6a055 Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h had a
2008-10-09  Michael Natterer  <mitch@gimp.org>

	Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
	had a GEGL dependency (they will have in the next commit, but I
	wanted to keep the commit separate).

	* app/dialogs/Makefile.am
	* app/file/Makefile.am
	* app/gui/Makefile.am
	* app/menus/Makefile.am
	* app/paint/Makefile.am
	* app/plug-in/Makefile.am
	* app/text/Makefile.am
	* app/vectors/Makefile.am
	* app/widgets/Makefile.am
	* app/xcf/Makefile.am: add GEGL_CFLAGS.

	* app/actions/*.c
	* app/core/*.c
	* app/dialogs/*.c
	* app/display/*.c
	* app/file/*.c
	* app/gui/*.c
	* app/menus/*.c
	* app/paint/*.c
	* app/pdb/gimppdb-utils.c
	* app/pdb/gimpprocedure.c
	* app/plug-in/*.c
	* app/text/*.c
	* app/tools/*.c
	* app/vectors/*.c
	* app/widgets/*.c
	* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
	to all files which include a drawable subclass or gimpimage.h

	* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
	in all generated files.

	* app/pdb/*-cmds.c: regenerated.

	* data/images/gimp-splash.png: the goat is still sleeping.
	By Aurore Derriennic.


svn path=/trunk/; revision=27202
2008-10-09 20:24:04 +00:00
Sven Neumann 22c981c771 reduce rounding errors.
2007-05-02  Sven Neumann  <sven@gimp.org>

        * app/core/gimppickable.c (gimp_pickable_pick_color): reduce
        rounding errors.


svn path=/trunk/; revision=22384
2007-05-02 17:26:26 +00:00
Sven Neumann c70b55a403 removed get_color_at() from the GimpPickable interface. Implement the same
2007-05-02  Sven Neumann  <sven@gimp.org>

	* app/core/gimppickable.[ch]: removed get_color_at() from the
	GimpPickable interface. Implement the same functionality using
	get_pixel_at() but with a saner API.

	* app/core/gimpdrawable.c
	* app/core/gimpprojection.c
	* app/core/gimpimagemap.c: removed get_color_at() implementations.

	* app/tools/gimpbycolorselecttool.c: adapt to API change of
	gimp_pickable_get_color_at().

	* app/tools/gimprectangleselecttool.c: added missing include.


svn path=/trunk/; revision=22383
2007-05-02 17:15:03 +00:00
Sven Neumann 7c1fc759f5 added get_pixel_at() method to the GimpPickable interface. This gives
2007-04-27  Sven Neumann  <sven@gimp.org>

	* app/core/gimppickable.[ch]: added get_pixel_at() method to the
	GimpPickable interface. This gives direct access to the pixel
	without converting it to an RGB color.

	* app/core/gimpdrawable.c
	* app/core/gimpimagemap.c
	* app/core/gimpprojection.c: implement the new method and also use
	it to reimplement get_color_at().

	* app/core/gimpimage-crop.c (gimp_image_crop_guess_bgcolor): use
	gimp_pickable_get_pixel_at(). Fixes auto-shrink on indexed and
	grayscale images.

svn path=/trunk/; revision=22359
2007-04-27 16:07:49 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +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
Manish Singh d41f462885 do not return a value with void functions. Fixes bug #338904.
2006-04-18  Manish Singh  <yosh@gimp.org>

        * app/core/gimppickable.c (gimp_pickable_flush): do not return
        a value with void functions. Fixes bug #338904.
2006-04-18 17:48:27 +00:00
Sven Neumann 049872b361 app/*.[ch] converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* app/*.[ch]
	* app/*/*.[ch]: converted tabs to spaces.
2006-04-12 12:49:29 +00:00
Michael Natterer b55ce9ea2d added new methods ::get_bytes() and ::flush()
2006-03-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimppickable.[ch]: added new methods ::get_bytes() and
	::flush()

	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimpimagemap.c
	* app/core/gimpprojection.c: implement ::get_bytes()

	* app/core/gimpprojection.c: implement ::flush() (immediately
	process both the idle renderer's queue and the unflushed update
	areas, to make sure that any reading from the projection will
	re-construct it).

	* app/core/gimp-edit.c
	* app/core/gimpchannel.c
	* app/core/gimpimage-contiguous-region.c
	* app/core/gimpimage-crop.c
	* app/core/gimppalette-import.c
	* app/paint/gimpclone.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpiscissorstool.c
	* tools/pdbgen/pdb/image.pdb: use the pickable interface more
	consistently when reading from any drawable or the projection, and
	call gimp_pickable_flush() before doing so. Fixes bug #332933.

	* app/core/gimpimage-pick-color.c: added comment why the we don't
	call gimp_pickable_flush() here.

	* app/pdb/image_cmds.c
	* libgimp/gimpimage_pdb.c: regenerated.
2006-03-02 19:30:59 +00:00
Michael Natterer d64bf3564f added GimpPickable::get_opacity_at()
2005-07-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimppickable.[ch]: added GimpPickable::get_opacity_at()

	* app/core/gimpchannel.[ch]: removed gimp_channel_value() and
	implement ::get_opacity_at() instead.

	* app/core/gimplayer.[ch]: removed gimp_layer_pick_correlate()
	and implement ::get_opacity_at() instead.

	* app/core/gimpselection.c: GimpChannel::value() doesn't exist
	any more.

	* app/core/gimpprojection.c: implement ::get_opacity_at(), always
	returns OPAQUE.

	* app/core/gimpimage.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpnewrectselecttool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimptransformtool.c
	* tools/pdbgen/pdb/selection.pdb: changed accordingly.

	* app/pdb/selection_cmds.c: regenerated.
2005-07-11 19:21:52 +00:00
Michael Natterer ad1c2ca0fc added new vitrual function GimpPickableInterface::get_image()
2004-09-25  Michael Natterer  <mitch@gimp.org>

	* app/core/gimppickable.[ch]: added new vitrual function
	GimpPickableInterface::get_image()

	* app/core/gimpdrawable.c
	* app/core/gimpimagemap.c
	* app/core/gimpprojection.[ch]: implement it.
2004-09-25 13:16:13 +00:00
Michael Natterer 54cc251b08 app/core/Makefile.am app/core/core-types.h new interface which has
2004-07-14  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimppickable.[ch]: new interface which has
	get_image_type(), get_tiles() and get_color_at() methods.

	* app/core/gimpdrawable.[ch]
	* app/core/gimpimagemap.[ch]
	* app/core/gimpprojection.[ch]: implement GimpPickableInterface
	and removed public get_colot_at() functions.

	* app/core/gimpimage-pick-color.[ch]: removed typedef
	GimpImagePickColorFunc and gimp_image_pick_color_by_func(). Use
	gimp_pickable_pick_color() instead.

	* app/core/gimpimage-contiguous-region.c
	* app/core/gimpimage-crop.c
	* app/gui/info-window.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpsmudge.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpimagemaptool.c
	* app/widgets/gimpselectioneditor.c: use GimpPickable functions
	instead of the various get_color_at() functions. Simplifies code
	which has a "sample_merged" boolean. Various cleanups.
2004-07-13 23:04:05 +00:00