pub struct DuplicationContext { /* private fields */ }
Expand description

Stateless.

Implementations§

source§

impl DuplicationContext

source

pub fn custom_capturer<'a>( &'a self, buffer: &'a mut [u8] ) -> Result<CustomCapturer<'_>>

source§

impl DuplicationContext

source

pub fn shared_capturer(&self, name: &str) -> Result<SharedCapturer<'_>>

source

pub fn shared_capturer_open(&self, name: &str) -> Result<SharedCapturer<'_>>

source§

impl DuplicationContext

source§

impl DuplicationContext

source

pub fn new( device: ID3D11Device, device_context: ID3D11DeviceContext, output: IDXGIOutput1, output_duplication: IDXGIOutputDuplication, timeout_ms: u32 ) -> Self

source

pub fn dxgi_output_desc(&self) -> Result<DXGI_OUTPUT_DESC>

This is usually used to get the screen’s position and size.

source

pub fn dxgi_outdupl_desc(&self) -> DXGI_OUTDUPL_DESC

This is usually used to get the screen’s pixel width/height and buffer size.

source

pub fn create_readable_texture( &self ) -> Result<(ID3D11Texture2D, DXGI_OUTDUPL_DESC)>

source

pub fn next_frame( &self, readable_texture: &ID3D11Texture2D ) -> Result<(IDXGISurface1, DXGI_OUTDUPL_FRAME_INFO)>

source

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.

source

pub fn capture( &self, dest: *mut u8, len: usize, readable_texture: &ID3D11Texture2D ) -> Result<DXGI_OUTDUPL_FRAME_INFO>

source

pub fn capture_with_pointer_shape( &self, dest: *mut u8, len: usize, readable_texture: &ID3D11Texture2D, 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§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.