comparison Framework/Scene2D/LookupTableStyleConfigurator.h @ 1080:287ec78f63b4

GenericToolbox (fast c-string --> double or integer) + refactoring to be able to set structures lut into configurator + fixed missing revision bump in configurator + UT
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 21 Oct 2019 16:01:29 +0200
parents aead999345e0
children 177e7d431cd1 2d8ab34c8c91
comparison
equal deleted inserted replaced
1072:391fb6d6905d 1080:287ec78f63b4
11 * 11 *
12 * This program is distributed in the hope that it will be useful, but 12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details. 15 * Affero General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Affero General Public License 17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/ 19 **/
20 20
21 21
31 This configurator supplies an API to set a display range and a LUT. 31 This configurator supplies an API to set a display range and a LUT.
32 */ 32 */
33 class LookupTableStyleConfigurator : public ILayerStyleConfigurator 33 class LookupTableStyleConfigurator : public ILayerStyleConfigurator
34 { 34 {
35 private: 35 private:
36 uint64_t revision_; 36 uint64_t revision_;
37 bool hasLut_; 37 bool hasLut_;
38 std::string lut_; 38 std::vector<uint8_t> lut_;
39 bool hasRange_; 39 bool hasRange_;
40 float minValue_; 40 float minValue_;
41 float maxValue_; 41 float maxValue_;
42 42
43 public: 43 public:
44 LookupTableStyleConfigurator(); 44 LookupTableStyleConfigurator();
45 45
46 void SetLookupTable(Orthanc::EmbeddedResources::FileResourceId resource); 46 void SetLookupTable(Orthanc::EmbeddedResources::FileResourceId resource);
47 47
48 void SetLookupTable(const std::string& lut); 48 void SetLookupTable(const std::string& lut);
49 49
50 void SetRange(float minValue, 50 /**
51 float maxValue); 51 See the SetLookupTable(const std::vector<uint8_t>& lut) method in the
52 LookupTableTextureSceneLayer class.
53 */
54 void SetLookupTable(const std::vector<uint8_t>& lut);
55
56 void SetRange(float minValue, float maxValue);
52 57
53 virtual uint64_t GetRevision() const 58 virtual uint64_t GetRevision() const
54 { 59 {
55 return revision_; 60 return revision_;
56 } 61 }
57 62
58 virtual TextureBaseSceneLayer* CreateTextureFromImage(const Orthanc::ImageAccessor& image) const; 63 virtual TextureBaseSceneLayer* CreateTextureFromImage(const Orthanc::ImageAccessor& image) const;
59 64
60 virtual TextureBaseSceneLayer* CreateTextureFromDicom(const Orthanc::ImageAccessor& frame, 65 virtual TextureBaseSceneLayer* CreateTextureFromDicom(const Orthanc::ImageAccessor& frame,
61 const DicomInstanceParameters& parameters) const 66 const DicomInstanceParameters& parameters) const
62 { 67 {
63 return parameters.CreateLookupTableTexture(frame); 68 return parameters.CreateLookupTableTexture(frame);
64 } 69 }
65 70
66 virtual void ApplyStyle(ISceneLayer& layer) const; 71 virtual void ApplyStyle(ISceneLayer& layer) const;