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: 2002/10/11 20:34:09 $
00007   Version:   $Revision: 1.1 $
00008 
00009   Copyright (c) 2002 Insight 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 
00022 namespace itk
00023 {
00024 namespace Accessor
00025 {
00026 
00038 template <class TPixel>
00039 class ITK_EXPORT AddPixelAccessor
00040 {
00041 public:
00043   typedef   AddPixelAccessor        Self;
00044 
00047   typedef     TPixel      ExternalType;
00048 
00051   typedef     TPixel      InternalType;
00052 
00054   inline void Set( InternalType & output, const ExternalType & input ) const
00055     { output = static_cast<InternalType>( input - m_Value ); }
00056 
00058   inline ExternalType Get( const InternalType & input ) const
00059     { return static_cast<ExternalType>( input + m_Value ); }
00060 
00062   void SetValue( TPixel newvalue )
00063     { m_Value = newvalue; }
00064 
00066   TPixel GetValue() 
00067     { return m_Value; }
00068 
00070   Self & operator=( const Self & apa )
00071     { this->m_Value = apa.m_Value;
00072       return *this; }
00073 
00075   AddPixelAccessor():m_Value( NumericTraits<TPixel>::Zero ) {}
00076   AddPixelAccessor( const Self & apa ):m_Value(apa.m_Value) {}
00077   
00078 private:
00079 
00080   TPixel m_Value;
00081 
00082 };
00083 
00084   
00085   
00086 }  // end namespace Accessor
00087 }  // end namespace itk
00088 
00089 
00090 #endif
00091 

Generated at Fri May 21 01:14:23 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000