gtsam_points
Loading...
Searching...
No Matches
gridmap.hpp
Go to the documentation of this file.
1#ifndef GLK_GRIDMAP_HPP
2#define GLK_GRIDMAP_HPP
3
4#include <memory>
5#include <glk/drawable.hpp>
6
7namespace glk {
8
9class Texture;
10
11class GridMap : public Drawable {
12public:
13 enum class ColorMode { RAW = 0, TURBO, PROB, PROB_TURBO, RGBA };
14
15 GridMap(double resolution, int width, int height, const unsigned char* values, int alpha = 255, ColorMode mode = ColorMode::PROB);
16 GridMap(double resolution, int width, int height, float scale, const float* values, float alpha = 1.0f, ColorMode mode = ColorMode::PROB);
17 virtual ~GridMap();
18
19 virtual void draw(glk::GLSLShader& shader) const override;
20
21 void update_color(int width, int height, const unsigned char* values, int alpha = 255, ColorMode mode = ColorMode::PROB);
22 void update_color(const unsigned char* values, int alpha = 255, ColorMode mode = ColorMode::PROB);
23 void update_color(int width, int height, float scale, const float* values, float alpha = 1.0f, ColorMode mode = ColorMode::PROB);
24 void update_color(float scale, const float* values, float alpha = 1.0f, ColorMode mode = ColorMode::PROB);
25
26private:
27 GridMap(const GridMap&);
28 GridMap& operator=(const GridMap&);
29
30 void init_vao(double resolution, int width, int height);
31
32private:
33 GLuint vao;
34 GLuint vbo;
35 GLuint tbo;
36 std::unique_ptr<Texture> texture;
37};
38
39} // namespace glk
40
41#endif
Definition drawable.hpp:12
Definition glsl_shader.hpp:20
Definition gridmap.hpp:11
void update_color(int width, int height, const unsigned char *values, int alpha=255, ColorMode mode=ColorMode::PROB)
void update_color(int width, int height, float scale, const float *values, float alpha=1.0f, ColorMode mode=ColorMode::PROB)
virtual void draw(glk::GLSLShader &shader) const override
ColorMode
Definition gridmap.hpp:13
GridMap(double resolution, int width, int height, const unsigned char *values, int alpha=255, ColorMode mode=ColorMode::PROB)
virtual ~GridMap()
void update_color(float scale, const float *values, float alpha=1.0f, ColorMode mode=ColorMode::PROB)
void update_color(const unsigned char *values, int alpha=255, ColorMode mode=ColorMode::PROB)
GridMap(double resolution, int width, int height, float scale, const float *values, float alpha=1.0f, ColorMode mode=ColorMode::PROB)
Definition async_buffer_copy.hpp:6
std::enable_if_t< needs_aligned_allocator< T >::value, std::shared_ptr< T > > make_shared(Args &&... args)
Definition make_shared.hpp:20