Trait rerun::external::eframe::icon_data::IconDataExt

pub trait IconDataExt {
    // Required methods
    fn to_image(&self) -> Result<ImageBuffer<Rgba<u8>, Vec<u8>>, String>;
    fn to_png_bytes(&self) -> Result<Vec<u8>, String>;
}
Expand description

Helpers for working with IconData.

Required Methods§

fn to_image(&self) -> Result<ImageBuffer<Rgba<u8>, Vec<u8>>, String>

Convert into image::RgbaImage

§Errors

If width*height != 4 * rgba.len(), or if the image is too big.

fn to_png_bytes(&self) -> Result<Vec<u8>, String>

Encode as PNG.

§Errors

The image is invalid, or the PNG encoder failed.

Implementors§