algorithm.hpp

Go to the documentation of this file.
00001 /*
00002 **    TP 4ETI CPE Lyon
00003 **    Copyright (C) 2011 Damien Rohmer
00004 **
00005 **    This program is free software: you can redistribute it and/or modify
00006 **    it under the terms of the GNU General Public License as published by
00007 **    the Free Software Foundation, either version 3 of the License, or
00008 **    (at your option) any later version.
00009 **
00010 **   This program is distributed in the hope that it will be useful,
00011 **    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 **    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 **    GNU General Public License for more details.
00014 **
00015 **    You should have received a copy of the GNU General Public License
00016 **    along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 
00021 #ifndef _ALGORITHM_HPP_
00022 #define _ALGORITHM_HPP_
00023 
00024 #include <p2d.hpp>
00025 #include <vector>
00026 
00027 namespace cpe
00028 {
00029 
00030     struct pixel_interp;
00031     struct scanline_data;
00032 
00033 
00035     class algorithm
00036     {
00037     public:
00038 
00045         static std::vector<pixel_interp> bresenham(const p2d& u1,const p2d& u2);
00046 
00055         static void scanline_buffer(const std::vector<pixel_interp>& vec,const int& line_number,const int& x_min,std::vector<std::pair<scanline_data,scanline_data> >* buffer);
00056 
00057     };
00058 
00059 
00061     struct pixel_interp
00062     {
00064         pixel_interp(const p2d& _u,const double& _alpha):u(_u),alpha(_alpha){}
00065 
00067         p2d u;
00069         double alpha;
00070     };
00071 
00073     struct scanline_data
00074     {
00076         p2d u;
00078         double alpha;
00080         int line_index;
00081     };
00082 }
00083 
00084 
00085 #endif
Generated on Mon Apr 18 20:43:30 2011 by  doxygen 1.6.3