glviewvol

view src/xfermap.h @ 6:f22be47a3572

moved to TransferFuncs completely
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 30 Dec 2014 06:22:54 +0200
parents
children 71b479ffb9f7
line source
1 #ifndef XFERMAP_H_
2 #define XFERMAP_H_
4 class TransferFunc {
5 public:
6 virtual ~TransferFunc();
8 virtual float map(float x) const = 0;
9 virtual void map(float x, float *rgba_value) const = 0;
10 };
12 class TransferWindow : public TransferFunc {
13 private:
14 float soft_rad;
15 float low[4], high[4]; // rgb
17 public:
18 TransferWindow();
20 void set_interval(float a, float b);
21 void set_interval(float *rgba_low, float *rgba_high);
22 void set_interval_rgba(int channel, float a, float b);
24 void get_interval(float *aptr, float *bptr) const;
25 void get_interval_rgba(float *rgba_low, float *rgba_high) const;
26 void get_interval_rgba(int channel, float *aptr, float *bptr) const;
28 void set_soft_radius(float s);
29 float get_soft_radius() const;
31 float map(float x) const;
32 void map(float x, float *rgba_value) const;
33 };
35 #endif // XFERMAP_H_