Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/ColorSceneLayer.h @ 584:434ceeb0bcab
layers: InfoPanel, Polyline, Texture
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 19 Apr 2019 17:36:00 +0200 |
parents | |
children | 500c3f70b6c2 |
comparison
equal
deleted
inserted
replaced
583:f9ac154c5a63 | 584:434ceeb0bcab |
---|---|
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 "ISceneLayer.h" | |
25 | |
26 #include <stdint.h> | |
27 | |
28 namespace OrthancStone | |
29 { | |
30 class ColorSceneLayer : public ISceneLayer | |
31 { | |
32 private: | |
33 uint8_t red_; | |
34 uint8_t green_; | |
35 uint8_t blue_; | |
36 | |
37 public: | |
38 ColorSceneLayer() : | |
39 red_(255), | |
40 green_(255), | |
41 blue_(255) | |
42 { | |
43 } | |
44 | |
45 void SetColor(uint8_t red, | |
46 uint8_t green, | |
47 uint8_t blue) | |
48 { | |
49 red_ = red; | |
50 green_ = green; | |
51 blue_ = blue; | |
52 } | |
53 | |
54 uint8_t GetRed() const | |
55 { | |
56 return red_; | |
57 } | |
58 | |
59 uint8_t GetGreen() const | |
60 { | |
61 return green_; | |
62 } | |
63 | |
64 uint8_t GetBlue() const | |
65 { | |
66 return blue_; | |
67 } | |
68 | |
69 float GetRedAsFloat() const | |
70 { | |
71 return static_cast<float>(red_) / 255.0f; | |
72 } | |
73 | |
74 float GetGreenAsFloat() const | |
75 { | |
76 return static_cast<float>(green_) / 255.0f; | |
77 } | |
78 | |
79 float GetBlueAsFloat() const | |
80 { | |
81 return static_cast<float>(blue_) / 255.0f; | |
82 } | |
83 }; | |
84 } |