4
* These classes provide tools to compute interesting objects relative to light
5
* sources. Each class provides a constructor converting information contained
6
* in a sp light object into information useful in the current setting, a
7
* method to get the light vector (at a given point) and a method to get the
8
* light color components (at a given point).
11
#include <gdk/gdktypes.h>
12
#include "display/nr-3dutils.h"
13
#include "display/nr-light-types.h"
14
#include <2geom/forward.h>
16
struct SPFeDistantLight;
17
struct SPFePointLight;
34
* \param light the sp light object
35
* \param lighting_color the lighting_color used
37
DistantLight(SPFeDistantLight *light, guint32 lighting_color);
38
virtual ~DistantLight();
41
* Computes the light vector of the distant light
43
* \param v a Fvector referece where we store the result
45
void light_vector(NR::Fvector &v);
48
* Computes the light components of the distant light
50
* \param lc a Fvector referece where we store the result, X=R, Y=G, Z=B
52
void light_components(NR::Fvector &lc);
56
gdouble azimuth; //azimuth in rad
57
gdouble elevation; //elevation in rad
65
* \param light the sp light object
66
* \param lighting_color the lighting_color used
67
* \param trans the transformation between absolute coordinate (those
68
* employed in the sp light object) and current coordinate (those
69
* employed in the rendering)
71
PointLight(SPFePointLight *light, guint32 lighting_color, const Geom::Matrix &trans);
72
virtual ~PointLight();
74
* Computes the light vector of the distant light at point (x,y,z).
75
* x, y and z are given in the arena_item coordinate, they are used as
78
* \param v a Fvector referece where we store the result
79
* \param x x coordinate of the current point
80
* \param y y coordinate of the current point
81
* \param z z coordinate of the current point
83
void light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z);
86
* Computes the light components of the distant light
88
* \param lc a Fvector referece where we store the result, X=R, Y=G, Z=B
90
void light_components(NR::Fvector &lc);
94
//light position coordinates in render setting
105
* \param light the sp light object
106
* \param lighting_color the lighting_color used
107
* \param trans the transformation between absolute coordinate (those
108
* employed in the sp light object) and current coordinate (those
109
* employed in the rendering)
111
SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::Matrix &trans);
112
virtual ~SpotLight();
115
* Computes the light vector of the distant light at point (x,y,z).
116
* x, y and z are given in the arena_item coordinate, they are used as
119
* \param v a Fvector referece where we store the result
120
* \param x x coordinate of the current point
121
* \param y y coordinate of the current point
122
* \param z z coordinate of the current point
124
void light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z);
127
* Computes the light components of the distant light at the current
128
* point. We only need the light vector to compute theses
130
* \param lc a Fvector referece where we store the result, X=R, Y=G, Z=B
131
* \param L the light vector of the current point
133
void light_components(NR::Fvector &lc, const NR::Fvector &L);
137
//light position coordinates in render setting
141
gdouble cos_lca; //cos of the limiting cone angle
142
gdouble speExp; //specular exponent;
143
NR::Fvector S; //unit vector from light position in the direction
148
} /* namespace Filters */
149
} /* namespace Inkscape */
151
#endif // __NR_LIGHT_H__
155
c-file-style:"stroustrup"
156
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
161
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :