MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / Lightmap

Class Lightmap

source/base/StarCellularLighting.hpp:16–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14STAR_EXCEPTION(LightmapException, StarException);
15
16class Lightmap {
17public:
18 Lightmap();
19 Lightmap(unsigned width, unsigned height);
20 Lightmap(Lightmap const& lightMap);
21 Lightmap(Lightmap&& lightMap) noexcept;
22
23 Lightmap& operator=(Lightmap const& lightMap);
24 Lightmap& operator=(Lightmap&& lightMap) noexcept;
25
26 operator ImageView();
27
28 void set(unsigned x, unsigned y, float v);
29 void set(unsigned x, unsigned y, Vec3F const& v);
30 void add(unsigned x, unsigned y, Vec3F const& v);
31 Vec3F get(unsigned x, unsigned y) const;
32
33 bool empty() const;
34
35 Vec2U size() const;
36 unsigned width() const;
37 unsigned height() const;
38 float* data();
39
40private:
41 size_t len() const;
42
43 std::unique_ptr<float[]> m_data;
44 unsigned m_width;
45 unsigned m_height;
46};
47
48inline void Lightmap::set(unsigned x, unsigned y, float v) {
49 if (x >= m_width || y >= m_height) {

Callers 1

calculateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected