pub struct ImageBrush<D = ImageData> {
pub image: D,
pub sampler: ImageSampler,
}Expand description
Describes the image content of a filled or stroked shape.
This type is generic over the storage used for the image data.
By default, the generic parameter is ImageData, which is a shared image with dynamic lifetime.
However, different renderers can use different types here, such as a pre-registered id.
Fields§
§image: DThe image to render.
sampler: ImageSamplerParameters which specify how to sample from the image during rendering.
Implementations§
Source§impl<D> ImageBrush<D>
impl<D> ImageBrush<D>
Sourcepub fn with_extend(self, mode: Extend) -> Self
pub fn with_extend(self, mode: Extend) -> Self
Builder method for setting the image extend mode in both directions.
Sourcepub fn with_x_extend(self, mode: Extend) -> Self
pub fn with_x_extend(self, mode: Extend) -> Self
Builder method for setting the image extend mode in the horizontal direction.
Sourcepub fn with_y_extend(self, mode: Extend) -> Self
pub fn with_y_extend(self, mode: Extend) -> Self
Builder method for setting the image extend mode in the vertical direction.
Sourcepub fn with_quality(self, quality: ImageQuality) -> Self
pub fn with_quality(self, quality: ImageQuality) -> Self
Builder method for setting a hint for the desired image quality when rendering.
Sourcepub fn with_alpha(self, alpha: f32) -> Self
pub fn with_alpha(self, alpha: f32) -> Self
Returns the image with the alpha multiplier set to alpha.
Sourcepub fn multiply_alpha(self, alpha: f32) -> Self
pub fn multiply_alpha(self, alpha: f32) -> Self
Returns the image with the alpha multiplier multiplied again by alpha.
The behaviour of this transformation is undefined if alpha is negative.
Source§impl ImageBrush
impl ImageBrush
Source§impl ImageBrush<&ImageData>
impl ImageBrush<&ImageData>
Sourcepub fn to_owned(&self) -> ImageBrush
pub fn to_owned(&self) -> ImageBrush
Converts the ImageBrushRef to an owned ImageBrush.
Trait Implementations§
Source§impl<D: Clone> Clone for ImageBrush<D>
impl<D: Clone> Clone for ImageBrush<D>
Source§fn clone(&self) -> ImageBrush<D>
fn clone(&self) -> ImageBrush<D>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more