comparison Framework/Scene2D/LookupTableTextureSceneLayer.h @ 768:55411e7da2f7

LookupTableTextureSceneLayer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 23 May 2019 20:04:33 +0200
parents
children 4ba8892870a2
comparison
equal deleted inserted replaced
767:dce5b067d040 768:55411e7da2f7
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Affero General Public License
9 * as published by the Free Software Foundation, either version 3 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details.
16 *
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/>.
19 **/
20
21
22 #pragma once
23
24 #include "TextureBaseSceneLayer.h"
25
26 namespace OrthancStone
27 {
28 class LookupTableTextureSceneLayer : public TextureBaseSceneLayer
29 {
30 private:
31 ImageWindowing windowing_;
32 float minValue_;
33 float maxValue_;
34 std::vector<uint8_t> lut_;
35
36 public:
37 // The pixel format must be "Flot32"
38 LookupTableTextureSceneLayer(const Orthanc::ImageAccessor& texture);
39
40 void SetLookupTableGrayscale(float alpha);
41
42 void SetLookupTableRgb(const std::vector<uint8_t>& lut,
43 float alpha);
44
45 void SetLookupTableRgb(const std::string& lut,
46 float alpha);
47
48 void SetLookupTable(const std::vector<uint8_t>& lut);
49
50 void SetLookupTable(const std::string& lut);
51
52 void SetRange(float minValue,
53 float maxValue);
54
55 void FitRange();
56
57 float GetMinValue() const
58 {
59 return minValue_;
60 }
61
62 float GetMaxValue() const
63 {
64 return maxValue_;
65 }
66
67 const std::vector<uint8_t>& GetLookupTable() const
68 {
69 return lut_;
70 }
71
72 virtual ISceneLayer* Clone() const;
73
74 virtual Type GetType() const
75 {
76 return Type_LookupTableTexture;
77 }
78 };
79 }