| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkGreenPixelAccessor.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:36 $ |
| 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 __itkGreenPixelAccessor_h |
| 18 |
|
#define __itkGreenPixelAccessor_h |
| 19 |
|
|
| 20 |
|
|
| 21 |
|
#include "itkRGBPixel.h" |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
namespace itk |
| 25 |
|
{ |
| 26 |
|
|
| 27 |
|
/** |
| 28 |
|
* \class GreenPixelAccessor |
| 29 |
|
* \brief Give access to the Green component of a RGBPixel type |
| 30 |
|
* |
| 31 |
|
* This class is intended to be used as parameter of |
| 32 |
|
* an ImageAdaptor to make an RGBPixel image appear as being |
| 33 |
|
* of scalar type T, showing only the Green component. |
| 34 |
|
* |
| 35 |
|
* \sa ImageAdaptor |
| 36 |
|
* |
| 37 |
|
* \ingroup ImageAdaptors |
| 38 |
|
* |
| 39 |
|
*/ |
| 40 |
|
|
| 41 |
|
template <class T> |
| 42 |
|
class ITK_EXPORT GreenPixelAccessor |
| 43 |
|
{ |
| 44 |
|
public: |
| 45 |
|
/** Standard class typedefs. */ |
| 46 |
|
typedef GreenPixelAccessor Self; |
| 47 |
|
|
| 48 |
|
/** External typedef. It defines the external aspect |
| 49 |
|
* that this class will exhibit */ |
| 50 |
|
typedef T ExternalType; |
| 51 |
|
|
| 52 |
|
/** Internal typedef. It defines the internal real |
| 53 |
|
* representation of data */ |
| 54 |
|
typedef RGBPixel<T> InternalType; |
| 55 |
|
|
| 56 |
|
/** Write access to the Green component */ |
| 57 |
|
inline void Set( InternalType & output, const ExternalType & input ) const |
| 58 |
|
{ output.SetGreen( input ); } |
| 59 |
|
|
| 60 |
|
/** Read access to the Green component */ |
| 61 |
|
inline const ExternalType & Get( const InternalType & input ) const |
| 62 |
|
{ return input.GetGreen(); } |
| 63 |
|
|
| 64 |
|
}; |
| 65 |
|
|
| 66 |
|
|
| 67 |
|
} // end namespace itk |
| 68 |
|
|
| 69 |
|
#endif |
| 70 |
|
|
| 71 |
EOF |
|