Skip to main content

Module video_fit

Module video_fit 

Source
Expand description

<video> のフレームを要素の箱へ収める計算(object-fit: contain。純粋関数)。

Functions§

fit_contain
元 src_w × src_h を縦横比を保って box_w × box_h に収める。 戻り値は箱内の (x, y, w, h)(中央寄せ。余白は呼び出し側が黒で塗る)。