#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/Image/Base/YUVAValue.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 RAVLYUVAVALUE_HEADER #define RAVLYUVAVALUE_HEADER //////////////////////////////////////////////////////////////////// //! rcsid="$Id: YUVAValue.hh,v 1.3 2001/07/10 12:58:35 vap-james Exp $" //! file="Ravl/Image/Base/YUVAValue.hh" //! lib=RavlImage //! userlevel=Normal //! author="Charles Galambos" //! date="24/01/2001" //! docentry="Ravl.Images.Pixel Types" #include "Ravl/TFVector.hh" namespace RavlImageN { using namespace RavlN; #if RAVL_VISUALCPP_NAMESPACE_BUG using RavlN::BinIStreamC; using RavlN::BinOStreamC; using RavlN::TFVectorC; #endif //! userlevel=Normal //: YUVA Pixel base class. template class YUVAValueC : public TFVectorC { public: YUVAValueC() {} //: Default constructor. // Creates an undefined value. YUVAValueC(const CompT &y,const CompT &u,const CompT &v,const CompT &a) { data[0] =y; data[1] =u; data[2] =v; data[3] =a; } //: Construct from component values. YUVAValueC(const TFVectorC &v) : TFVectorC(v) {} //: Constructor from base class. template YUVAValueC(YUVAValueC &oth) { data[0] = oth.Y(); data[1] = oth.U(); data[2] = oth.V(); } //: Construct from another component type. inline const CompT & Y() const { return data[0]; } // Returns the level of the Y component. inline const CompT & U() const { return data[1]; } // Returns the level of the U component. inline const CompT & V() const { return data[2]; } // Returns the level of the V component. inline const CompT & A() const { return data[3]; } // Returns the level of the V component. inline CompT & Y() { return data[0]; } // Returns the level of the Y component. inline CompT & U() { return data[1]; } // Returns the level of the U component. inline CompT & V() { return data[2]; } // Returns the level of the V component. inline CompT & A() { return data[3]; } // Returns the level of the V component. }; template inline istream &operator>>(istream &strm,YUVAValueC &val) { return strm >> ((TFVectorC &)(val)); } //: Stream input. template inline ostream &operator<<(ostream &strm,const YUVAValueC &val) { return strm << ((const TFVectorC &)(val)); } //: Stream output. template inline BinIStreamC &operator>>(BinIStreamC &strm,YUVAValueC &val) { return strm >> ((TFVectorC &)(val)); } //: Binary stream input. template inline BinOStreamC &operator<<(BinOStreamC &strm,const YUVAValueC &val) { return strm << ((const TFVectorC &)(val)); } //: Binary stream output } #endif