Skip to main content

IconDataExt

Trait IconDataExt 

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

Helpers for working with IconData.

Required Methods§

Source

fn to_image(&self) -> Result<RgbaImage, String>

Convert into image::RgbaImage

§Errors

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

Source

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

Encode as PNG.

§Errors

The image is invalid, or the PNG encoder failed.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IconDataExt for IconData

Implementors§