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) -> usizeNumber of bytes this would consume in an exr file.
fn kind_name(&self) -> &TextSliceThe exr name string of the type that an attribute can have.
fn write<W: Write>(&self, write: &mut W) -> UnitResultWithout 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. ReturnsOk(Err(Error))for malformed attributes from a valid byte source. ReturnsErr(Error)for invalid byte sources, for example for invalid files.fn validate(&self, allow_sampling: bool, data_window: IntegerBounds, strict: bool) -> UnitResultValidate 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