Camera pixel coordinate abstraction for tiled rendering. More...
#include <BufferIndexing.h>
Public Member Functions | |
| HELIOS_HOST_DEVICE | PixelCoordinate (uint x_coord, uint y_coord) |
| Construct pixel coordinate from global x, y. | |
| size_t | toFlatIndex (const helios::int2 &full_resolution) const |
| Convert to flat array index (row-major) | |
Data Fields | |
| uint | x |
| Global x-coordinate (column index) | |
| uint | y |
| Global y-coordinate (row index) | |
Camera pixel coordinate abstraction for tiled rendering.
Encapsulates the tile offset + coordinate mapping + flattening complexity. Prevents x/y swapping, wrong offset, wrong resolution variable errors.
This helper makes it impossible to:
Usage in CUDA camera ray generation:
Historical bugs prevented:
Definition at line 363 of file BufferIndexing.h.
|
inline |
Construct pixel coordinate from global x, y.
Definition at line 369 of file BufferIndexing.h.
|
inline |
Convert to flat array index (row-major)
| full_resolution | Global camera resolution (width, height) |
Definition at line 384 of file BufferIndexing.h.
| uint PixelCoordinate::x |
Global x-coordinate (column index)
Definition at line 364 of file BufferIndexing.h.
| uint PixelCoordinate::y |
Global y-coordinate (row index)
Definition at line 365 of file BufferIndexing.h.