![]() |
CS488 PA8
|
#include <ZBuffer.h>
Public Member Functions | |
| ZBuffer (int width, int height) | |
| ~ZBuffer () | |
| void | clear () |
| double | getPixel (int x, int y) |
| void | setPixel (int x, int y, double z) |
Private Attributes | |
| double ** | buffer |
| int | height |
| int | width |
| int | xMax |
| int | xMin |
| int | yMax |
| int | yMin |
A z-buffer (used for hidden line/surface removal).
A ZBuffer object uses Euclidean coordinates with (0,0) at the center.
| ZBuffer::ZBuffer | ( | int | width, |
| int | height | ||
| ) |
| ZBuffer::~ZBuffer | ( | ) |
Destructor.
| void ZBuffer::clear | ( | ) |
Clear this ZBuffer.
| double ZBuffer::getPixel | ( | int | x, |
| int | y | ||
| ) |
Get the z-value of the pixel at (x,y).
| x | The horizontal coordinate |
| y | The vertical coordinate |
| void ZBuffer::setPixel | ( | int | x, |
| int | y, | ||
| double | z | ||
| ) |
Set the z-value of the pixel at (x,y).
| x | The horizontal coordinate |
| y | The vertical coordinate |
| z | The z-value |
|
private |
The contents of the buffer.
|
private |
The height (in pixels).
|
private |
The width (in pixels).
|
private |
The maximum horizontal index.
|
private |
The minimum horizontal index.
|
private |
The maximum vertical index.
|
private |
The minimum vertical index.
1.8.13