Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
diffuselighting.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
/*
5 * Authors:
6 * Hugo Rodrigues <haa.rodrigues@gmail.com>
7 * Jean-Rene Reinhard <jr@komite.net>
8 *
9 * Copyright (C) 2006-2007 Authors
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#ifndef SP_FEDIFFUSELIGHTING_H_SEEN
14#define SP_FEDIFFUSELIGHTING_H_SEEN
15
16#include <optional>
17#include <cstdint>
18#include "sp-filter-primitive.h"
19#include "number-opt-number.h"
20
21namespace Inkscape {
22namespace Filters {
23class FilterDiffuseLighting;
24} // namespace Filters
25} // namespace Inkscape
26
28 : public SPFilterPrimitive
29{
30public:
31 int tag() const override { return tag_of<decltype(*this)>; }
32
33private:
34 float surfaceScale = 1.0f;
35 float diffuseConstant = 1.0f;
36
37 std::optional<Inkscape::Colors::Color> lighting_color;
38
39 bool surfaceScale_set = false;
40 bool diffuseConstant_set = false;
41
43
44protected:
45 void build(SPDocument *doc, Inkscape::XML::Node *repr) override;
46 void set(SPAttr key, char const *value) override;
47 void modified(unsigned flags) override;
49
53
54 std::unique_ptr<Inkscape::Filters::FilterPrimitive> build_renderer(Inkscape::DrawingItem *item) const override;
55};
56
57#endif // SP_FEDIFFUSELIGHTING_H_SEEN
58
59/*
60 Local Variables:
61 mode:c++
62 c-file-style:"stroustrup"
63 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
64 indent-tabs-mode:nil
65 fill-column:99
66 End:
67*/
68// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
SPAttr
Definition attributes.h:27
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
Definition cast.h:26
SVG drawing item for display.
Interface for refcounted XML nodes.
Definition node.h:80
SVGLength x
Typed SVG document implementation.
Definition document.h:101
std::optional< Inkscape::Colors::Color > lighting_color
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned flags) override
NumberOptNumber kernelUnitLength
void order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node *old_repr, Inkscape::XML::Node *new_repr) override
void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override
void remove_child(Inkscape::XML::Node *child) override
void modified(unsigned flags) override
std::unique_ptr< Inkscape::Filters::FilterPrimitive > build_renderer(Inkscape::DrawingItem *item) const override
int tag() const override
Inkscape::XML::Node * repr
Definition sp-object.h:193
SPItem * item
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
<number-opt-number> implementation.
Ocnode * child[8]
Definition quantize.cpp:33
Ocnode ** ref
Definition quantize.cpp:32
Document level base class for all SVG filter primitives.
Interface for XML documents.
Definition document.h:43