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 /* 00023 Authors: Ansgar Philippsen, Andreas Schenk 00024 */ 00025 00026 #ifndef IMG_GUI_VIEWER_NORMALIZER_HH 00027 #define IMG_GUI_VIEWER_NORMALIZER_HH 00028 00029 00030 #include <boost/shared_ptr.hpp> 00031 #include <ost/img/normalizer_impl.hh> 00032 00033 #include <ost/gui/module_config.hh> 00034 00035 00036 namespace ost { namespace img { namespace gui { 00037 00038 class DLLEXPORT_OST_GUI ViewerNormalizer: public NormalizerImpl, 00039 public RangeHandler 00040 { 00041 public: 00042 ViewerNormalizer(); 00043 ViewerNormalizer(Real mininput, Real maxinput, Real minoutput, 00044 Real maxoutput, Real gamma, bool invert); 00045 ViewerNormalizer(const ViewerNormalizer& n); 00046 virtual ~ViewerNormalizer(); 00047 00048 00049 // normalizer interface 00050 virtual Real BackConvert(Real v) const; 00051 virtual Complex BackConvert(Complex v) const; 00052 virtual Real Convert(Real v) const; 00053 virtual Complex Convert(Complex v) const; 00054 virtual NormalizerImpl* Clone() const {return new ViewerNormalizer((*this));} 00055 00056 Real GetGamma(); 00057 bool GetInvert(); 00058 00059 private: 00060 Real p1_; 00061 Real p2_; 00062 Real p3_; 00063 00064 Real gamma_; 00065 Real invert_sign_; 00066 Real clipmax_; 00067 }; 00068 00069 typedef boost::shared_ptr<ViewerNormalizer> ViewerNormalizerPtr; 00070 00071 00072 }}} //ns 00073 00074 #endif