Module image::math::utils

source ·
Expand description

Shared mathematical utility functions.

Functions§

  • Calculates the width and height an image should be resized to. This preserves aspect ratio, and based on the fill parameter will either fill the dimensions to fit inside the smaller constraint (will overflow the specified bounds on one axis to preserve aspect ratio), or will shrink so that both dimensions are completely contained within the given width and height, with empty space on one axis.