scenepic 1.1.0
3D Visualization Made Easy
shading.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#ifndef _SCENEPIC_PARAMETERS_H_
5#define _SCENEPIC_PARAMETERS_H_
6
7#include "color.h"
8#include "json_value.h"
9#include "matrix.h"
10
11namespace scenepic
12{
14 class Shading
15 {
16 public:
24 const Color& bg_color = Color(0, 0, 0),
25 const Color& ambient_light_color = Color(0.7f, 0.7f, 0.7f),
26 const Color& directional_light_color = Color(0.3f, 0.3f, 0.3f),
27 const Vector& directional_light_dir = Vector(2, 1, 2));
28
36 const Color4& bg_color,
39 const Vector& directional_light_dir);
40
41 const Color4& bg_color() const;
42
43 const Color& ambient_light_color() const;
44
46
47 const Vector& directional_light_dir() const;
48
50 std::string to_string() const;
51
56
58 bool is_none() const;
59
61 static const Shading None();
62
63 private:
64 Color4 m_bg_color;
65 Color m_ambient_light_color;
66 Color m_directional_light_color;
67 Vector m_directional_light_dir;
68 };
69} // namespace scenepic
70
71#endif
Class for representing color values.
Definition: color.h:19
Representation of a JSON value according to the specification at https://www.json....
Definition: json_value.h:30
Parameters of the shaders.
Definition: shading.h:15
static const Shading None()
A Shading value indication "no shading".
const Color & directional_light_color() const
bool is_none() const
Whether this is a "no shading" instance.
Shading(const Color &bg_color=Color(0, 0, 0), const Color &ambient_light_color=Color(0.7f, 0.7f, 0.7f), const Color &directional_light_color=Color(0.3f, 0.3f, 0.3f), const Vector &directional_light_dir=Vector(2, 1, 2))
Constructor.
Shading(const Color4 &bg_color, const Color &ambient_light_color, const Color &directional_light_color, const Vector &directional_light_dir)
Constructor.
const Vector & directional_light_dir() const
std::string to_string() const
Return a JSON string representing the object.
const Color4 & bg_color() const
JsonValue to_json() const
Convert this object into ScenePic json.
const Color & ambient_light_color() const
Definition: audio_track.h:14