Enum exr::meta::attribute::AttributeValue

source ·
pub enum AttributeValue {
Show 25 variants ChannelList(ChannelList), Chromaticities(Chromaticities), Compression(Compression), EnvironmentMap(EnvironmentMap), KeyCode(KeyCode), LineOrder(LineOrder), Matrix3x3(Matrix3x3), Matrix4x4(Matrix4x4), Preview(Preview), Rational(Rational), BlockType(BlockType), TextVector(Vec<Text>), TileDescription(TileDescription), TimeCode(TimeCode), Text(Text), F64(f64), F32(f32), I32(i32), IntegerBounds(IntegerBounds), FloatRect(FloatRect), IntVec2(Vec2<i32>), FloatVec2(Vec2<f32>), IntVec3((i32, i32, i32)), FloatVec3((f32, f32, f32)), Custom { kind: Text, bytes: Vec<u8>, },
}
Expand description

Contains one of all possible attributes. Includes a variant for custom attributes.

Variants§

§

ChannelList(ChannelList)

Channel meta data.

§

Chromaticities(Chromaticities)

Color space definition.

§

Compression(Compression)

Compression method of this layer.

§

EnvironmentMap(EnvironmentMap)

This image is an environment map.

§

KeyCode(KeyCode)

Film roll information.

§

LineOrder(LineOrder)

Order of the bocks in the file.

§

Matrix3x3(Matrix3x3)

A 3x3 matrix of floats.

§

Matrix4x4(Matrix4x4)

A 4x4 matrix of floats.

§

Preview(Preview)

8-bit rgba Preview of the image.

§

Rational(Rational)

An integer dividend and divisor.

§

BlockType(BlockType)

Deep or flat and tiled or scan line.

§

TextVector(Vec<Text>)

List of texts.

§

TileDescription(TileDescription)

How to tile up the image.

§

TimeCode(TimeCode)

Timepoint and more.

§

Text(Text)

A string of byte-chars.

§

F64(f64)

64-bit float

§

F32(f32)

32-bit float

§

I32(i32)

32-bit signed integer

§

IntegerBounds(IntegerBounds)

2D integer rectangle.

§

FloatRect(FloatRect)

2D float rectangle.

§

IntVec2(Vec2<i32>)

2D integer vector.

§

FloatVec2(Vec2<f32>)

2D float vector.

§

IntVec3((i32, i32, i32))

3D integer vector.

§

FloatVec3((f32, f32, f32))

3D float vector.

§

Custom

A custom attribute. Contains the type name of this value.

Fields

§kind: Text

The name of the type this attribute is an instance of.

§bytes: Vec<u8>

The value, stored in little-endian byte order, of the value. Use the exr::io::Data trait to extract binary values from this vector.

Implementations§

source§

impl AttributeValue

source

pub fn byte_size(&self) -> usize

Number of bytes this would consume in an exr file.

source

pub fn kind_name(&self) -> &TextSlice

The exr name string of the type that an attribute can have.

source

pub fn write<W: Write>(&self, write: &mut W) -> UnitResult

Without validation, write this instance to the byte stream.

source

pub fn read( read: &mut PeekRead<impl Read>, kind: Text, byte_size: usize, ) -> Result<Result<Self>>

Read the value without validating. Returns Ok(Ok(attribute)) for valid attributes. Returns Ok(Err(Error)) for invalid attributes from a valid byte source. Returns Err(Error) for invalid byte sources, for example for invalid files.

source

pub fn validate( &self, allow_sampling: bool, data_window: IntegerBounds, strict: bool, ) -> UnitResult

Validate this instance.

source

pub fn to_i32(&self) -> Result<i32>

Return Ok(i32) if this attribute is an i32.

source

pub fn to_f32(&self) -> Result<f32>

Return Ok(f32) if this attribute is an f32.

source

pub fn into_text(self) -> Result<Text>

Return Ok(Text) if this attribute is a text.

source

pub fn to_text(&self) -> Result<&Text>

Return Ok(Text) if this attribute is a text.

source

pub fn to_chromaticities(&self) -> Result<Chromaticities>

Return Ok(Chromaticities) if this attribute is a chromaticities attribute.

source

pub fn to_time_code(&self) -> Result<TimeCode>

Return Ok(TimeCode) if this attribute is a time code.

Trait Implementations§

source§

impl Clone for AttributeValue

source§

fn clone(&self) -> AttributeValue

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 Debug for AttributeValue

source§

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

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

impl PartialEq for AttributeValue

source§

fn eq(&self, other: &AttributeValue) -> 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 StructuralPartialEq for AttributeValue

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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 T
where 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.