papyrus logo

yuva.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the papyrus library.                             *
00006  *                                                                         *
00007  *   papyrus is free software; you can redistribute it and/or modify       *
00008  *   it under the terms of the GNU Lesser General Public License           *
00009  *   version 3.0 as published by the Free Software Foundation.             *
00010  *                                                                         *
00011  *   papyrus is distributed in the hope that it will be useful,            *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Lesser General Public License version 3.0 for more details.       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with the papyrus library. If not, see                   *
00018  *   <http://www.gnu.org/licenses/>.                                       *
00019  ***************************************************************************/
00020 #ifndef PAPYRUSYUVA_H
00021 #define PAPYRUSYUVA_H
00022 
00023 namespace Papyrus {
00024 
00025 class RGBA;
00026 
00031 struct YUVA {
00032   YUVA(double yuv_y=0.0, double yuv_u=0.0, double yuv_v=0.0, double yuv_a=1.0);
00033 
00034   YUVA(const RGBA& rgb);
00035 
00036   double y, u, v, alpha;
00037 
00038   double operator[](unsigned index);
00039 
00040   YUVA& operator=(const RGBA& rgb);
00041 
00042   operator RGBA();
00043 
00044 
00045   };
00046 
00047   void rgb_to_yuv(double rgb_r, double rgb_g, double rgb_b,
00048                   double& yuv_y, double& yuv_u, double& yuv_v);
00049 
00050   void yuv_to_rgb(double yuv_y, double yuv_u, double yuv_v,
00051                   double& rgb_r, double& rgb_g, double& rgb_b);
00052 
00053 
00054 }
00055 
00056 #endif

Generated on Fri Apr 16 12:40:11 2010 for papyrus by doxygen 1.6.1