waft-test 0.10.1

Test scaffolding for Waft: a platform and a view to run an App under
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Pixels encoded as a PNG to look at, by the framework's encoder (`waft_embedder::encode_png`),
//! the same on every machine.

use waft_embedder::valo::PixelBuffer;

/// `pixels`, as `Platform::read_image_pixels` reads them back, encoded as a PNG's bytes, for a
/// test to write to a file.
///
/// # Panics
///
/// Panics if the encoder fails.
pub fn encode_png(pixels: &PixelBuffer) -> Vec<u8> {
    waft_embedder::encode_png(pixels).expect("pixels encode as a PNG")
}