- // Due to roundoff errors, the test against 0.5 is seldom exact,
- // even though we test for less than and not less-than-or-equal.
- // We'd rather keep an extra border pixel in those very rare cases
- // (where the image is shifted pretty much exactly a half-pixel)
- // than losing a pixel in the common cases of integer shift.
- // Thus the 1e-3 fudge factors.
- float texcoord_min[2] = {
- float((0.5f - 1e-3) / input_width),
- float((0.5f - 1e-3) / input_height)
+ float normalized_coords_to_texels[2] = {
+ float(input_width), float(input_height)