-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathColorMapEditor.hpp
More file actions
59 lines (36 loc) · 999 Bytes
/
ColorMapEditor.hpp
File metadata and controls
59 lines (36 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef COLOR_MAP_EDITOR_HPP
#define COLOR_MAP_EDITOR_HPP
#include <stdint.h>
#include <QGLWidget>
#include "Color.hpp"
class ColorMapEditor : public QGLWidget
{
Q_OBJECT
public:
static const uint32_t resolution = 256;
enum Channel { Hue, Lum, Sat, Alpha };
enum Mode { Curve, Line };
ColorMapEditor( QWidget *parent=0 );
void initializeGL();
void resizeGL(int,int);
void paintGL();
Mode mode;
Channel channel;
RGBA8 rgba[resolution];
HLSAf hlsa[resolution];
void update_colors ();
void stroke( Channel, float, float, float, float );
void mousePressEvent( QMouseEvent *event );
void mouseMoveEvent( QMouseEvent *event );
void mouseReleaseEvent( QMouseEvent *event );
private:
void draw_channel(Channel chan);
void write_hlsa_to_rgba(int ibegin, int iend );
void write_rgba_to_hlsa( int ibegin, int iend );
double prev_x,prev_y;
GLuint bg_tex, color_tex;
bool colors_need_update;
signals:
void edited (RGBA8*);
};
#endif