Skip to main content

ImageResampler

Type Alias ImageResampler 

Source
pub type ImageResampler = fn(&Arc<RenderImage>, usize, Size<DevicePixels>) -> Option<Arc<RenderImage>>;
Expand description

vue-native: a host’s smaller copy of an image that is about to be drawn well below its own size.

The sprite atlas keeps one mip level and samples it LINEARLY, so a 1080 px picture drawn at 40 px reads a 2×2 neighbourhood out of every 27×27 block and aliases. Window::paint_image asks this function first, with the image, the frame, and the size in device pixels the frame is about to be drawn at; Some is drawn instead (its frame 0), from its own atlas tile. None draws the image as it is. Called during paint, so it must be cheap whenever it says None.