plushie/widget/image

Image widget builder.

Types

Crop rectangle for image cropping (integer pixel values).

pub type Crop {
  Crop(x: Int, y: Int, width: Int, height: Int)
}

Constructors

  • Crop(x: Int, y: Int, width: Int, height: Int)
pub opaque type Image

Values

pub fn a11y(img: Image, a: a11y.A11y) -> Image

Set accessibility properties for this widget.

pub fn alt(img: Image, a: String) -> Image

Set the alt text for accessibility.

pub fn border_radius(img: Image, r: Float) -> Image

Set the border radius.

pub fn build(img: Image) -> node.Node

Build the image into a renderable Node.

pub fn content_fit(
  img: Image,
  cf: content_fit.ContentFit,
) -> Image

Set how content is fitted within the widget bounds.

pub fn crop(img: Image, c: Crop) -> Image

Set the crop rectangle.

pub fn decorative(img: Image, d: Bool) -> Image

Mark as decorative (ignored by screen readers).

pub fn description(img: Image, d: String) -> Image

Set the description text for accessibility.

pub fn expand(img: Image, e: Bool) -> Image

Set whether the image expands to fill available space.

pub fn filter_method(
  img: Image,
  f: filter_method.FilterMethod,
) -> Image

Set the image filter method.

pub fn height(img: Image, h: length.Length) -> Image

Set the height.

pub fn new(id: String, source: String) -> Image

Create a new image builder.

pub fn opacity(img: Image, o: Float) -> Image

Set the opacity (0.0 to 1.0).

pub fn rotation(img: Image, r: Float) -> Image

Set the rotation angle in radians.

pub fn scale(img: Image, s: Float) -> Image

Set the scale factor.

pub fn width(img: Image, w: length.Length) -> Image

Set the width.

Search Document