#[non_exhaustive]pub struct RawMetadata {Show 27 fields
pub make: String,
pub model: String,
pub canonical_make: String,
pub canonical_model: String,
pub unique_camera_model: Option<String>,
pub software: Option<String>,
pub firmware: Option<String>,
pub serial: Option<String>,
pub artist: Option<String>,
pub copyright: Option<String>,
pub lens: LensInfo,
pub exposure: ExposureInfo,
pub capture_time: Option<String>,
pub gps: Option<GpsInfo>,
pub orientation: Orientation,
pub orientation_info: OrientationMetadata,
pub format: Option<RawFormat>,
pub compression: Option<Compression>,
pub bits_per_sample: u8,
pub raw_width: u32,
pub raw_height: u32,
pub width: u32,
pub height: u32,
pub dng_version: Option<[u8; 4]>,
pub extra: Vec<(String, String)>,
pub previews: Vec<PreviewInfo>,
pub dng: Option<DngExtras>,
}Expand description
Normalised metadata for a RAW file, available without decoding sensor data.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.make: StringMake as written in the file.
model: StringModel as written in the file.
canonical_make: StringNormalised maker name (“Canon”, “Nikon”, “Sony”, …).
canonical_model: StringNormalised model name (aliases resolved).
unique_camera_model: Option<String>DNG UniqueCameraModel or equivalent.
software: Option<String>Writing software (EXIF Software tag).
firmware: Option<String>Camera firmware version, from maker notes where available.
serial: Option<String>Camera body serial number.
artist: Option<String>Artist / author.
copyright: Option<String>Copyright notice.
lens: LensInfoLens information (fields are None when not recorded).
exposure: ExposureInfoExposure parameters (fields are None when not recorded).
capture_time: Option<String>Capture timestamp, YYYY-MM-DDTHH:MM:SS[.sss][±HH:MM] when available.
gps: Option<GpsInfo>GPS position; None unless a latitude or longitude is recorded.
orientation: OrientationImage orientation (the resolved value of RawMetadata::orientation_info).
orientation_info: OrientationMetadataThe orientation records found in the file (standard tag and vendor record) and
how the resolved RawMetadata::orientation was chosen.
format: Option<RawFormat>Container format, when identified.
compression: Option<Compression>Payload compression of the main RAW image, when identified.
bits_per_sample: u8Bits per sample of the encoded data.
raw_width: u32Full sensor buffer width (including masked borders).
raw_height: u32Full sensor buffer height (including masked borders).
width: u32Width after the default crop.
height: u32Height after the default crop.
dng_version: Option<[u8; 4]>DNG version bytes (e.g. [1, 4, 0, 0]); None for non-DNG files.
extra: Vec<(String, String)>Free-form, vendor-specific values worth exposing (mode names, quality, crop mode…).
previews: Vec<PreviewInfo>Embedded previews and thumbnails.
dng: Option<DngExtras>DNG rendering hints (None for non-DNG files).
Implementations§
Source§impl RawMetadata
impl RawMetadata
Sourcepub fn image_size(&self) -> Option<(u32, u32)>
pub fn image_size(&self) -> Option<(u32, u32)>
The camera’s own image size recorded by the file (EXTRA_IMAGE_SIZE).
Sourcepub fn set_image_size(&mut self, width: u32, height: u32)
pub fn set_image_size(&mut self, width: u32, height: u32)
Record the camera’s own image size (EXTRA_IMAGE_SIZE); zero sizes are ignored.
Sourcepub fn new(make: impl Into<String>, model: impl Into<String>) -> RawMetadata
pub fn new(make: impl Into<String>, model: impl Into<String>) -> RawMetadata
Metadata with the given make and model as written in the file; everything else empty.
Sourcepub fn set_extra(&mut self, key: &str, value: impl ToString)
pub fn set_extra(&mut self, key: &str, value: impl ToString)
Set an entry of RawMetadata::extra, replacing any existing value for key.
Sourcepub fn camera(&self) -> String
pub fn camera(&self) -> String
Human-friendly “Make Model” string using canonical names when known.
Sourcepub fn largest_preview(&self) -> Option<&PreviewInfo>
pub fn largest_preview(&self) -> Option<&PreviewInfo>
Largest preview.
Sourcepub fn smallest_preview(&self) -> Option<&PreviewInfo>
pub fn smallest_preview(&self) -> Option<&PreviewInfo>
Smallest preview (thumbnail).
Trait Implementations§
Source§impl Clone for RawMetadata
impl Clone for RawMetadata
Source§fn clone(&self) -> RawMetadata
fn clone(&self) -> RawMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RawMetadata
impl Debug for RawMetadata
Source§impl Default for RawMetadata
impl Default for RawMetadata
Source§fn default() -> RawMetadata
fn default() -> RawMetadata
Source§impl<'de> Deserialize<'de> for RawMetadata
impl<'de> Deserialize<'de> for RawMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RawMetadata
impl PartialEq for RawMetadata
Source§impl Serialize for RawMetadata
impl Serialize for RawMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for RawMetadata
Auto Trait Implementations§
impl Freeze for RawMetadata
impl RefUnwindSafe for RawMetadata
impl Send for RawMetadata
impl Sync for RawMetadata
impl Unpin for RawMetadata
impl UnsafeUnpin for RawMetadata
impl UnwindSafe for RawMetadata
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, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
Source§fn default_with_context(_: Ctx) -> T
fn default_with_context(_: Ctx) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more