Class to manage a depth-buffer. More...
Collaboration diagram for cpe::z_buffer:Public Member Functions | |
| z_buffer () | |
| Constructor with size=0. More... | |
| z_buffer (int size) | |
| Constructor with square picture of size: size*size. More... | |
| z_buffer (int size_x, int size_y) | |
| Constructor with square picture of given size. More... | |
| void | fill (double value) |
| fill the z-buffe with special value More... | |
| double | operator() (const pos2 &u) const |
| Accessor of value of the z-buffer. More... | |
| double & | operator() (const pos2 &u) |
| Accessor of value of the z-buffer. More... | |
| double | get_max () const |
| return the max value of the z-buffer (eliminating the infinity value) More... | |
| double | get_min () const |
| return the min value of the z-buffer More... | |
| int | size_x () const |
| size of the z-buffer in x More... | |
| int | size_y () const |
| size of the z-buffer in y More... | |
| void | export_file (const std::string &filename) const |
| write the z-buffer as an image into a file More... | |
Protected Member Functions | |
| int | coordinate_to_index (const pos2 &u) const |
| convert (x,y) coordinate to index More... | |
| void | assert_position (const pos2 &u) const |
| check if u is in bounds of the picture More... | |
Private Attributes | |
| std::vector< double > | internal_data |
| check internal data More... | |
| int | internal_size_x |
| size x of the z-buffer More... | |
| int | internal_size_y |
| size y of the z-buffer More... | |
Static Private Attributes | |
| static const double | depth_infinity =9e5 |
| infinity value More... | |
Class to manage a depth-buffer.
| cpe::z_buffer::z_buffer | ( | ) |
Constructor with size=0.
| cpe::z_buffer::z_buffer | ( | int | size | ) |
Constructor with square picture of size: size*size.
References depth_infinity, and fill().
Here is the call graph for this function:| cpe::z_buffer::z_buffer | ( | int | size_x, |
| int | size_y | ||
| ) |
Constructor with square picture of given size.
References depth_infinity, and fill().
Here is the call graph for this function:
|
protected |
check if u is in bounds of the picture
References internal_size_x, internal_size_y, MACRO_EXCEPTION_PARAMETER, cpe::pos2::x(), and cpe::pos2::y().
Referenced by operator()().
Here is the call graph for this function:
|
protected |
convert (x,y) coordinate to index
References internal_size_x, cpe::pos2::x(), and cpe::pos2::y().
Referenced by operator()().
Here is the call graph for this function:| void cpe::z_buffer::export_file | ( | const std::string & | filename | ) | const |
write the z-buffer as an image into a file
References cpe::export_ppm().
Here is the call graph for this function:| void cpe::z_buffer::fill | ( | double | value | ) |
| double cpe::z_buffer::get_max | ( | ) | const |
return the max value of the z-buffer (eliminating the infinity value)
References depth_infinity, and internal_data.
Referenced by cpe::export_ppm().
| double cpe::z_buffer::get_min | ( | ) | const |
return the min value of the z-buffer
References depth_infinity, and internal_data.
Referenced by cpe::export_ppm().
| double cpe::z_buffer::operator() | ( | const pos2 & | u | ) | const |
Accessor of value of the z-buffer.
References assert_position(), coordinate_to_index(), and internal_data.
Here is the call graph for this function:| double & cpe::z_buffer::operator() | ( | const pos2 & | u | ) |
Accessor of value of the z-buffer.
References assert_position(), coordinate_to_index(), and internal_data.
Here is the call graph for this function:| int cpe::z_buffer::size_x | ( | ) | const |
| int cpe::z_buffer::size_y | ( | ) | const |
|
staticprivate |
infinity value
Referenced by get_max(), get_min(), and z_buffer().
|
private |
check internal data
Referenced by fill(), get_max(), get_min(), and operator()().
|
private |
size x of the z-buffer
Referenced by assert_position(), coordinate_to_index(), and size_x().
|
private |
size y of the z-buffer
Referenced by assert_position(), and size_y().