glviewvol
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/xfermap.h Tue Dec 30 06:22:54 2014 +0200 1.3 @@ -0,0 +1,35 @@ 1.4 +#ifndef XFERMAP_H_ 1.5 +#define XFERMAP_H_ 1.6 + 1.7 +class TransferFunc { 1.8 +public: 1.9 + virtual ~TransferFunc(); 1.10 + 1.11 + virtual float map(float x) const = 0; 1.12 + virtual void map(float x, float *rgba_value) const = 0; 1.13 +}; 1.14 + 1.15 +class TransferWindow : public TransferFunc { 1.16 +private: 1.17 + float soft_rad; 1.18 + float low[4], high[4]; // rgb 1.19 + 1.20 +public: 1.21 + TransferWindow(); 1.22 + 1.23 + void set_interval(float a, float b); 1.24 + void set_interval(float *rgba_low, float *rgba_high); 1.25 + void set_interval_rgba(int channel, float a, float b); 1.26 + 1.27 + void get_interval(float *aptr, float *bptr) const; 1.28 + void get_interval_rgba(float *rgba_low, float *rgba_high) const; 1.29 + void get_interval_rgba(int channel, float *aptr, float *bptr) const; 1.30 + 1.31 + void set_soft_radius(float s); 1.32 + float get_soft_radius() const; 1.33 + 1.34 + float map(float x) const; 1.35 + void map(float x, float *rgba_value) const; 1.36 +}; 1.37 + 1.38 +#endif // XFERMAP_H_