View Source Image.ExtendMode (image v0.33.0)

Defines the known modes by which an image can be extended.

Link to this section Summary

Types

t()

Defines the known extend strategies.

Functions

Returns the known extend modes.

Normalizes and validates an extend mode.

Link to this section Types

@type t() :: :white | :repeat | :mirror | :copy | :black | :background

Defines the known extend strategies.

Link to this section Functions

Returns the known extend modes.

Normalizes and validates an extend mode.

arguments

Arguments

returns

Returns

  • {:error, normalized_extend_mode} or

  • {:error, reason}.

examples

Examples

iex> Image.Kernel.validate_extend(:black)
{:ok, :VIPS_EXTEND_BLACK}

iex> Image.Kernel.validate_extend(:VIPS_EXTEND_REPEAT)
{:ok, :VIPS_EXTEND_REPEAT}

iex> Image.Kernel.validate_extend(:unknown)
{:error, "Unknown extend mode. Found :unknown"}