#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/Image/Base/YUV422Value.hh" // This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2001, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here #ifndef RAVLIMAGE_YUV422VALUE_HEADER #define RAVLIMAGE_YUV422VALUE_HEADER 1 //////////////////////////////////////////////////////////////////// //! rcsid="$Id: YUV422Value.hh,v 1.5 2002/08/02 12:25:04 jonstarck Exp $" //! lib=RavlImage //! userlevel=Normal //! author="Charles Galambos" //! date="24/01/2001" //! docentry="Ravl.Images.Pixel Types" //! file="Ravl/Image/Base/YUV422Value.hh" #include "Ravl/TFVector.hh" namespace RavlImageN { using namespace RavlN; #if RAVL_VISUALCPP_NAMESPACE_BUG using RavlN::TFVectorC; using RavlN::BinIStreamC; using RavlN::BinOStreamC; #endif //! userlevel=Normal //: YUV422 Pixel base class. template class YUV422ValueC : public TFVectorC { public: YUV422ValueC() {} //: Default constructor. // Contents of pixels are left undefined. YUV422ValueC(const CompT &uv,const CompT &y) { data[0] =uv; data[1] = y; } //: Construct from components. inline const CompT &UV() const { return (*this)[0]; } //: Access u or v component. inline CompT &UV() { return (*this)[0]; } //: Access u or v component. inline const CompT &Y() const { return (*this)[1]; } //: Access Y component. inline CompT &Y() { return (*this)[1]; } //: Access Y component. }; template inline istream &operator>>(istream &strm,YUV422ValueC &val) { return strm >> ((TFVectorC &)(val)); } //: Stream input. template inline ostream &operator<<(ostream &strm,const YUV422ValueC &val) { return strm << ((const TFVectorC &)(val)); } //: Stream output. template inline BinIStreamC &operator>>(BinIStreamC &strm,YUV422ValueC &val) { return strm >> ((TFVectorC &)(val)); } //: Binary stream input. template inline BinOStreamC &operator<<(BinOStreamC &strm,const YUV422ValueC &val) { return strm << ((const TFVectorC &)(val)); } //: Binary stream output } #endif