Image.Options.Embed (image v0.72.0)

Copy Markdown View Source

Options and option validation for Image.embed/4.

Summary

Types

Options applicable to Image.embed/4.

Options list for Image.embed/4.

How the generated border pixels are produced.

Types

embed_option()

@type embed_option() ::
  {:background, Image.BackgroundColor.spec() | nil}
  | {:extend_mode, extend_mode()}
  | {:x, non_neg_integer() | :center}
  | {:y, non_neg_integer() | :center}

Options applicable to Image.embed/4.

embed_options()

@type embed_options() :: [embed_option()]

Options list for Image.embed/4.

extend_mode()

@type extend_mode() :: :copy | :repeat | :mirror | :background

How the generated border pixels are produced.

  • :copy, :repeat and :mirror synthesize the border from the image content.
  • :background fills the border with the :background color. This is the default behavior when no :extend_mode is given, so passing it is only ever explicit documentation of intent. The color still comes from the :background option.

Functions

validate_options(image, width, height, options)

Validate the options for Image.embed/4.