pub trait Img {
// Required methods
fn renderer_id(&self, renderer: &ViewRenderer) -> ImageTextureId;
fn size(&self) -> PxSize;
// Provided method
fn alpha_type(&self) -> AlphaType { ... }
}
Expand description
A loaded or loading image.
This trait is an interface for the renderer into the image API used in the application.
The ideal image format is BGRA with pre-multiplied alpha.
Required Methods§
sourcefn renderer_id(&self, renderer: &ViewRenderer) -> ImageTextureId
fn renderer_id(&self, renderer: &ViewRenderer) -> ImageTextureId
Gets the image ID in the renderer
namespace.
The image must be loaded asynchronously by self
and does not need to
be loaded yet when the key is returned.
Provided Methods§
sourcefn alpha_type(&self) -> AlphaType
fn alpha_type(&self) -> AlphaType
Returns a value that indicates if the image is already pre-multiplied.
The faster option is pre-multiplied, that is also the default return value.