ScaleMode

type ScaleMode = "cover" | "contain"

The mode tells the GPU resize pipeline how to map the input image into the output bounds when the aspect ratio doesn't match.

  • 'cover': Fill the whole output and keep the input aspect ratio. This performs a centered crop on the longer source axis.
  • 'contain': Keep the full source image visible and preserve aspect ratio. This adds black bars (letterboxing/pillarboxing) where needed.