View Source Image.Kernel (image v0.33.0)
Defines the known resampling kernels to which an image can be converted to and from.
Link to this section Summary
Functions
Returns the known colorspace interpretations
Normalizes and validates a resampling kernel.
Link to this section Types
@type t() :: :nearest | :mitchell | :linear | :lanczos3 | :lanczos2 | :cubic
Defines the known kernel resampling methods.
Link to this section Functions
Returns the known colorspace interpretations
Normalizes and validates a resampling kernel.
arguments
Arguments
kernel
is any atom or string value inImage.Kernel.known_kernel/0
.
returns
Returns
{:error, normalized_kernel}
or{:error, reason}
examples
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"}