When using GEGL for the projection, use CIE LCH for the Hue,
Saturation and Value layer modes, just as we already do for the Color
layer mode. The Value layer mode will later be renamed to Lightness
since that is the semantics it has now.
When GEGL is used for the projection, use CIE LCH instead of HSL for
the "Color" layer mode. This give much more accurate and intuitive
results. Requires at least 12d5cc4c1bcfb of babl.
Get rid of artificial compiler warnings generated with the #warning
directive. They pollute the build output and don't work as incentives
for fixing stuff.
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
2008-11-16 Sven Neumann <sven@gimp.org>
* app/app.c
* app/gegl/gimp-gegl.[ch] (gimp_gegl_init): set the GEGL cache
size
as large as the GIMP tile-cache.
svn path=/trunk/; revision=27669
* app/gegl/gimpoperationtilesource.c:
(gimp_operation_tile_source_prepare),
(gimp_operation_tile_source_process): cache the data in "RaGaBa A"
float instead as a copy of the tile managers exact data, this allows
more direct tile data access at projection compositing time.
svn path=/trunk/; revision=27632
* app/gegl/gimpoperationpointlayermode.c
(gimp_operation_point_layer_mode_process): Reuse the blending
formula from the legacy Soft light. (Actually the formula comes
from legacy Overlay but legacy Overlay and Soft light blends
pixels exactly the same.) I hereby declare the porting of the
layer modes to this GEGL operation complete. Summary:
Completely works the same:
Normal, Dissolve, Behind, Color Erase, Erase, Anti Erase
Works the same for 100% opaque layers:
Lighten only, Screen, Dodge, Addition, Darken only, Multiply,
Dodge, Soft light, Hard light, Difference, Subtract, Grain
extract, Grain merge, Divide, Hue, Saturation, Color, Value
Works different but similar:
Overlay now uses the SVG 1.2 overlay formula which is different
but similar to legacy Overlay
Replace needs to be externally masked to not replace too much,
but that is outside the scope of the layer mode porting.
svn path=/trunk/; revision=27541
* app/gegl/gimpoperationpointlayermode.c
(gimp_operation_point_layer_mode_process): Replaced the XXX for
Soft light with a FIXME.
svn path=/trunk/; revision=27514
* app/gegl/gimpoperation*.c: Prefix the GIMP GEGL operations with
"gimp:" instead of "gimp-" so we follow the GEGL prefix style and
better serialize to XML.
* app/tools/gimp*tool.c
* app/core/gimpdrawable-*.c
* app/core/gimpdrawable.c
* app/core/gimpimagemap.c
* app/core/gimpprojection.c: Changed accordingly.
svn path=/trunk/; revision=27512
* app/gegl/gimpoperationpointlayermode.c: Introduced helper macros
fooC to properly un-multiply pre-multiplied data without causing
NaNs. This fixes some compositing issues involving complete
transparency.
svn path=/trunk/; revision=27511
* app/gegl/gimpoperationpointlayermode.c: Renamed fooC aliases to
fooCa since they represent pre-multiplied color data.
svn path=/trunk/; revision=27510
* app/gegl/gimpoperationpointlayermode.c: Get rid of GRand in
process() and use a lut instead. A little benchmark showed a
performance improvement of 78%. Also added defines for the the
size of the area of which Dissolve repeats it dissolve pattern.
svn path=/trunk/; revision=27509
* app/gegl/gimpoperationpointlayermode.c
(gimp_operation_point_layer_mode_process): Implemented Erase, Anti
Erase, Color Erase and Replace. These are not normal layer modes
and handle alpha in their own way. In addition to this, the
behavior of Replace doesn't map very well to GEGL which uses
infinite sized "layers".
Completely works the same:
o Erase
o Anti Erase
o Color Erase
Works different but similar:
o Replace
* app/paint-funcs/paint-funcs.[ch]: Expose
paint_funcs_color_erase_helper() so it can be used in the
GimpOperationPointLayerMode implementation. Once the migration is
complete this function can be moved entirely to the op and be
tailored to work on premultiplied data.
svn path=/trunk/; revision=27502
* app/gegl/gimpoperationpointlayermode.c
(gimp_operation_point_layer_mode_process): Formating,
simplification and fixed operator precedence for the seed (not
that it matters much).
svn path=/trunk/; revision=27487
* app/gegl/gimpoperationpointlayermode.c
(gimp_operation_point_layer_mode_process): The GEGL API actually
allows us to handle the Dissolve layer mode as a point op. The
GEGL implementation of Dissolve uses a faster implementation for
deterministic behavior than the legacy Dissolve implementation.
The end result should be identical (although not on the
pixel-level).
Completely works the same:
o Dissolve
svn path=/trunk/; revision=27485
2008-10-29 Sven Neumann <sven@gimp.org>
Bug 558451 – Cannot build GIMP using Sun CC on Solaris 2.8
* app/pdb/gimp-pdb-compat.c
* app/gegl/gimpoperationtilesink.c
* app/gegl/gimpoperationtilesource.c
* app/tools/gimpgegltool.c: applied patches from Eric Lamarque
fixing the build using Sun CC on Solaris.
svn path=/trunk/; revision=27467
* app/gegl/gimpoperationpointlayermode.c
(gimp_operation_point_layer_mode_process): Implemented the layer
modes Hue, Saturation, Color and Value.
Works the same for 100% opaque layers:
o Hue
o Saturation
o Color
o Value
* libgimpcolor/gimphsl.[ch]: Added gimp_hsl_set().
svn path=/trunk/; revision=27466
* app/gegl/gimpoperationpointlayermode.c
(gimp_operation_point_layer_mode_process): Put the existing blend
formulas in expanded switch cases again. We need to keep the more
complicated layer modes like Hue, Value and Saturation in expanded
switch cases anyway.
svn path=/trunk/; revision=27449
* app/gegl/gimpoperationpointlayermode.c: Clamp Addition and
Subtract so that we acheieve consistent blending results. Also,
our Addition is fine, it is the formula for 'plus' in the SVG 1.2
draft that is wrong as far as I can see.
svn path=/trunk/; revision=27421
* app/gegl/gimpoperationpointlayermode.c: Continue the quest of
overviewable and readable blend formulas. The macro now expands to
entire case-statements.
svn path=/trunk/; revision=27420
* app/gegl/gimpoperationpointlayermode.c: For blend modes with
conditions, fix so that the conditions are per color
channel. Acheived by introducing a nice little preprocessor macro.
svn path=/trunk/; revision=27412
* app/gegl/gimpoperationpointlayermode.c: Enable the [0..1]
clamping of the output for Dodge and Burn. Without the clamping
one gets inconsistent results when blending together identical
layers but with different opacities. Maybe we should make the
clamping configurable and introduce a HDR compositing mode or
something?
svn path=/trunk/; revision=27411
* app/gegl/gimpoperationpointlayermode.c: Implemented Grain
Extract and Grain Merge. Also corrected the formula for Divide.
Works the same for 100% opaque layers:
o Grain Extract
o Grain Merge
svn path=/trunk/; revision=27410
* app/gegl/gimpoperationpointlayermode.c: Implement a bunch of
layer modes. Use the exact SVG 1.2 formula for layer modes that
have a counterpart in SVG 1.2. Don't clamp the result to [0..1]
for Dodge and Burn though as we don't need to. Maybe we *should*
clamp from a compositing point of view, I'm not sure. Also
reformat the code a bit for readability.
Keep in mind that we now treat the opacity of all layers the same
indepentant of the layer mode. That is why most of the new
implementations doesn't work the same as the legacy ones when
transparency is involved, only when the layers are completely
opaque. Another important property for all layer modes implemented
below is that compositing onto complete transparency gives the
same result as if the layer would have been in Normal blending
mode.
The status of the new layer mode implementations compared to the
legacy implementations is as follows:
Completely works the same:
o Behind
Works the same for 100% opaque layers:
o Multiply
o Screen
o Difference
o Darken
o Lighten
o Dodge
o Burn
o Hard Light
o Subtract
o Divide
Works different but similar:
o Overlay
Work in progress:
o Soft Light
svn path=/trunk/; revision=27409
* app/gegl/gimpoperationpointlayermode.c: Completed the rename
with gimp:layer-mode -> gimp:point-layer-mode and also did some
formating.
* app/core/gimplayer.c: Changed accordingly.
svn path=/trunk/; revision=27408
* app/gegl/gimpoperationlayermode.[ch]: Rename to
* app/gegl/gimpoperationpointlayermode.[ch]: so that we can later
create a common GimpOperationLayerMode class/interface for
non-point layer modes like GimpOperationDissolveLayerMode.
* app/gegl/Makefile.am
* app/gegl/gimp-gegl.c
* app/gegl/gegl-types.h: Adjust accordingly.
svn path=/trunk/; revision=27401
GimpOperationLayerMode instantiable and add a GimpLayerModeEffects
property to it that we check in ::process() to blend pixels
together.
* app/gegl/gimpoperationlayermode.[ch]: Do the change described
above. Currently only Normal and Addition are implemented. Normal
so that we don't need a special case for the gegl:normal op. Also,
the Dissolve layer mode is not a point op and needs to be
implemented elsewhere.
* app/gegl/gimpoperation*mode.c: Removed.
* app/gegl/gimp-gegl-utils.[ch]: Removed
gimp_layer_mode_to_gegl_operation().
* app/core/gimplayer.c
* app/gegl/Makefile.am
* app/gegl/gimp-gegl.c: Adapt.
svn path=/trunk/; revision=27400
* app/gegl/gimpoperationlayermode.c: Make layer modes work on
premultiplied data. This makes compositing 40% faster on my test
image with 10 interlaced Normal and Addition mode layers.
* app/gegl/gimpoperationadditionmode.c: Switch to the
premultiplied algorithm and remove the experimental ones. The new
Addition mode has two important differences over the legacy
Addition mode:
o Addition mode now really is commutative as the GIMP
documentation says (this wasn't previously the case).
o Layers in Addition mode are just as opaque as Normal
layers. That is, their effect on the composite alpha channel
is the same. For discussion, refer to bug #387449.
svn path=/trunk/; revision=27396
* app/gegl/gimpoperationadditionmode.c: For alpha compositing
consistency, all layers should affect alpha in the same way
independent of layer mode. Replace the compositing algorithm with
a version without the flaws discovered so far in the previous
ones. Don't use it yet though as it requires premultiplied data.
svn path=/trunk/; revision=27382
* app/gegl/gimpoperation*mode.c: Refer to the input as 'in'
instead of 'src', the layer as 'layer' instead of 'aux', and the
result as 'out' instead of 'dest'.
svn path=/trunk/; revision=27329
* app/gegl/gimpoperationadditionmode.c: Refer to the input as 'in'
instead of 'src', the layer as 'layer' instead of 'aux', and the
result as 'out' instead of 'dest'. The old terminology clashes
with at least the SVG 1.2 compositing terminology [1] and there is
no reason for creating confusion.
[1] http://www.w3.org/TR/2004/WD-SVG12-20041027/rendering.html
svn path=/trunk/; revision=27321
* app/gegl/gimpoperationadditionmode.c: Use local variants of
channel offset defines, namely RED instead of RED_PIX etc, to
increase readability.
svn path=/trunk/; revision=27320