Crate ispc_downsampler
source ·Structs§
- Describes a source image which can be used for
downsample()
The pixel data is stored as a slice to avoid unnecessarily cloning it.
Enums§
Functions§
- Samples the provided image down to the specified width and height.
target_width
andtarget_height
are expected to be less than or equal to theirsrc
counter parts. Will panic if the target dimensions are the same as the source image’s. - Downsamples an image that is meant to be used as a normal map. Uses a box filter instead of a lanczos filter, and normalizes each pixel to preserve unit length for the normals after downsampling.
- Version of downsample which allows for a custom filter scale, thus trading between speed and final image quality.
- Scales the alpha to the downscaled texture to preserve the overall alpha coverage.