cpe::algorithm Class Reference

Helper class to perform Bresenham and Scanline algorithm. More...

List of all members.

Static Public Member Functions

static std::vector< pixel_interpbresenham (const p2d &u1, const p2d &u2)
 Bresenham algorithm between pixels u1 and u2.
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)
 fill the scanline data buffer for a given pixel_interp vector

Detailed Description

Helper class to perform Bresenham and Scanline algorithm.


Member Function Documentation

std::vector< pixel_interp > cpe::algorithm::bresenham ( const p2d u1,
const p2d u2 
) [static]

Bresenham algorithm between pixels u1 and u2.

Parameters:
p2d u1: starting pixel coordinates of the segment
p2d u1: ending pixel coordinates of the segment
Returns:
vector of pixel-coordinates + relative position in the segment

Referenced by cpe::image_drawable::line().

void cpe::algorithm::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 
) [static]

fill the scanline data buffer for a given pixel_interp vector

Parameters:
std::vector<pixel_interp> vec: vector of pixel positions+relative position: given by the output of bresenham algorithm
int line_number: edge number of the corresponding triangle
int x_min: offset position for minimal x-position of the triangle
std::vector<pair<scanline_data,scanline_data> >* buffer: pointer to the scanline data for y_min/y_max value
Note:
buffer must be initialized to the size x_max-x_min+1

The documentation for this class was generated from the following files:
Generated on Mon Apr 18 20:43:33 2011 by  doxygen 1.6.3