# `Plushie.Canvas.Image`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/canvas/image.ex#L1)

Canvas raster image element with position, size, and optional rotation.

# `option`

```elixir
@type option() ::
  ((((({:source, String.t() | atom()} | {:x, number()}) | {:y, number()})
     | {:w, number()})
    | {:h, number()})
   | {:rotation, number() | {number(), :deg} | {number(), :rad}})
  | {:opacity, number()}
```

# `t`

```elixir
@type t() :: %Plushie.Canvas.Image{
  h:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  id: String.t() | nil,
  opacity:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  rotation:
    float()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  source:
    (String.t() | atom())
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  w:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  x:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  y:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil
}
```

# `build`

```elixir
@spec build(widget :: t()) :: Plushie.Widget.ui_node()
```

Converts this widget struct to a `ui_node()` map.

# `h`

```elixir
@spec h(widget :: t(), value :: number() | nil) :: t()
```

Height in pixels.

Accepts `number()`.

# `new`

# `new`

Creates a new element without an explicit ID (auto-assigned by parent container).

# `new`

Creates a new element with the given ID, positional args, and keyword options.

# `opacity`

```elixir
@spec opacity(widget :: t(), value :: number() | nil) :: t()
```

Opacity from 0.0 to 1.0.

Accepts `number()`.

# `rotation`

```elixir
@spec rotation(
  widget :: t(),
  value :: (number() | {number(), :deg} | {number(), :rad}) | nil
) :: t()
```

Rotation angle in degrees. Accepts `{value, :rad}` for radians.

Accepts `float()`.

# `source`

```elixir
@spec source(widget :: t(), value :: (String.t() | atom()) | nil) :: t()
```

Path to the image file.

Accepts `String.t() | atom()`.

# `type_name`

```elixir
@spec type_name() :: String.t()
```

Returns the element type string for the wire protocol.

# `w`

```elixir
@spec w(widget :: t(), value :: number() | nil) :: t()
```

Width in pixels.

Accepts `number()`.

# `with_options`

```elixir
@spec with_options(widget :: t(), opts :: [option()]) :: t()
```

Applies keyword options to an existing widget struct.

# `x`

```elixir
@spec x(widget :: t(), value :: number() | nil) :: t()
```

X position in pixels.

Accepts `number()`.

# `y`

```elixir
@spec y(widget :: t(), value :: number() | nil) :: t()
```

Y position in pixels.

Accepts `number()`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
