Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/LookupTableTextureSceneLayer.h @ 769:4ba8892870a2
improved interface for lookup tables
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 23 May 2019 20:37:19 +0200 |
parents | 55411e7da2f7 |
children | 287ec78f63b4 |
comparison
equal
deleted
inserted
replaced
768:55411e7da2f7 | 769:4ba8892870a2 |
---|---|
31 ImageWindowing windowing_; | 31 ImageWindowing windowing_; |
32 float minValue_; | 32 float minValue_; |
33 float maxValue_; | 33 float maxValue_; |
34 std::vector<uint8_t> lut_; | 34 std::vector<uint8_t> lut_; |
35 | 35 |
36 void SetLookupTableRgb(const std::vector<uint8_t>& lut); | |
37 | |
36 public: | 38 public: |
37 // The pixel format must be "Flot32" | 39 // The pixel format must be convertible to Float32 |
38 LookupTableTextureSceneLayer(const Orthanc::ImageAccessor& texture); | 40 LookupTableTextureSceneLayer(const Orthanc::ImageAccessor& texture); |
39 | 41 |
40 void SetLookupTableGrayscale(float alpha); | 42 void SetLookupTableGrayscale(); |
41 | |
42 void SetLookupTableRgb(const std::vector<uint8_t>& lut, | |
43 float alpha); | |
44 | 43 |
45 void SetLookupTableRgb(const std::string& lut, | 44 // The vector must contain either 3 * 256 values (RGB), or 4 * 256 |
46 float alpha); | 45 // (RGBA). In the RGB case, an alpha channel will be automatically added. |
47 | |
48 void SetLookupTable(const std::vector<uint8_t>& lut); | 46 void SetLookupTable(const std::vector<uint8_t>& lut); |
49 | 47 |
50 void SetLookupTable(const std::string& lut); | 48 void SetLookupTable(const std::string& lut); |
51 | 49 |
52 void SetRange(float minValue, | 50 void SetRange(float minValue, |
62 float GetMaxValue() const | 60 float GetMaxValue() const |
63 { | 61 { |
64 return maxValue_; | 62 return maxValue_; |
65 } | 63 } |
66 | 64 |
65 // This returns a vector of 4 * 256 values between 0 and 255, in RGBA. | |
67 const std::vector<uint8_t>& GetLookupTable() const | 66 const std::vector<uint8_t>& GetLookupTable() const |
68 { | 67 { |
69 return lut_; | 68 return lut_; |
70 } | 69 } |
71 | 70 |