ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRGBToVectorPixelAccessor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkRGBToVectorPixelAccessor_h
00019 #define __itkRGBToVectorPixelAccessor_h
00020 
00021 #include "itkRGBPixel.h"
00022 #include "itkVector.h"
00023 
00024 namespace itk
00025 {
00026 namespace Accessor
00027 {
00042 template< class T >
00043 class ITK_EXPORT RGBToVectorPixelAccessor
00044 {
00045 public:
00047   typedef   RGBToVectorPixelAccessor Self;
00048 
00051   typedef  Vector< T, 3 > ExternalType;
00052 
00055   typedef   RGBPixel< T > InternalType;
00056 
00058   inline void Set(InternalType & output, const ExternalType & input) const
00059   {
00060     output[0] = input[0];
00061     output[1] = input[1];
00062     output[2] = input[2];
00063   }
00064 
00066   inline ExternalType Get(const InternalType & input) const
00067   {
00068     ExternalType v( input.GetDataPointer() );
00069     return v;
00070   }
00072 
00073 private:
00074 };
00075 }  // end namespace Accessor
00076 }  // end namespace itk
00077 
00078 #endif
00079