Single-precision mapping from target pixels to source texels for nearest image sampling.
More...
Single-precision mapping from target pixels to source texels for nearest image sampling.
| std::optional< NearestTexelRows > donner::geode::NearestTexelRowsFor |
( |
const Transform2d & | targetFromTexel | ) |
|
Inverts targetFromTexel the way the software renderer's image sampler does: the transform is first narrowed to single precision, then inverted with that sampler's algorithm (a single precision reciprocal for scale and translation, otherwise a double precision determinant with each coefficient rounded once).
Sampling the same pixel centers through these rows then selects the same texels as the software renderer wherever a texel boundary passes through a pixel center, up to the floating-point contraction of the final multiply-add.
- Parameters
-
| targetFromTexel | Transform from source texel coordinates to target pixels. |
- Returns
- The rows, or std::nullopt when the narrowed transform is not invertible.