MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ cell_at()

uint32_t MayaFlux::Kinesis::Lattice1D::cell_at ( double  p) const
inlinenoexcept

Cell containing a value, clamped to the lattice.

Parameters
pValue. Values outside bounds clamp to the edge cell.

Definition at line 289 of file Lattice.hpp.

290 {
291 const double local = (p - bounds.min) / cell_size();
292 const double clamped = std::clamp(
293 std::floor(local), 0.0, static_cast<double>(resolution) - 1.0);
294 return static_cast<uint32_t>(clamped);
295 }
double cell_size() const noexcept
Width of one cell.
Definition Lattice.hpp:232
AABB1D bounds
Continuous extent subdivided.
Definition Lattice.hpp:229
uint32_t resolution
Cell count. Zero is invalid.
Definition Lattice.hpp:228

References bounds, cell_size(), MayaFlux::Kinesis::AABB1D::min, and resolution.

+ Here is the call graph for this function: