STIR 6.4.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
23
24#include "stir/error.h"
25
26START_NAMESPACE_STIR
27
40
42{
43public:
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
62private:
63 Scaling v;
64};
65
66END_NAMESPACE_STIR
67
68#endif // ZOOMOPTIONS_H
ZoomOptions(const Scaling v=preserve_sum)
constructor from Scaling
Definition ZoomOptions.h:53
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