Code: Select all
float& At(int x, int y)
{
assert(x >= 0);
assert(x < width);
assert(y >= 0);
assert(y < height);
return pBuffer[y * width + x];
}
const float& At(int x, int y) const
{
return const_cast<ZBuffer*>(this)->At(x, y);
}
Code: Select all
float& At(int x, int y)
{
assert(x >= 0);
assert(x < width);
assert(y >= 0);
assert(y < height);
return pBuffer[y * width + x];
}
const float& At(int x, int y) const
{
return const_cast<ZBuffer*>(this)->At(x, y);
}