Enum AttributeValue

pub enum AttributeValue

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 { type_hint: Text, bytes: SmallVec<[u8; 16]> }

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.

Custom { kind: Text, bytes: SmallVec<[u8; 16]> }

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

Implementations

impl AttributeValue

fn byte_size(&self) -> usize

Number of bytes this would consume in an exr file.

fn kind_name(&self) -> &TextSlice

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

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

Without validation, write this instance to the byte stream.

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.

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

Validate this instance.

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

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

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

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

fn into_text(self) -> Result<Text>

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

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

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

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

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

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

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

Trait Implementations

impl Clone for AttributeValue

fn clone(&self) -> Self

impl Debug for AttributeValue

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

impl PartialEq for AttributeValue

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for AttributeValue

Auto Trait Implementations

impl Freeze for AttributeValue

impl RefUnwindSafe for AttributeValue

impl Send for AttributeValue

impl Sync for AttributeValue

impl Unpin for AttributeValue

impl UnsafeUnpin for AttributeValue

impl UnwindSafe for AttributeValue

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for AttributeValue where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for AttributeValue where ST: ?Sized, DT: ?Sized,

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for AttributeValue where T: ?Sized,

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

impl<T> CloneToUninit for AttributeValue where T: Clone,

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

impl<T> From<T> for AttributeValue

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for AttributeValue

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> Read<Exclusive, BecauseExclusive> for AttributeValue where T: ?Sized,

impl<T> ToOwned for AttributeValue where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for AttributeValue where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for AttributeValue where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for AttributeValue where U: TryFrom<T>,

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