nr-filter-blend.cpp revision e874cb491fbb2e54741b9ee2434fcefa629796e5
/** @file
* SVG feBlend renderer
*//*
* "This filter composites two objects together using commonly used
* imaging software blending modes. It performs a pixel-wise combination
* of two input images."
* http://www.w3.org/TR/SVG11/filters.html#feBlend
*
* Authors:
* Niko Kiirala <niko@kiirala.com>
* Jasper van de Gronde <th.v.d.gronde@hccnet.nl>
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* Copyright (C) 2007-2008 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "display/cairo-templates.h"
#include "display/cairo-utils.h"
#include "display/nr-filter-blend.h"
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
#include "display/nr-filter-types.h"
#include "preferences.h"
namespace Inkscape {
namespace Filters {
{}
return new FilterBlend();
}
{}
{
// We may need to transform input surface to correct color interpolation space. The input surface
// might be used as input to another primitive but it is likely that all the primitives in a given
// filter use the same color interpolation space so we don't copy the input before converting.
if( _style ) {
}
// input2 is the "background" image
// out should be ARGB32 if any of the inputs is ARGB32
// All of the blend modes are implemented in Cairo as of 1.10.
// For a detailed description, see:
switch (_blend_mode) {
case BLEND_MULTIPLY:
break;
case BLEND_SCREEN:
break;
case BLEND_DARKEN:
break;
case BLEND_LIGHTEN:
break;
#ifdef WITH_CSSBLEND
// NEW
case BLEND_OVERLAY:
break;
case BLEND_COLORDODGE:
break;
case BLEND_COLORBURN:
break;
case BLEND_HARDLIGHT:
break;
case BLEND_SOFTLIGHT:
break;
case BLEND_DIFFERENCE:
break;
case BLEND_EXCLUSION:
break;
case BLEND_HUE:
break;
case BLEND_SATURATION:
break;
case BLEND_COLOR:
break;
case BLEND_LUMINOSITY:
break;
#endif
case BLEND_NORMAL:
default:
break;
}
}
{
// blend is a per-pixel primitive and is immutable under transformations
return true;
}
{
return 1.1;
}
bool FilterBlend::uses_background()
{
{
return true;
} else {
return false;
}
}
}
}
#ifdef WITH_CSSBLEND
|| mode == BLEND_OVERLAY ||
#endif
)
{
_blend_mode = mode;
}
}
} /* namespace Filters */
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :