Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkAddPixelAccessor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAddPixelAccessor.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006-03-16 11:43:26 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkAddPixelAccessor_h
00018 #define __itkAddPixelAccessor_h
00019 
00020 
00021 namespace itk
00022 {
00023 namespace Accessor
00024 {
00025 
00037 template <class TPixel>
00038 class ITK_EXPORT AddPixelAccessor
00039 {
00040 public:
00042   typedef   AddPixelAccessor        Self;
00043 
00046   typedef     TPixel      ExternalType;
00047 
00050   typedef     TPixel      InternalType;
00051 
00053   inline void Set( InternalType & output, const ExternalType & input ) const
00054     { output = static_cast<InternalType>( input - m_Value ); }
00055 
00057   inline ExternalType Get( const InternalType & input ) const
00058     { return static_cast<ExternalType>( input + m_Value ); }
00059 
00061   void SetValue( TPixel newvalue )
00062     { m_Value = newvalue; }
00063 
00065   TPixel GetValue() 
00066     { return m_Value; }
00067 
00069   Self & operator=( const Self & apa )
00070     { 
00071     this->m_Value = apa.m_Value;
00072     return *this; 
00073     }
00074 
00076   AddPixelAccessor():m_Value( NumericTraits<TPixel>::Zero ) {}
00077   AddPixelAccessor( const Self & apa ):m_Value(apa.m_Value) {}
00079 
00080 private:
00081 
00082   TPixel m_Value;
00083 
00084 };
00085 
00086   
00087   
00088 }  // end namespace Accessor
00089 }  // end namespace itk
00090 
00091 
00092 #endif
00093 

Generated at Tue Sep 15 02:06:42 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000