Struct exr::image::Image

source ·
pub struct Image<Layers> {
    pub attributes: ImageAttributes,
    pub layer_data: Layers,
}
Expand description

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

Fields§

§attributes: ImageAttributes

Attributes that apply to the whole image file. These attributes appear in each layer of the file. Excludes technical meta data. Each layer in this image also has its own attributes.

§layer_data: Layers

The layers contained in the image file. Can be either a single Layer or a list of layers.

Implementations§

source§

impl<'s, LayerData> Image<LayerData>where LayerData: WritableLayers<'s> + 's,

source

pub fn new(image_attributes: ImageAttributes, layer_data: LayerData) -> Self

Create an image with one or multiple layers. The layer can be a Layer, or Layers small vector, or Vec<Layer> or &[Layer].

source§

impl<'s, Channels> Image<Layers<Channels>>where Channels: WritableChannels<'s> + 's,

source

pub fn from_layers( image_attributes: ImageAttributes, layer_data: impl Into<Layers<Channels>> ) -> Self

Create an image with multiple layers. The layer can be a Vec<Layer> or Layers (a small vector).

source§

impl<'s, ChannelData> Image<Layer<ChannelData>>where ChannelData: WritableChannels<'s> + 's,

source

pub fn from_layer(layer: Layer<ChannelData>) -> Self

Uses the display position and size to the channel position and size of the layer.

source

pub fn from_encoded_channels( size: impl Into<Vec2<usize>>, encoding: Encoding, channels: ChannelData ) -> Self

Uses empty attributes.

source

pub fn from_channels( size: impl Into<Vec2<usize>>, channels: ChannelData ) -> Self

Uses empty attributes and fast compression.

source§

impl Image<NoneMore>

source

pub fn empty(attributes: ImageAttributes) -> Self

Create an empty image, to be filled with layers later on. Add at least one layer to obtain a valid image. Call with_layer(another_layer) for each layer you want to add to this image.

source§

impl<'s, InnerLayers> Image<InnerLayers>where InnerLayers: WritableLayers<'s> + 's,

source

pub fn with_layer<NewChannels>( self, layer: Layer<NewChannels> ) -> Image<Recursive<InnerLayers, Layer<NewChannels>>>where NewChannels: 's + WritableChannels<'s>,

Add another layer to this image. The layer type does not have to equal the existing layers in this image.

Trait Implementations§

source§

impl<Layers: Clone> Clone for Image<Layers>

source§

fn clone(&self) -> Image<Layers>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Layers: Debug> Debug for Image<Layers>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Layers: PartialEq> PartialEq<Image<Layers>> for Image<Layers>

source§

fn eq(&self, other: &Image<Layers>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<C> ValidateResult for Image<C>where C: ValidateResult,

source§

fn validate_result( &self, other: &Self, options: ValidationOptions, location: impl Fn() -> String ) -> ValidationResult

Compare self with the other. Exceptional behaviour: Read more
source§

fn assert_equals_result(&self, result: &Self)

Compare self with the other. Panics if not equal. Read more
source§

impl<'img, WritableLayers> WritableImage<'img, WritableLayers> for &'img Image<WritableLayers>

source§

fn write(self) -> WriteImageWithOptions<'img, WritableLayers, fn(_: f64)>

Create a temporary writer which can be configured and used to write the image to a file.
source§

impl<Layers> StructuralPartialEq for Image<Layers>

Auto Trait Implementations§

§

impl<Layers> RefUnwindSafe for Image<Layers>where Layers: RefUnwindSafe,

§

impl<Layers> Send for Image<Layers>where Layers: Send,

§

impl<Layers> Sync for Image<Layers>where Layers: Sync,

§

impl<Layers> Unpin for Image<Layers>where Layers: Unpin,

§

impl<Layers> UnwindSafe for Image<Layers>where Layers: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.