Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
specularlighting.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 Hugo Rodrigues
10 * 2007 authors
11 *
12 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
13 */
14
15#ifndef SP_FESPECULARLIGHTING_H_SEEN
16#define SP_FESPECULARLIGHTING_H_SEEN
17
18#include <optional>
19#include <cstdint>
20#include "sp-filter-primitive.h"
21#include "number-opt-number.h"
22
23namespace Inkscape {
24namespace Filters {
25class FilterSpecularLighting;
26} // namespace Filters
27} // namespace Inkscape
28
30 : public SPFilterPrimitive
31{
32public:
33 int tag() const override { return tag_of<decltype(*this)>; }
34
35private:
36 float surfaceScale = 1.0f;
37 float specularConstant = 1.0f;
38 float specularExponent = 1.0f;
39
40 std::optional<Inkscape::Colors::Color> lighting_color;
41
42 bool surfaceScale_set = false;
45
47
48protected:
49 void build(SPDocument *doc, Inkscape::XML::Node *repr) override;
50 void set(SPAttr key, char const *value) override;
51 void modified(unsigned flags) override;
53
57
58 std::unique_ptr<Inkscape::Filters::FilterPrimitive> build_renderer(Inkscape::DrawingItem *item) const override;
59};
60
61#endif // SP_FESPECULARLIGHTING_H_SEEN
62
63/*
64 Local Variables:
65 mode:c++
66 c-file-style:"stroustrup"
67 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
68 indent-tabs-mode:nil
69 fill-column:99
70 End:
71*/
72// 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
Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned flags) override
void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override
std::unique_ptr< Inkscape::Filters::FilterPrimitive > build_renderer(Inkscape::DrawingItem *item) const override
int tag() const override
void order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node *old_repr, Inkscape::XML::Node *new_repr) override
void remove_child(Inkscape::XML::Node *child) override
void modified(unsigned flags) override
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
NumberOptNumber kernelUnitLength
std::optional< Inkscape::Colors::Color > lighting_color
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