Specialized class of image where user can draw lines, triangles, ... More...
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 |
Specialized class of image where user can draw lines, triangles, ...
cpe::image_drawable::image_drawable | ( | ) |
empty constructor
cpe::image_drawable::image_drawable | ( | const unsigned int & | N | ) |
create square picture of size NxN
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
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
std::string | filename: path to the file to load |
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().
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().
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().
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().