/*
* feSpecularLighting renderer
*
* Authors:
* Niko Kiirala <niko@kiirala.com>
* Jean-Rene Reinhard <jr@komite.net>
*
* Copyright (C) 2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <glib.h>
#include <cmath>
#include "display/cairo-templates.h"
#include "display/cairo-utils.h"
#include "display/nr-3dutils.h"
#include "display/nr-filter-specularlighting.h"
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
#include "display/nr-light.h"
#include "svg/svg-icc-color.h"
#include "svg/svg-color.h"
namespace Inkscape {
namespace Filters {
{
specularConstant = 1;
specularExponent = 1;
surfaceScale = 1;
lighting_color = 0xffffffff;
}
return new FilterSpecularLighting();
}
{}
double specular_exponent)
{}
protected:
guint32 specularLighting(int x, int y, NR::Fvector const &halfway, NR::Fvector const &light_components) {
r = premul_alpha(r, a);
g = premul_alpha(g, a);
b = premul_alpha(b, a);
ASSEMBLE_ARGB32(pxout, a,r,g,b)
return pxout;
}
};
{
}
guint32 operator()(int x, int y) {
}
private:
};
{
}
guint32 operator()(int x, int y) {
}
private:
};
{}
guint32 operator()(int x, int y) {
}
private:
};
{
double r = SP_RGBA32_R_F(lighting_color);
double g = SP_RGBA32_G_F(lighting_color);
double b = SP_RGBA32_B_F(lighting_color);
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if (icc) {
r = SP_COLOR_U_TO_F(ru);
g = SP_COLOR_U_TO_F(gu);
b = SP_COLOR_U_TO_F(bu);
}
#endif
// Only alpha channel of input is used, no need to check input color_interpolation_filter value.
if( _style ) {
// Lighting color is always defined in terms of sRGB, preconvert to linearRGB
// if color_interpolation_filters set to linearRGB (for efficiency assuming
// next filter primitive has same value of cif).
if( ci_fp == SP_CSS_COLOR_INTERPOLATION_LINEARRGB ) {
r = srgb_to_linear( r );
g = srgb_to_linear( g );
b = srgb_to_linear( b );
}
}
switch (light_type) {
case DISTANT_LIGHT:
break;
case POINT_LIGHT:
break;
case SPOT_LIGHT:
break;
default: {
} break;
}
}
}
{
// TODO: support kernelUnitLength
}
{
return 9.0;
}
} /* 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 :