Enum AttributeValue

Source
pub enum AttributeValue {
Show 26 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)), Bytes { type_hint: Text, bytes: SmallVec<[u8; 16]>, }, Custom { kind: Text, bytes: SmallVec<[u8; 16]>, },
}
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.

§

Bytes

An explicitly untyped attribute for binary application data. Also contains the type name of this value. The format of the byte contents is explicitly unspecified. Used for custom application data.

Fields

§type_hint: Text

An application-specific type hint of the byte contents.

§bytes: SmallVec<[u8; 16]>

The contents of this byte array are completely unspecified and should be treated as untrusted data.

§

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: SmallVec<[u8; 16]>

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 malformed 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 duplicate 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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.
Source§

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,

Source§

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>,

Source§

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>,

Source§

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.