View Source Image.BandFormat (image v0.33.0)
Functions to define and validate the band formats of an image.
Link to this section Summary
Functions
Returns a list of the known band formats.
Validates a band format returning the band
format value required in the underlying
Vix
code.
Link to this section Types
@type t() ::
{:u, 8}
| {:s, 8}
| {:u, 16}
| {:s, 16}
| {:u, 32}
| {:s, 32}
| {:u, 64}
| {:s, 64}
| {:f, 32}
| {:f, 64}
Link to this section Functions
Returns the Image
format type for an
Nx
format type.
Image
uses the same type formats as Nx
so
this function is more a validation than a
conversion.
arguments
Arguments
- Any
Nx
type like{:u, 8}
.
returns
Returns
{:ok, band_format}
or{:error, reason}
Returns a list of the known band formats.
Returns the Nx
format type for an
Image
of image format type.
Image
uses the same type formats as Nx
so
this function is more a validation than a
conversion.
arguments
Arguments
- Any
t:Vimage.t/0
of format in the list returned byImage.BandFormat.known_band_formats/0
.
returns
Returns
{:ok, band_format}
or{:error, reason}
Validates a band format returning the band
format value required in the underlying
Vix
code.
arguments
Arguments
format
is any format returned byImage.BandFormat.known_band_formats/0
.
returns
Returns
{:ok, validated_foramt}
or{:error, reason}