#[non_exhaustive]pub struct CameraProfile {
pub name: Option<String>,
pub unique_camera_model: Option<String>,
pub copyright: Option<String>,
pub embed_policy: Option<u32>,
pub color_matrices: Vec<ColorMatrix>,
pub forward_matrices: Vec<ColorMatrix>,
pub hue_sat_map: Option<ProfileTable>,
pub look_table: Option<ProfileTable>,
pub tone_curve: Option<Vec<[f32; 2]>>,
pub baseline_exposure_offset: f64,
pub default_black_render: u32,
}Expand description
A DNG camera profile.
Build one from a .dcp file (CameraProfile::from_dcp) or take the one embedded in a
DNG (FlashRaw::embedded_camera_profile in the flashraw crate). Every field is optional
data; a profile with neither matrices nor tables does nothing.
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.name: Option<String>ProfileName.
unique_camera_model: Option<String>UniqueCameraModel: the camera the profile was made for.
copyright: Option<String>ProfileCopyright.
embed_policy: Option<u32>ProfileEmbedPolicy (0 allow copying, 1 embed if used, 2 embed never, 3 no restrictions).
color_matrices: Vec<ColorMatrix>ColorMatrix1/2 (XYZ to camera, 3 x 3) with their calibration illuminants.
forward_matrices: Vec<ColorMatrix>ForwardMatrix1/2 (white balanced camera to XYZ D50, 3 x 3) with their illuminants.
hue_sat_map: Option<ProfileTable>ProfileHueSatMapDims / ProfileHueSatMapData1/2 / ProfileHueSatMapEncoding.
look_table: Option<ProfileTable>ProfileLookTableDims / ProfileLookTableData / ProfileLookTableEncoding.
tone_curve: Option<Vec<[f32; 2]>>ProfileToneCurve as (input, output) points in [0, 1], ascending in input.
baseline_exposure_offset: f64BaselineExposureOffset in stops.
default_black_render: u32DefaultBlackRender (0 auto, 1 none). Recorded, not applied.
Implementations§
Source§impl CameraProfile
impl CameraProfile
Sourcepub fn from_dcp(bytes: &[u8]) -> Result<Self>
pub fn from_dcp(bytes: &[u8]) -> Result<Self>
Parse a DNG Camera Profile (.dcp) file.
§Errors
Error::UnsupportedFormat without the IIRC magic, Error::InvalidMetadata for
tables whose size does not match their dimensions or contain non-finite values.
Sourcepub fn from_dng_ifd(ifd: &Ifd<'_>) -> Option<Self>
pub fn from_dng_ifd(ifd: &Ifd<'_>) -> Option<Self>
The profile tags of a DNG’s first IFD. Returns None when the file carries no profile
data (no forward matrix, hue/sat map, look table or tone curve);
ordinary colour matrices alone do not make a profile. Malformed tables are skipped.
Sourcepub fn to_dcp(&self) -> Vec<u8> ⓘ
pub fn to_dcp(&self) -> Vec<u8> ⓘ
Serialise as a .dcp file (little-endian TIFF with the IIRC magic), the inverse of
CameraProfile::from_dcp. Used by tests and tools; matrices are written as floats.
Trait Implementations§
Source§impl Clone for CameraProfile
impl Clone for CameraProfile
Source§impl Debug for CameraProfile
impl Debug for CameraProfile
Source§impl Default for CameraProfile
impl Default for CameraProfile
Source§impl PartialEq for CameraProfile
impl PartialEq for CameraProfile
impl StructuralPartialEq for CameraProfile
Auto Trait Implementations§
impl Forget for CameraProfile
impl Freeze for CameraProfile
impl RefUnwindSafe for CameraProfile
impl Send for CameraProfile
impl Sync for CameraProfile
impl Unpin for CameraProfile
impl UnsafeUnpin for CameraProfile
impl UnwindSafe for CameraProfile
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> 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