View Source Image.Interpretation (image v0.32.0)

Defines the known color interpretations to which an image can be converted to and from.

Link to this section Summary

Types

t()

Defines the known colorspace interpretations.

Functions

Returns the known colorspace interpretations

Normalizes and validates a color interpretation.

Link to this section Types

@type t() ::
  :yxy
  | :xyz
  | :srgb
  | :scrgb
  | :rgb16
  | :rbg
  | :multiband
  | :matrix
  | :lch
  | :labs
  | :labq
  | :lab
  | :hsv
  | :histogram
  | :grey16
  | :fourier
  | :cmyk
  | :cmc
  | :bw

Defines the known colorspace interpretations.

Link to this section Functions

Returns the known colorspace interpretations

Link to this function

validate_interpretation(interpretation)

View Source

Normalizes and validates a color interpretation.

arguments

Arguments

returns

Returns

  • {:error, normalized_interpretation} or

  • {:error, reason}

examples

Examples

iex> Image.Interpretation.validate_interpretation(:bw)
{:ok, :VIPS_INTERPRETATION_B_W}

iex> Image.Interpretation.validate_interpretation(:VIPS_INTERPRETATION_sRGB)
{:ok, :VIPS_INTERPRETATION_sRGB}

iex> Image.Interpretation.validate_interpretation(:unknown)
{:error, "Unknown interpretation. Found :unknown"}