Module prelude
Export the most important items from exrs.
Note: This includes a type called Result, possibly overwriting the
default std::Result type usage.
Modules
-
attribute
Contains all meta data attributes.
Each layer can have any number of
Attributes, including custom attributes. - 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>andset_pixel_in_vec::<YourPixelTuple>for reading a predefined pixel vector. Use the functionPixelVec::newto 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.
- traits Import this specifically if you want to be explicit but still use the extension traits.
- 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.
Samplescan currently only beFlatSamplesorLevels<FlatSamples> -
AnyChannels
A dynamic list of arbitrary channels.
Samplescan currently only beFlatSamplesorLevels<FlatSamples>. - ChannelDescription A single channel in an layer. Does not contain the actual pixel data, but instead merely describes it.
- CroppedChannels A smaller window into an existing pixel storage
- 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.
Layerscan be either a singleLayerorLayers. -
ImageAttributes
Includes mandatory fields like pixel aspect or display window
which must be the same for all layers.
For more attributes, see struct
LayerAttributes. -
IntegerBounds
A rectangular section anywhere in 2D integer space.
Valid from minimum coordinate (including)
-1,073,741,822to maximum coordinate (including)1,073,741,822, the value of (i32::MAX/2 -1). -
Layer
A single Layer, including fancy attributes and compression settings.
Channelscan be eitherSpecificChannelsorAnyChannels -
LayerAttributes
Does not include the attributes required for reading the file contents.
Excludes standard fields that must be the same for all headers.
For more attributes, see struct
ImageAttributes. - MetaData Contains the complete meta data of an exr image.
- ReadImage Specify whether to read the image in parallel, whether to use pedantic error handling, and a callback for the reading progress.
-
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.
Samplescan currently only beFlatSamples. - SmallVec
- SpecificChannels A grid of pixels. The pixels are written to your custom pixel storage.
-
SpecificChannelsBuilder
Used to construct a
SpecificChannels. Callwith_named_channelas many times as desired, and then callwith_pixelsto define the colors. - Text A byte array with each byte being a char. This is not UTF and it must be constructed from a standard string.
- TileDescription Describes how the layer is divided into tiles. Specifies the size of each tile in the image and whether this image contains multiple resolution levels.
- Vec2 Simple two-dimensional vector of any numerical type. Supports only few mathematical operations as this is used mainly as data struct.
- f16
Enums
- AttributeValue Contains one of all possible attributes. Includes a variant for custom attributes.
- Blocks How the image pixels are split up into separate blocks.
- Compression Specifies which compression method to use.
-
CropResult
Cropping an image fails if the image is fully transparent.
Use
or_crop_to_1x1_if_emptyoror_none_if_emptyto obtain a normal image again. - Error An error that may happen while reading or writing an exr file. Distinguishes between three types of errors: unsupported features, invalid data, and file system errors.
-
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,f32oru32. -
Levels
One or multiple resolution levels of the same image.
Samplescan beFlatSamples. -
LineOrder
In what order the
Blocks of pixel data appear in a file. - Sample A single red, green, blue, or alpha value.
- SampleType The type of samples in this channel.
Traits
-
ApplyCroppedView
Realize a cropped view of the original data,
by actually removing the unwanted original pixels,
reducing the memory consumption.
Currently not supported for
SpecificChannels. -
CheckDuplicates
This check can be executed at compile time
if the channel names are
&'static strand the compiler is smart enough. - Crop Crop some pixels ways when specifying a smaller rectangle
- CropWhere Crop away unwanted pixels from the border if they match the specified rule.
-
GetPixel
Define how to get a pixel from your custom pixel storage.
Can be a closure of type [
Sync + Fn(Vec2<usize>) -> YourPixel]. - InspectSample Inspect the pixels in this image to determine where to crop some away
- 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.
-
ReadChannels
A template that creates a
ChannelsReaderonce for all channels per layer. -
ReadLayers
A template that creates a
LayerReaderfor each layer in the file. -
ReadSamples
A template that creates a new
SampleReaderfor each channel in each layer. - ReadSpecificChannel Can be attached one more channel reader.
-
WritableImage
Enables an image to be written to a file. Call
image.write()where this trait is implemented.
Functions
- read Create a reader which can be used to load an exr image. Allows you to exactly specify how to load the image, for example:
- read_all_data_from_file All resolution levels, all channels, all layers.
- read_all_flat_layers_from_file 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.
- read_all_rgba_layers_from_file No deep data, no resolution levels, rgba channels, all layers.
- read_first_flat_layer_from_file 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.
- read_first_rgba_layer_from_file No deep data, no resolution levels, rgba channels, choosing the first layer with rgba channels.
- write_rgb_file An oversimplified function for "just write the damn file already" use cases.
- write_rgba_file An oversimplified function for "just write the damn file already" use cases.
Type Aliases
- 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.
Channelscan beSpecificChannelsorAnyChannels. -
LevelMaps
A list of resolution levels.
Samplescan currently only beFlatSamples. - 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.
- Result A result that may contain an exr error.
-
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 beNoneif 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.