Model loading · function
downscaleRgba
A box average from width×height down to outWidth×outHeight, four bytes a texel.
Explained in Importing models.
function downscaleRgba(rgba: Uint8Array, width: number, height: number, outWidth: number, outHeight: number): Uint8Arrayimport { downscaleRgba } from '@driftengine/assets';Parameters
| Parameter | Type | Description |
|---|---|---|
rgba | Uint8Array | |
width | number | |
height | number | |
outWidth | number | |
outHeight | number |
In depth
Each output texel averages the source rectangle it covers, rounded to nearest.