pub struct RawImage {Show 21 fields
pub camera: Camera,
pub make: String,
pub model: String,
pub clean_make: String,
pub clean_model: String,
pub width: usize,
pub height: usize,
pub cpp: usize,
pub bps: usize,
pub wb_coeffs: [f32; 4],
pub whitelevel: WhiteLevel,
pub blacklevel: BlackLevel,
pub xyz_to_cam: [[f32; 3]; 4],
pub photometric: RawPhotometricInterpretation,
pub active_area: Option<Rect>,
pub crop_area: Option<Rect>,
pub blackareas: Vec<Rect>,
pub orientation: Orientation,
pub data: RawImageData,
pub color_matrix: HashMap<Illuminant, FlatColorMatrix>,
pub dng_tags: HashMap<u16, Value>,
}Expand description
All the data needed to process this raw image, including the image data itself as well as all the needed metadata
Fields§
§camera: CameraCamera definition
make: Stringcamera make as encoded in the file
model: Stringcamera model as encoded in the file
clean_make: Stringmake cleaned up to be consistent and short
clean_model: Stringmodel cleaned up to be consistent and short
width: usizewidth of the full image
height: usizeheight of the full image
cpp: usizenumber of components per pixel (1 for bayer, 3 for RGB images)
bps: usizeBits per pixel
wb_coeffs: [f32; 4]whitebalance coefficients encoded in the file in RGBE order
whitelevel: WhiteLevelimage whitelevels in RGBE order
blacklevel: BlackLevelimage blacklevels in RGBE order
xyz_to_cam: [[f32; 3]; 4]matrix to convert XYZ to camera RGBE
photometric: RawPhotometricInterpretationPhotometric interpretation
active_area: Option<Rect>how much to crop the image to get all the usable (non-black) area
crop_area: Option<Rect>how much to crop the image to get all the recommended area
blackareas: Vec<Rect>Areas of the sensor that is masked to prevent it from receiving light. Used to calculate black levels and noise.
orientation: Orientationorientation of the image as indicated by the image metadata
data: RawImageDataimage data itself, has width*height*cpp elements
color_matrix: HashMap<Illuminant, FlatColorMatrix>Implementations§
Source§impl RawImage
impl RawImage
pub fn calc_black_levels<T>(
cfa: &CFA,
blackareas: &[Rect],
width: usize,
_height: usize,
image: &[T],
) -> Option<BlackLevel>where
T: SubPixel,
pub fn dim(&self) -> Dim2
pub fn pixels_u16(&self) -> &[u16]
pub fn pixels_u16_mut(&mut self) -> &mut [u16]
Sourcepub fn apply_scaling(&mut self) -> Result<()>
pub fn apply_scaling(&mut self) -> Result<()>
Apply blacklevel and whitelevel scaling, replacing raw image data with floating point values in range 0.0 .. 1.0. Internal blacklevel and whitelevel is reset to 0.0 and 1.0 to match image data.
pub fn develop_params(&self) -> Result<DevelopParams>
Sourcepub fn add_dng_tag<T: TiffTag, V: Into<Value>>(&mut self, tag: T, value: V)
pub fn add_dng_tag<T: TiffTag, V: Into<Value>>(&mut self, tag: T, value: V)
Add a DNG tag override
pub fn linearize(&self) -> Result<Self>
Sourcepub fn cam_to_xyz(&self) -> [[f32; 4]; 3]
pub fn cam_to_xyz(&self) -> [[f32; 4]; 3]
Outputs the inverted matrix that converts pixels in the camera colorspace into XYZ components.
Sourcepub fn cam_to_xyz_normalized(&self) -> [[f32; 4]; 3]
pub fn cam_to_xyz_normalized(&self) -> [[f32; 4]; 3]
Outputs the inverted matrix that converts pixels in the camera colorspace into XYZ components normalized to be easily used to convert to Lab or a RGB output space
Sourcepub fn neutralwb(&self) -> [f32; 4]
pub fn neutralwb(&self) -> [f32; 4]
Not all cameras encode a whitebalance so in those cases just using a 6500K neutral one is a good compromise
Sourcepub fn cropped_cfa(&self) -> CFA
pub fn cropped_cfa(&self) -> CFA
Returns the CFA pattern after the crop has been applied (and thus the pattern potentially shifted)
Sourcepub fn is_monochrome(&self) -> bool
pub fn is_monochrome(&self) -> bool
Checks if the image is monochrome
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawImage
impl RefUnwindSafe for RawImage
impl Send for RawImage
impl Sync for RawImage
impl Unpin for RawImage
impl UnsafeUnpin for RawImage
impl UnwindSafe for RawImage
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§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