pub struct DuplicationContext { /* private fields */ }Expand description
Stateless.
Implementations§
source§impl DuplicationContext
impl DuplicationContext
pub fn custom_capturer<'a>( &'a self, buffer: &'a mut [u8] ) -> Result<CustomCapturer<'_>>
source§impl DuplicationContext
impl DuplicationContext
pub fn simple_capturer(&self) -> Result<SimpleCapturer<'_>>
source§impl DuplicationContext
impl DuplicationContext
pub fn new( device: ID3D11Device, device_context: ID3D11DeviceContext, output: IDXGIOutput1, output_duplication: IDXGIOutputDuplication, timeout_ms: u32 ) -> Self
pub fn monitor_info(&self) -> Result<MONITORINFO>
sourcepub fn dxgi_output_desc(&self) -> Result<DXGI_OUTPUT_DESC>
pub fn dxgi_output_desc(&self) -> Result<DXGI_OUTPUT_DESC>
This is usually used to get the screen’s position and size.
sourcepub fn dxgi_outdupl_desc(&self) -> DXGI_OUTDUPL_DESC
pub fn dxgi_outdupl_desc(&self) -> DXGI_OUTDUPL_DESC
This is usually used to get the screen’s pixel width/height and buffer size.
pub fn create_readable_texture( &self ) -> Result<(ID3D11Texture2D, DXGI_OUTDUPL_DESC, D3D11_TEXTURE2D_DESC)>
pub fn next_frame( &self, readable_texture: &ID3D11Texture2D ) -> Result<(IDXGISurface1, DXGI_OUTDUPL_FRAME_INFO)>
sourcepub fn next_frame_with_pointer_shape(
&self,
readable_texture: &ID3D11Texture2D,
pointer_shape_buffer: &mut Vec<u8>
) -> Result<(IDXGISurface1, DXGI_OUTDUPL_FRAME_INFO, Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO>)>
pub fn next_frame_with_pointer_shape( &self, readable_texture: &ID3D11Texture2D, pointer_shape_buffer: &mut Vec<u8> ) -> Result<(IDXGISurface1, DXGI_OUTDUPL_FRAME_INFO, Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO>)>
If mouse is updated, the Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO> is Some.
and this will resize pointer_shape_buffer if needed and update it.
pub fn capture( &self, dest: *mut u8, len: usize, readable_texture: &ID3D11Texture2D, texture_desc: &D3D11_TEXTURE2D_DESC ) -> Result<DXGI_OUTDUPL_FRAME_INFO>
sourcepub fn capture_with_pointer_shape(
&self,
dest: *mut u8,
len: usize,
readable_texture: &ID3D11Texture2D,
texture_desc: &D3D11_TEXTURE2D_DESC,
pointer_shape_buffer: &mut Vec<u8>
) -> Result<(DXGI_OUTDUPL_FRAME_INFO, Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO>)>
pub fn capture_with_pointer_shape( &self, dest: *mut u8, len: usize, readable_texture: &ID3D11Texture2D, texture_desc: &D3D11_TEXTURE2D_DESC, pointer_shape_buffer: &mut Vec<u8> ) -> Result<(DXGI_OUTDUPL_FRAME_INFO, Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO>)>
If mouse is updated, the Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO> is Some.
and this will resize pointer_shape_buffer if needed and update it.
Auto Trait Implementations§
impl RefUnwindSafe for DuplicationContext
impl !Send for DuplicationContext
impl !Sync for DuplicationContext
impl Unpin for DuplicationContext
impl UnwindSafe for DuplicationContext
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