pub struct Frame<'a> { /* private fields */ }
Expand description
Implementations§
Source§impl<'a> Frame<'a>
impl<'a> Frame<'a>
Sourcepub const fn new(
d3d_device: &'a ID3D11Device,
frame_surface: IDirect3DSurface,
frame_texture: ID3D11Texture2D,
timestamp: TimeSpan,
context: &'a ID3D11DeviceContext,
buffer: &'a mut Vec<u8>,
width: u32,
height: u32,
color_format: ColorFormat,
title_bar_height: Option<u32>,
) -> Self
pub const fn new( d3d_device: &'a ID3D11Device, frame_surface: IDirect3DSurface, frame_texture: ID3D11Texture2D, timestamp: TimeSpan, context: &'a ID3D11DeviceContext, buffer: &'a mut Vec<u8>, width: u32, height: u32, color_format: ColorFormat, title_bar_height: Option<u32>, ) -> Self
Creates a new Frame
.
§Arguments
d3d_device
- TheID3D11Device
used for creating the frame.frame_surface
- TheIDirect3DSurface
representing the frame’s surface.frame_texture
- TheID3D11Texture2D
representing the frame’s texture.timestamp
- TheTimeSpan
representing the frame’s timestamp, in 100-nanosecond units.context
- TheID3D11DeviceContext
used for copying the texture.buffer
- A mutable reference to the buffer for the frame data.width
- The width of the frame.height
- The height of the frame.color_format
- TheColorFormat
of the frame.title_bar_height
- The height of the title bar, if applicable.
§Returns
A new Frame
instance.
Sourcepub const fn color_format(&self) -> ColorFormat
pub const fn color_format(&self) -> ColorFormat
Sourcepub const unsafe fn as_raw_surface(&self) -> &IDirect3DSurface
pub const unsafe fn as_raw_surface(&self) -> &IDirect3DSurface
Sourcepub const unsafe fn as_raw_texture(&self) -> &ID3D11Texture2D
pub const unsafe fn as_raw_texture(&self) -> &ID3D11Texture2D
Sourcepub fn buffer(&mut self) -> Result<FrameBuffer<'_>, Error>
pub fn buffer(&mut self) -> Result<FrameBuffer<'_>, Error>
Sourcepub fn buffer_crop(
&mut self,
start_width: u32,
start_height: u32,
end_width: u32,
end_height: u32,
) -> Result<FrameBuffer<'_>, Error>
pub fn buffer_crop( &mut self, start_width: u32, start_height: u32, end_width: u32, end_height: u32, ) -> Result<FrameBuffer<'_>, Error>
Get a cropped frame buffer.
§Arguments
start_width
- The starting width of the cropped frame.start_height
- The starting height of the cropped frame.end_width
- The ending width of the cropped frame.end_height
- The ending height of the cropped frame.
§Returns
A FrameBuffer
containing the cropped frame data.
Sourcepub fn buffer_without_title_bar(&mut self) -> Result<FrameBuffer<'_>, Error>
pub fn buffer_without_title_bar(&mut self) -> Result<FrameBuffer<'_>, Error>
Gets the frame buffer without the title bar.
§Returns
A FrameBuffer
containing the frame data without the title bar.
Sourcepub fn save_as_image<T: AsRef<Path>>(
&mut self,
path: T,
format: ImageFormat,
) -> Result<(), Error>
pub fn save_as_image<T: AsRef<Path>>( &mut self, path: T, format: ImageFormat, ) -> Result<(), Error>
Auto Trait Implementations§
impl<'a> Freeze for Frame<'a>
impl<'a> RefUnwindSafe for Frame<'a>
impl<'a> !Send for Frame<'a>
impl<'a> !Sync for Frame<'a>
impl<'a> Unpin for Frame<'a>
impl<'a> !UnwindSafe for Frame<'a>
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> 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