Image.Kernel (image v0.59.0)

View Source

Defines the known resampling kernels to which an image can be converted to and from.

Summary

Types

t()

Defines the known kernel resampling methods.

Functions

Returns the known colorspace interpretations

Normalizes and validates a resampling kernel.

Types

t()

@type t() :: :lanczos2 | :mitchell | :cubic | :linear | :lanczos3 | :nearest

Defines the known kernel resampling methods.

Functions

known_kernel()

Returns the known colorspace interpretations

validate_kernel(kernel)

Normalizes and validates a resampling kernel.

Arguments

Returns

  • {:error, normalized_kernel} or

  • {:error, reason}

Examples

iex> Image.Kernel.validate_kernel(:linear)
{:ok, :VIPS_KERNEL_LINEAR}

iex> Image.Kernel.validate_kernel(:VIPS_KERNEL_CUBIC)
{:ok, :VIPS_KERNEL_CUBIC}

iex> Image.Kernel.validate_kernel(:unknown)
{:error, "Unknown kernel. Found :unknown"}