STIR  6.2.0
ZoomOptions.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2018-2019, University College London
3  This file is part of STIR.
4 
5  SPDX-License-Identifier: Apache-2.0
6 
7  See STIR/LICENSE.txt for details
8 */
9 
10 #ifndef __stir_ZOOMOPTIONS_H__
11 #define __stir_ZOOMOPTIONS_H__
12 
24 #include "stir/error.h"
25 
26 START_NAMESPACE_STIR
27 
42 {
43 public:
44  enum Scaling
45  {
46  preserve_sum,
47  preserve_values,
48  preserve_projections
49  };
51 
53  ZoomOptions(const Scaling v = preserve_sum)
54  : v(v)
55  {
56  // need to catch out-of-range in case somebody did a static_cast from an int (e.g. SWIG does)
57  if ((v < preserve_sum) || (v > preserve_projections))
58  error("ZoomOptions initialised with out-of-range value");
59  }
60  Scaling get_scaling_option() const { return v; }
61 
62 private:
63  Scaling v;
64 };
65 
66 END_NAMESPACE_STIR
67 
68 #endif // ZOOMOPTIONS_H
ZoomOptions(const Scaling v=preserve_sum)
constructor from Scaling
Definition: ZoomOptions.h:53
This class enables the user to choose between different zooming optionsThe 3 possible values determin...
Definition: ZoomOptions.h:41
Declaration of stir::error()
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition: error.cxx:42