View Source Image.ExtendMode (image v0.47.0)

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

Summary

Types

t()

Defines the known extend strategies.

Functions

Returns the known extend modes.

Normalizes and validates an extend mode.

Types

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

Defines the known extend strategies.

Functions

Returns the known extend modes.

Normalizes and validates an extend mode.

Arguments

Returns

  • {:error, normalized_extend_mode} or

  • {:error, reason}.

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"}