View Source Image.ExtendMode (image v0.54.4)
Defines the known modes by which an image can be extended.
Summary
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
extend
is any atom or string value inImage.ExtendMode.known_extend_modes/0
.
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"}