00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2011 by the OpenStructure authors 00005 // Copyright (C) 2003-2010 by the IPLT authors 00006 // 00007 // This library is free software; you can redistribute it and/or modify it under 00008 // the terms of the GNU Lesser General Public License as published by the Free 00009 // Software Foundation; either version 3.0 of the License, or (at your option) 00010 // any later version. 00011 // This library is distributed in the hope that it will be useful, but WITHOUT 00012 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00014 // details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public License 00017 // along with this library; if not, write to the Free Software Foundation, Inc., 00018 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 //------------------------------------------------------------------------------ 00020 00021 /* 00022 Authors: Ansgar Philippsen, Andreas Schenk 00023 */ 00024 00025 #ifndef IMG_NORM_LINEAR_H 00026 #define IMG_NORM_LINEAR_H 00027 00028 #include <ost/img/normalizer_impl.hh> 00029 #include <ost/img/alg/module_config.hh> 00030 namespace ost { namespace img { namespace alg { 00031 00033 class DLLEXPORT_IMG_ALG LinearNormalizer: public NormalizerImpl { 00034 public: 00035 // ctor 00036 LinearNormalizer(); 00037 LinearNormalizer(Real scale, Real offset); 00038 // copy ctor 00039 LinearNormalizer(const LinearNormalizer& n); 00040 virtual ~LinearNormalizer() {} 00041 00042 // normalizer interface 00043 virtual Real BackConvert(Real v) const; 00044 virtual Complex BackConvert(Complex v) const; 00045 virtual Real Convert(Real v) const; 00046 virtual Complex Convert(Complex v) const; 00047 virtual NormalizerImpl* Clone() const {return new LinearNormalizer((*this));} 00048 00049 private: 00050 Real scale_; 00051 Real offset_; 00052 }; 00053 00054 class DLLEXPORT_IMG_ALG LinearRangeNormalizer: public LinearNormalizer, public RangeHandler { 00055 public: 00056 // ctor 00057 LinearRangeNormalizer(); 00058 LinearRangeNormalizer(Real inputmin, Real inputmax, Real outputmin, Real outputmax); 00059 // copy ctor 00060 LinearRangeNormalizer(const LinearRangeNormalizer& n); 00061 virtual ~LinearRangeNormalizer() {} 00062 00063 // normalizer interface 00064 virtual NormalizerImpl* Clone() const {return new LinearRangeNormalizer((*this));} 00065 virtual Real BackConvert(Real v) const; 00066 virtual Complex BackConvert(Complex v) const; 00067 virtual Real Convert(Real v) const; 00068 virtual Complex Convert(Complex v) const; 00069 }; 00070 00071 }}} // namespaces 00072 00073 #endif