IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

map_output_to_input_coord

def map_output_to_input_coord(output_coord: Int, scale: Float32) -> Float32

Map output pixel coordinate to input coordinate using center alignment. This implements the standard coordinate mapping for image resizing: input_coord = (output_coord + 0.5) * scale - 0.5 The +0.5 and -0.5 terms ensure pixel centers are aligned properly. Args: output_coord: Output pixel coordinate. scale: Scale factor (input_size / output_size). Returns: Corresponding input coordinate as a float.

Returns:

Float32