pub enum RawFile<R> {
Arw(Box<ArwFile<R>>),
Cr2(Box<Cr2File<R>>),
Cr3(Box<Cr3File<R>>),
Crw(Box<CrwFile<R>>),
Dng(Box<DngFile<R>>),
Nef(Box<NefFile<R>>),
Raf(Box<RafFile<R>>),
}Expand description
Common entry point for parsing RAW files.
Wraps the specific format implementation for the detected file type.
Variants§
Arw(Box<ArwFile<R>>)
Sony ARW format
Cr2(Box<Cr2File<R>>)
Canon CR2 format
Cr3(Box<Cr3File<R>>)
Canon CR3 format
Crw(Box<CrwFile<R>>)
Canon CRW (CIFF) format
Dng(Box<DngFile<R>>)
Adobe DNG format
Nef(Box<NefFile<R>>)
Nikon NEF format
Raf(Box<RafFile<R>>)
Fujifilm RAF format
Implementations§
Source§impl<R: Read + Seek> RawFile<R>
impl<R: Read + Seek> RawFile<R>
Sourcepub fn open(reader: R) -> RawResult<Self>
pub fn open(reader: R) -> RawResult<Self>
Open and parse a RAW file, automatically detecting the format.
This is the primary entry point for using valid file formats.
Sourcepub fn metadata(&self) -> ImageMetadata
pub fn metadata(&self) -> ImageMetadata
Get unified metadata from this RAW file.
This provides format-agnostic access to all available metadata.
Sourcepub fn thumbnail(&mut self) -> RawResult<Option<Vec<u8>>>
pub fn thumbnail(&mut self) -> RawResult<Option<Vec<u8>>>
Extract the embedded JPEG thumbnail from the RAW file, if available.
Returns Ok(Some(jpeg_bytes)) when a thumbnail is found, Ok(None) when
the format does not contain one (or extraction is not yet implemented).
Sourcepub fn decode_raw(&mut self) -> RawResult<RawImage>
pub fn decode_raw(&mut self) -> RawResult<RawImage>
Decode raw sensor data without processing.
Returns the raw Bayer/X-Trans CFA data with original bit depth. For LinearRaw DNG files, returns the already-demosaiced data as a RawImage.
Sourcepub fn process(
&mut self,
processing_options: &ProcessingOptions,
) -> RawResult<RgbImage>
pub fn process( &mut self, processing_options: &ProcessingOptions, ) -> RawResult<RgbImage>
Decode and process to an in-memory RGB image.
Runs the full processing pipeline (black level, WB, demosaic, color matrix, denoise, CA correction, tone mapping, orientation) and returns the result without writing to disk.
Sourcepub fn export<P: AsRef<Path>>(
&mut self,
path: P,
processing_options: &ProcessingOptions,
encode_options: &EncodeOptions,
) -> RawResult<()>
pub fn export<P: AsRef<Path>>( &mut self, path: P, processing_options: &ProcessingOptions, encode_options: &EncodeOptions, ) -> RawResult<()>
Export the raw file to an image format based on the encoded options.
This runs the full processing pipeline:
- Decode raw data
- Apply black level subtraction and normalization
- Demosaic
- Apply White Balance (if specified)
- Apply Color Matrix (if specified)
- Apply Gamma Correction (if specified)
- Save to disk using format-specific encoder
Sourcepub fn is_linear_raw_dng(&self) -> bool
pub fn is_linear_raw_dng(&self) -> bool
Helper to check if the current file is a LinearRaw DNG
Auto Trait Implementations§
impl<R> Freeze for RawFile<R>
impl<R> RefUnwindSafe for RawFile<R>where
R: RefUnwindSafe,
impl<R> Send for RawFile<R>where
R: Send,
impl<R> Sync for RawFile<R>where
R: Sync,
impl<R> Unpin for RawFile<R>
impl<R> UnsafeUnpin for RawFile<R>
impl<R> UnwindSafe for RawFile<R>where
R: UnwindSafe,
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> 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