algorithm.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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