KWStyle - itkRedPixelAccessor.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkRedPixelAccessor.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:46 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16 =========================================================================*/
17 #ifndef __itkRedPixelAccessor_h
18 #define __itkRedPixelAccessor_h
19
20
21 #include "itkRGBPixel.h"
22
23
24 namespace itk
25 {
26
27 /** \class RedPixelAccessor
28  * \brief Give access to the red component of a RGBPixel type 
29  *
30  * This class is intended to be used as parameter of 
31  * an ImageAdaptor to make an RGBPixel image appear as being
32  * of scalar type T, showing only the Red component.
33  *
34  * \sa ImageAdaptor
35  * \ingroup ImageAdaptors
36  */
37
38 template <class T>
39 class ITK_EXPORT RedPixelAccessor
40 {
41 public:
42   /** Standard class typedefs. */
43   typedef   RedPixelAccessor        Self;
44
45 IND */** External typedef. It defines the external aspect
46    * that this class will exhibit */
47   typedef T ExternalType;
48
49   /** Internal typedef. It defines the internal real
50    * representation of data */
51   typedef     RGBPixel<T>      InternalType;
52
53   /** Write access to the Red component */
54   inline void Set( InternalType & output, const ExternalType & input ) const
55     { output.SetRed( input ); }
56
57   /** Read access to the Red component */
58   inline const ExternalType & Get( const InternalType & input ) const
59     { return input.GetRed(); }
60 };
61
62   
63   
64 }  // end namespace itk
65
66
67 #endif
68
69 EOF

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:40PM
© Kitware Inc.