nr-filter-composite.cpp revision c73973b946e8f567076c2a67b4e54f3d72b16ce5
/*
* feComposite filter effect renderer
*
* Authors:
* Niko Kiirala <niko@kiirala.com>
*
* Copyright (C) 2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <cmath>
#include "display/cairo-templates.h"
#include "display/cairo-utils.h"
#include "display/nr-filter-composite.h"
#include "display/nr-filter-pixops.h"
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
#include "libnr/nr-pixblock.h"
#include "libnr/nr-pixops.h"
inline void
composite_over(unsigned char *r, unsigned char const *a, unsigned char const *b)
{
r[0] = NR_COMPOSEPPP_1111(a[0],a[3],b[0]);
}
inline void
composite_in(unsigned char *r, unsigned char const *a, unsigned char const *b)
{
r[0] = NR_NORMALIZE_21(a[0] * b[3]);
}
inline void
composite_out(unsigned char *r, unsigned char const *a, unsigned char const *b)
{
}
inline void
composite_atop(unsigned char *r, unsigned char const *a, unsigned char const *b)
{
r[3] = b[3];
}
inline void
composite_xor(unsigned char *r, unsigned char const *a, unsigned char const *b)
{
}
// BUGBUG / TODO
// This makes arithmetic compositing non re-entrant and non thread safe.
inline void
composite_arithmetic(unsigned char *r, unsigned char const *a, unsigned char const *b)
{
}
namespace Inkscape {
namespace Filters {
{}
return new FilterComposite();
}
{}
struct BlendArithmetic {
{}
return pxout;
}
private:
};
#if 0
// Bail out if either one of source images is missing
return 1;
}
out = new NRPixBlock;
true);
// Blending modes are defined for premultiplied RGBA values,
// thus convert them to that format before blending
false);
}
false);
}
/* pixops_mix is defined in display/nr-filter-pixops.h
* It mixes the two input images with the function given as template
* and places the result in output image.
*/
switch (op) {
case COMPOSITE_IN:
break;
case COMPOSITE_OUT:
break;
case COMPOSITE_ATOP:
break;
case COMPOSITE_XOR:
break;
case COMPOSITE_ARITHMETIC:
break;
case COMPOSITE_DEFAULT:
case COMPOSITE_OVER:
default:
break;
}
if (in1 != original_in1) {
}
if (in2 != original_in2) {
}
return 0;
}
#endif
{
if (op == COMPOSITE_ARITHMETIC) {
} else {
switch(op) {
case COMPOSITE_IN:
break;
case COMPOSITE_OUT:
break;
case COMPOSITE_ATOP:
break;
case COMPOSITE_XOR:
break;
case COMPOSITE_OVER:
case COMPOSITE_DEFAULT:
default:
// OVER is the default operator
break;
}
}
}
{
return true;
}
}
}
if (op == COMPOSITE_DEFAULT) {
this->op = COMPOSITE_OVER;
} else if (op == COMPOSITE_OVER ||
op == COMPOSITE_IN ||
op == COMPOSITE_OUT ||
op == COMPOSITE_ATOP ||
op == COMPOSITE_XOR ||
{
}
}
g_warning("Non-finite parameter for feComposite arithmetic operator");
return;
}
}
} /* 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:encoding=utf-8:textwidth=99 :