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.
Implementations§
source§impl AttributeValue
impl AttributeValue
sourcepub fn kind_name(&self) -> &TextSlice
pub fn kind_name(&self) -> &TextSlice
The exr name string of the type that an attribute can have.
sourcepub fn write<W: Write>(&self, write: &mut W) -> UnitResult
pub fn write<W: Write>(&self, write: &mut W) -> UnitResult
Without validation, write this instance to the byte stream.
sourcepub fn read(
read: &mut PeekRead<impl Read>,
kind: Text,
byte_size: usize,
) -> Result<Result<Self>>
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.
sourcepub fn validate(
&self,
allow_sampling: bool,
data_window: IntegerBounds,
strict: bool,
) -> UnitResult
pub fn validate( &self, allow_sampling: bool, data_window: IntegerBounds, strict: bool, ) -> UnitResult
Validate this instance.
sourcepub fn to_chromaticities(&self) -> Result<Chromaticities>
pub fn to_chromaticities(&self) -> Result<Chromaticities>
Return Ok(Chromaticities)
if this attribute is a chromaticities attribute.
sourcepub fn to_time_code(&self) -> Result<TimeCode>
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
impl Clone for AttributeValue
source§fn clone(&self) -> AttributeValue
fn clone(&self) -> AttributeValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AttributeValue
impl Debug for AttributeValue
source§impl PartialEq for AttributeValue
impl PartialEq for AttributeValue
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 UnwindSafe for AttributeValue
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)