Struct nokhwa::pixel_format::LumaFormat
source · pub struct LumaFormat;
Expand description
A Zero-Size-Type that contains the definition to convert a given image stream to an Luma8(Grayscale 8-bit) in the Buffer
’s .decode_image()
ⓘ
use image::{ImageBuffer, Luma};
let image: ImageBuffer<Luma<u8>, Vec<u8>> = buffer.to_image::<LumaFormat>();
Trait Implementations§
source§impl Clone for LumaFormat
impl Clone for LumaFormat
source§fn clone(&self) -> LumaFormat
fn clone(&self) -> LumaFormat
Returns a copy 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 LumaFormat
impl Debug for LumaFormat
source§impl Default for LumaFormat
impl Default for LumaFormat
source§fn default() -> LumaFormat
fn default() -> LumaFormat
Returns the “default value” for a type. Read more
source§impl FormatDecoder for LumaFormat
impl FormatDecoder for LumaFormat
type Output = Luma<u8>
const FORMATS: &'static [FrameFormat] = frame_formats()
source§fn write_output(
fcc: FrameFormat,
resolution: Resolution,
data: &[u8]
) -> Result<Vec<u8, Global>, NokhwaError>
fn write_output( fcc: FrameFormat, resolution: Resolution, data: &[u8] ) -> Result<Vec<u8, Global>, NokhwaError>
Allocates and returns a
Vec
Read moresource§fn write_output_buffer(
fcc: FrameFormat,
_resolution: Resolution,
data: &[u8],
dest: &mut [u8]
) -> Result<(), NokhwaError>
fn write_output_buffer( fcc: FrameFormat, _resolution: Resolution, data: &[u8], dest: &mut [u8] ) -> Result<(), NokhwaError>
Writes to a user provided buffer. Read more
source§impl Hash for LumaFormat
impl Hash for LumaFormat
source§impl Ord for LumaFormat
impl Ord for LumaFormat
source§fn cmp(&self, other: &LumaFormat) -> Ordering
fn cmp(&self, other: &LumaFormat) -> 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<LumaFormat> for LumaFormat
impl PartialEq<LumaFormat> for LumaFormat
source§fn eq(&self, other: &LumaFormat) -> bool
fn eq(&self, other: &LumaFormat) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<LumaFormat> for LumaFormat
impl PartialOrd<LumaFormat> for LumaFormat
source§fn partial_cmp(&self, other: &LumaFormat) -> Option<Ordering>
fn partial_cmp(&self, other: &LumaFormat) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for LumaFormat
impl Eq for LumaFormat
impl StructuralEq for LumaFormat
impl StructuralPartialEq for LumaFormat
Auto Trait Implementations§
impl RefUnwindSafe for LumaFormat
impl Send for LumaFormat
impl Sync for LumaFormat
impl Unpin for LumaFormat
impl UnwindSafe for LumaFormat
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.