Struct rusty_duplication::capturer::shared::SharedCapturer
source · pub struct SharedCapturer<'a> { /* private fields */ }Expand description
Capture screen to a chunk of shared memory.
Implementations§
pub fn new(ctx: &'a DuplicationContext, name: &str) -> Result<Self>
pub fn open(ctx: &'a DuplicationContext, name: &str) -> Result<Self>
Trait Implementations§
source§fn dxgi_output_desc(&self) -> Result<DXGI_OUTPUT_DESC>
fn dxgi_output_desc(&self) -> Result<DXGI_OUTPUT_DESC>
This is usually used to get the screen’s position and size.
source§fn dxgi_outdupl_desc(&self) -> DXGI_OUTDUPL_DESC
fn dxgi_outdupl_desc(&self) -> DXGI_OUTDUPL_DESC
This is usually used to get the screen’s pixel width/height and buffer size.
source§fn buffer(&self) -> &[u8] ⓘ
fn buffer(&self) -> &[u8] ⓘ
Get the buffer of the last captured frame.
The buffer is in BGRA32 format.
source§fn buffer_mut(&mut self) -> &mut [u8] ⓘ
fn buffer_mut(&mut self) -> &mut [u8] ⓘ
Get the buffer of the last captured frame.
The buffer is in BGRA32 format.
source§fn check_buffer(&self) -> Result<()>
fn check_buffer(&self) -> Result<()>
Check buffer size.
source§fn pointer_shape_buffer(&self) -> &[u8] ⓘ
fn pointer_shape_buffer(&self) -> &[u8] ⓘ
Get the buffer of the captured pointer shape.
source§fn pointer_shape_updated(&self) -> bool
fn pointer_shape_updated(&self) -> bool
Return true if the pointer shape is updated.
source§fn capture(&mut self) -> Result<DXGI_OUTDUPL_FRAME_INFO>
fn capture(&mut self) -> Result<DXGI_OUTDUPL_FRAME_INFO>
Capture the screen and return the frame info.
The pixel data is stored in the
buffer.source§fn safe_capture(&mut self) -> Result<DXGI_OUTDUPL_FRAME_INFO>
fn safe_capture(&mut self) -> Result<DXGI_OUTDUPL_FRAME_INFO>
Check buffer size before capture.
The pixel data is stored in the
buffer.source§fn capture_with_pointer_shape(
&mut self
) -> Result<(DXGI_OUTDUPL_FRAME_INFO, Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO>)>
fn capture_with_pointer_shape( &mut self ) -> Result<(DXGI_OUTDUPL_FRAME_INFO, Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO>)>
Capture the screen and return the frame info.
The pixel data is stored in the
buffer.
If mouse is updated, the Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO> is Some.
The pointer shape is stored in the pointer_shape_buffer.source§fn safe_capture_with_pointer_shape(
&mut self
) -> Result<(DXGI_OUTDUPL_FRAME_INFO, Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO>)>
fn safe_capture_with_pointer_shape( &mut self ) -> Result<(DXGI_OUTDUPL_FRAME_INFO, Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO>)>
Check buffer size before capture.
The pixel data is stored in the
buffer.
If mouse is updated, the Option<DXGI_OUTDUPL_POINTER_SHAPE_INFO> is Some.
The pointer shape is stored in the pointer_shape_buffer.