Skip to main content

Camera

Struct Camera 

Source
pub struct Camera {
Show 16 fields pub make: &'static str, pub model: &'static str, pub mode: &'static str, pub canonical_make: &'static str, pub canonical_model: &'static str, pub aliases: &'static [(&'static str, &'static str)], pub cfa: Option<&'static str>, pub crop: Option<[i32; 4]>, pub black_areas_v: &'static [[u32; 2]], pub black_areas_h: &'static [[u32; 2]], pub sensors: &'static [SensorInfo], pub color_matrix: &'static [i32], pub hints: &'static [(&'static str, &'static str)], pub no_size_match: bool, pub orientation: Option<CameraOrientation>, pub image_crops: &'static [ImageCrop],
}
Expand description

A camera database entry.

Fields§

§make: &'static str§model: &'static str§mode: &'static str§canonical_make: &'static str§canonical_model: &'static str§aliases: &'static [(&'static str, &'static str)]

(model string as written by camera, canonical alias name).

§cfa: Option<&'static str>§crop: Option<[i32; 4]>

[x, y, width, height]; width/height <= 0 are relative to the right/bottom edge.

§black_areas_v: &'static [[u32; 2]]§black_areas_h: &'static [[u32; 2]]§sensors: &'static [SensorInfo]§color_matrix: &'static [i32]

XYZ(D65) → camera, scaled by 10000.

§hints: &'static [(&'static str, &'static str)]§no_size_match: bool§orientation: Option<CameraOrientation>

Orientation policy override and vendor-record layout.

§image_crops: &'static [ImageCrop]

The camera’s own image area per active-area size (measured from files).

Implementations§

Source§

impl Camera

Source

pub fn sensor(&self, iso: u32) -> Option<&'static SensorInfo>

Sensor levels for an ISO value (falls back to the first/default entry).

Source

pub fn hint(&self, key: &str) -> Option<&'static str>

Source

pub fn resolve_crop( &self, width: u32, height: u32, ) -> Option<(u32, u32, u32, u32)>

Crop resolved against an uncropped width x height buffer as (x, y, w, h).

Source

pub fn image_crop( &self, width: u32, height: u32, size: Option<(u32, u32)>, ) -> Option<[u32; 4]>

The camera’s image area inside an active area of width x height, as [x, y, w, h] relative to the active area. With size, only a rule producing an image of that size (either orientation) matches.

Source

pub fn canonical_model_for(&self, model: &str) -> &'static str

Canonical model name for the given raw model string (alias aware).

Trait Implementations§

Source§

impl Clone for Camera

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Camera

Source§

impl Debug for Camera

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Camera

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Camera

Auto Trait Implementations§

§

impl Forget for Camera

§

impl Freeze for Camera

§

impl Move for Camera

§

impl RefUnwindSafe for Camera

§

impl Send for Camera

§

impl Sync for Camera

§

impl Unpin for Camera

§

impl UnsafeUnpin for Camera

§

impl UnwindSafe for Camera

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.