Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FrameFormat compile issue #91

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 9 additions & 43 deletions nokhwa-core/src/frame_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,16 @@ use std::str::FromStr;
#[derive(Copy, Clone, Debug, Hash, Ord, PartialOrd, Eq, PartialEq)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
pub enum FrameFormat {
// Compressed Formats
H265,
H264,
H263,
AVC1,
MPEG1,
MPEG2,
MPEG4,
/// - YUYV is a mathematical color space. You can read more [here.](https://en.wikipedia.org/wiki/YCbCr)
YUYV,
/// - NV12 is same as above. Note that a partial compression (e.g. [16, 235] may be coerced to [0, 255].
NV12,
/// - MJPEG is a motion-jpeg compressed frame, it allows for high frame rates.
MJPEG,
XVid,
VP8,
VP9,

// YCbCr formats

// -> 422 16 BPP
Yuv422,
Uyv422,

// 420
Nv12,
Nv21,
Yv12,
Imc2,
Imc4,

// UV
UV8,

// Grayscale Formats
Luma8,
Luma8I,
Luma10,
Luma10B,
Luma12,
Luma12I,
Luma16,

// Depth Formats
Z16,

// RGB Formats
Rgb8,
// Bayer
/// - GRAY is a grayscale image format, usually for specialized cameras such as IR Cameras.
GRAY,
/// - RAWRGB is a Raw RGB888 format.
RAWRGB,
}

impl Display for FrameFormat {
Expand Down
2 changes: 2 additions & 0 deletions nokhwa-core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use std::{
str::FromStr,
};

pub use crate::frame_format::*;

/// Tells the init function what camera format to pick.
/// - `AbsoluteHighestResolution`: Pick the highest [`Resolution`], then pick the highest frame rate of those provided.
/// - `AbsoluteHighestFrameRate`: Pick the highest frame rate, then the highest [`Resolution`].
Expand Down