Skip to main content

Module scale

Module scale 

Source
Expand description

Scaling the rendered frame to the window: area averaging when shrinking (supersampling anti-aliasing), and nearest / bilinear / sharp-bilinear when enlarging.

Structs§

Tap 🔒
Two neighbouring source samples and the blend weight between them.

Functions§

fit
Largest rectangle of aspect aw:ah centred in ww x wh: (x, y, w, h).
mix 🔒
resample
Resamples src (sw x sh, 0RGB) into the dw x dh rectangle at (ox, oy) of dst (row stride stride). Pixels of dst outside the rectangle are left alone.
resample_cols
Like resample, but the source is column-major (src[x * sh + y], the renderer’s native layout), so the frame never has to be transposed. Works on bands of output rows so every source column is read as short contiguous runs.