37 , lighting_color(0xffffffff) {}
58 ASSEMBLE_ARGB32(pxout, 255, r, g, b)
65struct DiffuseDistantLight :
public DiffuseLight
68 double scale,
double diffuse_constant)
69 : DiffuseLight(bumpmap,
scale, diffuse_constant)
71 DistantLight dl(light, color);
72 dl.light_vector(_lightv);
73 dl.light_components(_light_components);
76 guint32 operator()(
int x,
int y)
78 return diffuseLighting(x, y, _lightv, _light_components);
85struct DiffusePointLight :
public DiffuseLight
88 Geom::Affine const &trans,
double scale,
double diffuse_constant,
89 double x0,
double y0,
int device_scale)
90 : DiffuseLight(bumpmap,
scale, diffuse_constant)
91 , _light(light, color, trans, device_scale)
95 _light.light_components(_light_components);
98 guint32 operator()(
int x,
int y)
101 _light.light_vector(light, _x0 + x, _y0 + y, _scale *
alphaAt(x, y) / 255.0);
102 return diffuseLighting(x, y, light, _light_components);
111struct DiffuseSpotLight :
public DiffuseLight
114 Geom::Affine const &trans,
double scale,
double diffuse_constant,
115 double x0,
double y0,
int device_scale)
116 : DiffuseLight(bumpmap,
scale, diffuse_constant)
117 , _light(light, color, trans, device_scale)
121 guint32 operator()(
int x,
int y)
124 _light.light_vector(light, _x0 + x, _y0 + y, _scale *
alphaAt(x, y)/255.0);
125 _light.light_components(light_components, light);
126 return diffuseLighting(x, y, light, light_components);
165 double x0 = p.
x(), y0 = p.
y();
179 cairo_t *ct = cairo_create(out);
181 cairo_set_operator(ct, CAIRO_OPERATOR_SOURCE);
189 cairo_surface_destroy(out);
Cairo software blending templates.
void ink_cairo_surface_synthesize(cairo_surface_t *out, cairo_rectangle_t const &out_area, Synth &&synth)
Synthesize surface pixels based on their position.
cairo_surface_t * ink_cairo_surface_create_same_size(cairo_surface_t *s, cairo_content_t c)
static guint32 srgb_to_linear(const guint32 c, const guint32 a)
void set_cairo_surface_ci(cairo_surface_t *surface, SPColorInterpolation ci)
Set the color_interpolation_value for a Cairo surface.
Cairo integration helpers.
3x3 matrix representing an affine transformation.
Coord descrim() const
Calculate the descriminant.
Axis aligned, non-empty, generic rectangle.
void expandBy(C amount)
Expand the rectangle in both directions by the specified amount.
CPoint min() const
Get the corner of the rectangle with smallest coordinate values.
Two-dimensional point that doubles as a vector.
constexpr Coord y() const noexcept
constexpr Coord x() const noexcept
Axis aligned, non-empty rectangle.
double complexity(Geom::Affine const &ctm) const override
~FilterDiffuseLighting() override
void area_enlarge(Geom::IntRect &area, Geom::Affine const &trans) const override
void render_cairo(FilterSlot &slot) const override
union Inkscape::Filters::FilterDiffuseLighting::@19 light
SPColorInterpolation color_interpolation
cairo_surface_t * getcairo(int slot)
Returns the pixblock in specified slot.
void set(int slot, cairo_surface_t *s)
Sets or re-sets the pixblock associated with given slot.
int get_device_scale() const
Gets the device scale; for high DPI monitors.
Geom::Rect get_slot_area() const
FilterUnits const & get_units() const
Geom::Affine get_matrix_primitiveunits2pb() const
Gets the primitiveUnits to pixblock coordinates transformation matrix.
constexpr double SP_RGBA32_G_F(uint32_t v)
constexpr double SP_RGBA32_R_F(uint32_t v)
constexpr uint32_t SP_RGBA32_F_COMPOSE(double r, double g, double b, double a)
constexpr double SP_RGBA32_B_F(uint32_t v)
struct _cairo_surface cairo_surface_t
Helper class to stream background task notifications as a series of messages.
gdouble scalar_product(const Fvector &a, const Fvector &b)
Computes the scalar product between two Fvectors.
Definition of functions needed by several filters.
TODO: insert short description here.
a type of 3 gdouble components vectors
guint32 alphaAt(int x, int y) const
NR::Fvector surfaceNormalAt(int x, int y, double scale) const
@ SP_CSS_COLOR_INTERPOLATION_LINEARRGB
void cairo_set_source_rgba(cairo_t *cr, colour c)