pub struct Capture { /* private fields */ }Expand description
D3D11 container
Implementations§
Source§impl Capture
impl Capture
Sourcepub fn get_img_frame(&self) -> Result<ImgFrameData, CaptureError>
Available on crate feature img only.
pub fn get_img_frame(&self) -> Result<ImgFrameData, CaptureError>
img only.Get image RgbaImage from a Direct3D surface
for image crate.
Required features: "img"
§Examples
let device = dxcapture::Device::default();
let capture = dxcapture::Capture::new(&device).unwrap();
let image = capture.wait_img_frame().expect("Failed to capture");
let path = "image.png";
image.data.save(path).expect("Failed to save");Sourcepub fn wait_img_frame(&self) -> Result<ImgFrameData, CaptureError>
Available on crate feature img only.
pub fn wait_img_frame(&self) -> Result<ImgFrameData, CaptureError>
img only.Get opencv image from a Direct3D surface. with throught NoTexture
Source§impl Capture
impl Capture
Sourcepub fn get_mat_frame(&self) -> Result<MatFrameData, CaptureError>
Available on crate feature mat only.
pub fn get_mat_frame(&self) -> Result<MatFrameData, CaptureError>
mat only.Get opencv Mat from a Direct3D surface
for opencv crate.
Required features: "mat"
§Examples
use opencv::prelude::*;
use opencv::imgcodecs::{ imwrite, IMWRITE_PNG_STRATEGY_DEFAULT };
let device = dxcapture::Device::default();
let capture = dxcapture::Capture::new(&device).unwrap();
let mat = capture.wait_mat_frame().expect("Failed to capture");
let path = "image.png";
imwrite(path, &mat.data, &vec![IMWRITE_PNG_STRATEGY_DEFAULT].into()).expect("Failed to save");Sourcepub fn wait_mat_frame(&self) -> Result<MatFrameData, CaptureError>
Available on crate feature mat only.
pub fn wait_mat_frame(&self) -> Result<MatFrameData, CaptureError>
mat only.Get opencv Mat from a Direct3D surface. with throught NoTexture
Source§impl Capture
impl Capture
pub fn new(device: &Device) -> Result<Self>
Sourcepub fn get_raw_frame(&self) -> Result<RawFrameData, CaptureError>
pub fn get_raw_frame(&self) -> Result<RawFrameData, CaptureError>
Return rapped current frame with RawFrameData
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Capture
impl RefUnwindSafe for Capture
impl !Send for Capture
impl !Sync for Capture
impl Unpin for Capture
impl UnsafeUnpin for Capture
impl UnwindSafe for Capture
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more