pub struct CameraFormat { /* private fields */ }Expand description
This is a convenience struct that holds all information about the format of a webcam stream.
It consists of a Resolution, FrameFormat, and a frame rate(u8).
Implementations§
Source§impl CameraFormat
impl CameraFormat
Sourcepub fn new(
resolution: Resolution,
format: FrameFormat,
frame_rate: u32,
) -> CameraFormat
pub fn new( resolution: Resolution, format: FrameFormat, frame_rate: u32, ) -> CameraFormat
Construct a new CameraFormat
Sourcepub fn new_from(
res_x: u32,
res_y: u32,
format: FrameFormat,
fps: u32,
) -> CameraFormat
pub fn new_from( res_x: u32, res_y: u32, format: FrameFormat, fps: u32, ) -> CameraFormat
CameraFormat::new(), but raw.
Sourcepub fn resolution(&self) -> Resolution
pub fn resolution(&self) -> Resolution
Get the resolution of the current CameraFormat
Sourcepub fn width(&self) -> u32
pub fn width(&self) -> u32
Get the width of the resolution of the current CameraFormat
Sourcepub fn height(&self) -> u32
pub fn height(&self) -> u32
Get the height of the resolution of the current CameraFormat
Sourcepub fn set_resolution(&mut self, resolution: Resolution)
pub fn set_resolution(&mut self, resolution: Resolution)
Set the CameraFormat’s resolution.
Sourcepub fn frame_rate(&self) -> u32
pub fn frame_rate(&self) -> u32
Get the frame rate of the current CameraFormat
Sourcepub fn set_frame_rate(&mut self, frame_rate: u32)
pub fn set_frame_rate(&mut self, frame_rate: u32)
Set the CameraFormat’s frame rate.
Sourcepub fn format(&self) -> FrameFormat
pub fn format(&self) -> FrameFormat
Get the CameraFormat’s format.
Sourcepub fn set_format(&mut self, format: FrameFormat)
pub fn set_format(&mut self, format: FrameFormat)
Set the CameraFormat’s format.
Trait Implementations§
Source§impl Clone for CameraFormat
impl Clone for CameraFormat
Source§fn clone(&self) -> CameraFormat
fn clone(&self) -> CameraFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CameraFormat
impl Debug for CameraFormat
Source§impl Default for CameraFormat
impl Default for CameraFormat
Source§fn default() -> CameraFormat
fn default() -> CameraFormat
Returns the “default value” for a type. Read more
Source§impl Display for CameraFormat
impl Display for CameraFormat
Source§impl Hash for CameraFormat
impl Hash for CameraFormat
Source§impl Ord for CameraFormat
impl Ord for CameraFormat
Source§fn cmp(&self, other: &CameraFormat) -> Ordering
fn cmp(&self, other: &CameraFormat) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CameraFormat
impl PartialEq for CameraFormat
Source§impl PartialOrd for CameraFormat
impl PartialOrd for CameraFormat
impl Copy for CameraFormat
impl Eq for CameraFormat
impl StructuralPartialEq for CameraFormat
Auto Trait Implementations§
impl Freeze for CameraFormat
impl RefUnwindSafe for CameraFormat
impl Send for CameraFormat
impl Sync for CameraFormat
impl Unpin for CameraFormat
impl UnsafeUnpin for CameraFormat
impl UnwindSafe for CameraFormat
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
Mutably borrows from an owned value. Read more