Module exr::image::read

source ·
Expand description

Read an exr image.

For great flexibility and customization, use the read() function. The return value of the read() function must be further customized before reading a file.

For very simple applications, you can alternatively use one of these functions:

  1. read_first_rgba_layer_from_file(path, your_constructor, your_pixel_setter): You specify how to store the pixels. The first layer containing rgba channels is then loaded from the file. Fails if no rgba layer can be found.

  2. read_all_rgba_layers_from_file(path, your_constructor, your_pixel_setter): You specify how to store the pixels. All layers containing rgba channels are then loaded from the file. Fails if any layer in the image does not contain rgba channels.

  3. read_first_flat_layer_from_file(path): The first layer containing non-deep data with arbitrary channels is loaded from the file. Fails if no non-deep layer can be found.

  4. read_all_flat_layers_from_file(path): All layers containing non-deep data with arbitrary channels are loaded from the file. Fails if any layer in the image contains deep data.

  5. read_all_data_from_file(path): All layers with arbitrary channels and all resolution levels are extracted from the file.

    Note: Currently does not support deep data, and currently fails if any layer in the image contains deep data.

Modules

  • How to read arbitrary channels.
  • The last wrapper of image readers, finally containing the [from_file(path)] method. This completes the builder and reads a complete image.
  • How to read either a single or a list of layers.
  • How to read a set of resolution levels.
  • How to read samples (a grid of f32, f16 or u32 values).
  • How to read arbitrary but specific selection of arbitrary channels. This is not a zero-cost abstraction.

Structs

  • Utilizes the builder pattern to configure an image reader. This is the initial struct.

Functions

  • Create a reader which can be used to load an exr image. Allows you to exactly specify how to load the image, for example:
  • All resolution levels, all channels, all layers. Does not support deep data yet. Uses parallel decompression and relaxed error handling. Inspect the source code of this function if you need customization.
  • No deep data, no resolution levels, all channels, all layers. Uses parallel decompression and relaxed error handling. Inspect the source code of this function if you need customization.
  • No deep data, no resolution levels, rgba channels, all layers. If a single layer does not contain rgba data, this method returns an error. Uses parallel decompression and relaxed error handling. Create and Set can be closures, see the examples for more information. Inspect the source code of this function if you need customization. The alpha channel will contain the value 1.0 if no alpha channel can be found in the image.
  • No deep data, no resolution levels, all channels, first layer. Uses parallel decompression and relaxed error handling. Inspect the source code of this function if you need customization.
  • No deep data, no resolution levels, rgba channels, choosing the first layer with rgba channels. Uses parallel decompression and relaxed error handling. Create and Set can be closures, see the examples for more information. Inspect the source code of this function if you need customization. The alpha channel will contain the value 1.0 if no alpha channel can be found in the image.