[][src]Module exr::image

Data structures that represent a complete exr image. Contains generic structs that must be nested to obtain a complete image type.

For example, an rgba image containing multiple layers can be represented using Image<Layers<RgbaChannels<MyPixelStorage>>>. An image containing a single layer with arbitrary channels and no deep data can be represented using Image<Layer<AnyChannels<FlatSamples>>>.

These and other predefined types are included in this module as

  1. RgbaImage: A single layer, rgb or rgba channels
  2. RgbaLayersImage: Multiple layers, rgb or rgba channels
  3. FlatImage: Multiple layers, any channels, no deep data.
  4. AnyImage: All supported data (multiple layers, arbitrary channels, no deep data yet)

You can also use your own types inside an image, for example if you want to use a custom sample storage.

Modules

crop

Crop away unwanted pixels. Includes automatic detection of bounding rectangle. Currently does not support deep data and resolution levels.

read

Read an exr image.

write

Write an exr image to a file.

Structs

AnyChannel

A single arbitrary channel. Samples can currently only be FlatSamples or Levels<FlatSamples>

AnyChannels

A full list of arbitrary channels, not just rgba. Samples can currently only be FlatSamples or Levels<FlatSamples>.

Encoding

How the pixels are split up and compressed.

FlatSampleIterator

Iterate over all channels of a single pixel in the image

Image

The complete exr image. Layers can be either a single Layer or Layers.

Layer

A single Layer, including fancy attributes and compression settings. Channels can be either RgbaChannels or AnyChannels

RgbaChannels

A grid of rgba pixels. The pixels are written to your custom pixel storage. PixelStorage can be anything, from a flat Vec<f16> to Vec<Vec<AnySample>>, as desired. In order to write this image to a file, your PixelStorage must implement GetRgbaPixel.

RgbaPixel

A single pixel with a red, green, blue, and alpha value. Each channel may have a different sample type.

RgbaSampleTypes

The sample type (f16, f32 or u32) of the rgba channels. The alpha channel is optional. The first channel is red, the second blue, the third green, and the fourth alpha.

RipMaps

In addition to the full resolution image, this layer also contains smaller versions, and each smaller version has further versions with varying aspect ratios. Samples can currently only be FlatSamples.

Enums

Blocks

How the image pixels are split up into separate blocks.

FlatSamples

A vector of non-deep values (one value per pixel per channel). Stores row after row in a single vector. The precision of all values is either f16, f32 or u32.

Levels

One or multiple resolution levels of the same image. Samples can be FlatSamples.

Traits

ContainsNaN

Check whether this contains any NaN value. This is required for comparing the equality of two images, as NaN never equals itself (nice!).

Type Definitions

AnyImage

This image type contains all supported exr features and can represent almost any image. It currently does not support deep data yet.

FlatImage

This image type contains the most common exr features and can represent almost any plain image. Does not contain resolution levels. Does not support deep data.

FlatSamplesPixel

A list of samples representing a single pixel. Does not heap allocate for images with 8 or fewer channels.

Layers

A list of layers. Channels can be RgbaChannels or AnyChannels.

LevelMaps

A list of resolution levels. Samples can currently only be FlatSamples.

RgbaImage

This image type contains only the most essential features and supports all exr images that could also be represented by a png or jpg file.

RgbaLayersImage

This image type contains only the most essential features and supports any exr image that could also be represented by a list of png or jpg layers.