cpe::image_drawable Class Reference

Specialized class of image where user can draw lines, triangles, ... More...

Inheritance diagram for cpe::image_drawable:
Inheritance graph
[legend]
Collaboration diagram for cpe::image_drawable:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 image_drawable ()
 empty constructor
 image_drawable (const unsigned int &N)
 create square picture of size NxN
 image_drawable (const unsigned int &Nx, const unsigned int &Ny)
 create picture of size Nx x Ny
 image_drawable (const std::string &filename)
 import pre-existing picture from file filename
void line (const p2d &u1, const p2d &u2, const color &c=color(255, 255, 255))
 draw line on image with uniform color
void line (const p2d &u1, const p2d &u2, const color &c1, const color &c2)
 draw line on image with interpolated color
void triangle (const p2d &u1, const p2d &u2, const p2d &u3, const color &c=color(255, 255, 255))
 draw triangle on image with uniform color
void triangle (const p2d &u1, const p2d &u2, const p2d &u3, const color &c1, const color &c2, const color &c3)
 draw line on image with interpolated color

Detailed Description

Specialized class of image where user can draw lines, triangles, ...


Constructor & Destructor Documentation

cpe::image_drawable::image_drawable (  ) 

empty constructor

cpe::image_drawable::image_drawable ( const unsigned int &  N  ) 

create square picture of size NxN

Parameters:
unsigned int N: size (width & height) of the picture
cpe::image_drawable::image_drawable ( const unsigned int &  Nx,
const unsigned int &  Ny 
)

create picture of size Nx x Ny

Parameters:
unsigned int Nx: picture width
unsigned int Ny: picture height
cpe::image_drawable::image_drawable ( const std::string &  filename  ) 

import pre-existing picture from file filename

Parameters:
std::string filename: path to the file to load

Member Function Documentation

void cpe::image_drawable::line ( const p2d u1,
const p2d u2,
const color c1,
const color c2 
)

draw line on image with interpolated color

References cpe::image::set_pixel().

Here is the call graph for this function:

void cpe::image_drawable::line ( const p2d u1,
const p2d u2,
const color c = color(255,255,255) 
)

draw line on image with uniform color

References cpe::algorithm::bresenham(), cpe::image::check_position(), and cpe::image::set_pixel().

Referenced by triangle().

Here is the call graph for this function:

void cpe::image_drawable::triangle ( const p2d u1,
const p2d u2,
const p2d u3,
const color c1,
const color c2,
const color c3 
)

draw line on image with interpolated color

References line().

Here is the call graph for this function:

void cpe::image_drawable::triangle ( const p2d u1,
const p2d u2,
const p2d u3,
const color c = color(255,255,255) 
)

draw triangle on image with uniform color

References line().

Here is the call graph for this function:


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