comparison OrthancStone/Sources/Toolbox/Windowing.h @ 2169:fe5406abd43f

added separate class Windowing
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Oct 2024 15:40:34 +0200
parents
children
comparison
equal deleted inserted replaced
2168:14d6080660e7 2169:fe5406abd43f
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-2023 Osimis S.A., Belgium
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
21 **/
22
23
24 #pragma once
25
26 namespace OrthancStone
27 {
28 class Windowing
29 {
30 private:
31 double center_;
32 double width_;
33
34 public:
35 Windowing() :
36 center_(128),
37 width_(256)
38 {
39 }
40
41 Windowing(double center,
42 double width);
43
44 double GetCenter() const
45 {
46 return center_;
47 }
48
49 double GetWidth() const
50 {
51 return width_;
52 }
53
54 void GetBounds(double& low,
55 double& high) const;
56
57 bool IsNear(const Windowing& other) const;
58 };
59 }