Module exr::image[][src]

Expand description

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<SpecificChannels<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. PixelImage: A single layer, fixed set of arbitrary channels.
  2. PixelLayersImage: Multiple layers, fixed set of arbitrary channels.
  3. RgbaImage: A single layer, fixed set of channels: rgb, optional a.
  4. RgbaLayersImage: Multiple layers, fixed set of channels: rgb, optional a.
  5. FlatImage: Multiple layers, any channels, no deep data.
  6. 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.

This is the high-level interface for the pixels of an image. See exr::blocks module for a low-level interface.

Modules

crop

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

pixel_vec

Provides a predefined pixel storage. Currently only contains a simple flattened vector storage. Use the functions create_pixel_vec::<YourPixelTuple> and set_pixel_in_vec::<YourPixelTuple> for reading a predefined pixel vector. Use the function PixelVec::new to create a pixel vector which can be written to a file.

read

Read an exr image.

recursive

A generic wrapper which can be used to represent recursive types. Supports conversion from and to tuples of the same size.

validate_results

Compare the result of a round trip test with the original method. Supports lossy compression methods.

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 dynamic list of arbitrary channels. 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 SpecificChannels or AnyChannels

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.

SpecificChannels

A grid of 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 GetPixel.

SpecificChannelsBuilder

Used to construct a SpecificChannels. Call with_named_channel as many times as desired, and then call with_pixels to define the colors.

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

CheckDuplicates

This check can be executed at compile time if the channel names are &'static str and the compiler is smart enough.

IntoSample

Convert this type into one of the known sample types. Also specify the preferred native type, which dictates the default sample type in the image.

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 SpecificChannels or AnyChannels.

LevelMaps

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

PixelImage

This image type contains a single layer containing a user-defined type of pixels.

PixelLayersImage

This image type contains multiple layers, with each layer containing a user-defined type of pixels.

RgbChannels

Contains information about the channels in an rgb image, in the order (red, green, blue).

RgbaChannels

Contains information about the channels in an rgba image, in the order (red, green, blue, alpha). The alpha channel is not required. May be None if the image did not contain an alpha channel.

RgbaImage

This image type contains a single layer containing a user-defined type of rgba pixels.

RgbaLayersImage

This image type contains multiple layers, with each layer containing a user-defined type of rgba pixels.