Skip to content

Commit

Permalink
add bgra to linux bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
darioalessandro committed Dec 19, 2024
1 parent 3b0a2fe commit aad27f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions nokhwa-bindings-linux/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ mod internal {
FrameFormat::GRAY => FourCC::new(b"GRAY"),
FrameFormat::RAWRGB => FourCC::new(b"RGB3"),
FrameFormat::NV12 => FourCC::new(b"NV12"),
FrameFormat::BGRA => FourCC::new(b"BGRA"),
};

let format = Format::new(new_fmt.width(), new_fmt.height(), v4l_fcc);
Expand Down Expand Up @@ -913,6 +914,7 @@ mod internal {
"GRAY" => Some(FrameFormat::GRAY),
"RGB3" => Some(FrameFormat::RAWRGB),
"NV12" => Some(FrameFormat::NV12),
"BGRA" => Some(FrameFormat::BGRA),
_ => None,
}
}
Expand All @@ -924,6 +926,7 @@ mod internal {
FrameFormat::GRAY => FourCC::new(b"GRAY"),
FrameFormat::RAWRGB => FourCC::new(b"RGB3"),
FrameFormat::NV12 => FourCC::new(b"NV12"),
FrameFormat::BGRA => FourCC::new(b"BGRA"),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion nokhwa-core/src/pixel_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::types::{
mjpeg_to_rgb, nv12_to_rgb, yuyv422_to_rgb, FrameFormat, Resolution,
};
use image::{Luma, LumaA, Pixel, Rgb, Rgba};
use std::fmt::{format, Debug};
use std::fmt::Debug;

/// Trait that has methods to convert raw data from the webcam to a proper raw image.
pub trait FormatDecoder: Clone + Sized + Send + Sync {
Expand Down

0 comments on commit aad27f7

Please sign in to comment.