cgv
Loading...
Searching...
No Matches
image_drawable.h
1#pragma once
2
3#include <cgv/render/drawable.h>
4#include <cgv/render/shader_program.h>
5#include <cgv/render/vertex_buffer.h>
6#include <cgv/render/attribute_array_binding.h>
7
8#include "lib_begin.h"
9
10namespace cgv {
11 namespace render {
12 namespace gl {
13
15class CGV_API image_drawable : public drawable
16{
17protected:
18 std::vector<unsigned> tex_ids;
19 std::vector<float> durations;
20 unsigned current_image;
21 std::string file_name;
22 std::vector<std::string> files;
25
26 double start_time;
27 double anim_time;
28 double aspect;
29
30 bool animate;
31 bool use_blending;
32 bool wireframe;
33
34 float tess_level;
35
38
41
43 int W,H;
44
45 vec4 min_value;
46 vec4 max_value;
47 vec4 gamma4;
48
49 float checker_lambda, k1, k2, k3, k4, k5, k6, p1, p2, cx, cy, s;
50
51 // mixing
52 bool use_mixing;
53 unsigned mix_with;
54 float mix_param;
55
56 // sperical projection
57 bool spherical;
58 vec2 pan_tilt;
59 float scale;
60
62public:
66 void timer_event(double t, double dt);
68 bool read_image(const std::string& _file_name);
70 bool read_images(const std::string& _file_name, const std::vector<std::string>& _files);
72 bool save_images(const std::string& output_file_name);
74 unsigned get_nr_images() const { return (unsigned) tex_ids.size(); }
76 bool init(context&);
78 void draw(context&);
80 void clear(context&);
81};
82
83 }
84 }
85}
86
87#include <cgv/config/lib_end.h>
the attribute_array_binding allows to define vertex attributes (i.e.
base class for all drawables, which is independent of the used rendering API.
Definition context.h:621
base class for all drawables, which is independent of the used rendering API.
Definition drawable.h:15
base class of drawables that show static or animated images
unsigned get_nr_images() const
return the number of loaded subimages
bool show_selection
whether to show the selection rectangle
ibox2 selection
extent selection box
a shader program combines several shader code fragments to a complete definition of the shading pipel...
a vertex buffer is an unstructured memory block on the GPU.
the cgv namespace
Definition print.h:11