pub struct Frame<'a> { /* private fields */ }Expand description
Implementationsยง
Sourceยงimpl<'a> Frame<'a>
impl<'a> Frame<'a>
Sourcepub const fn new(
capture_frame: Direct3D11CaptureFrame,
d3d_device: &'a ID3D11Device,
frame_surface: IDirect3DSurface,
frame_texture: ID3D11Texture2D,
context: &'a ID3D11DeviceContext,
desc: D3D11_TEXTURE2D_DESC,
color_format: ColorFormat,
title_bar_height: Option<u32>,
) -> Self
pub const fn new( capture_frame: Direct3D11CaptureFrame, d3d_device: &'a ID3D11Device, frame_surface: IDirect3DSurface, frame_texture: ID3D11Texture2D, context: &'a ID3D11DeviceContext, desc: D3D11_TEXTURE2D_DESC, color_format: ColorFormat, title_bar_height: Option<u32>, ) -> Self
Constructs a new Frame.
Sourcepub fn dirty_regions(&self) -> Result<Vec<DirtyRegion>, Error>
pub fn dirty_regions(&self) -> Result<Vec<DirtyRegion>, Error>
Gets the dirty regions of the frame.
Sourcepub const fn color_format(&self) -> ColorFormat
pub const fn color_format(&self) -> ColorFormat
Gets the color format of the frame.
Sourcepub const fn as_raw_surface(&self) -> &IDirect3DSurface
pub const fn as_raw_surface(&self) -> &IDirect3DSurface
Gets the raw surface of the frame.
Sourcepub const fn as_raw_texture(&self) -> &ID3D11Texture2D
pub const fn as_raw_texture(&self) -> &ID3D11Texture2D
Gets the raw texture of the frame.
Sourcepub const fn device(&self) -> &ID3D11Device
pub const fn device(&self) -> &ID3D11Device
Gets the underlying Direct3D device associated with this frame.
Sourcepub const fn device_context(&self) -> &ID3D11DeviceContext
pub const fn device_context(&self) -> &ID3D11DeviceContext
Gets the device context used for GPU operations on this frame.
Sourcepub fn buffer(&mut self) -> Result<FrameBuffer<'_>, Error>
pub fn buffer(&mut self) -> Result<FrameBuffer<'_>, Error>
Gets the frame buffer.
Sourcepub fn buffer_crop(
&mut self,
start_x: u32,
start_y: u32,
end_x: u32,
end_y: u32,
) -> Result<FrameBuffer<'_>, Error>
pub fn buffer_crop( &mut self, start_x: u32, start_y: u32, end_x: u32, end_y: u32, ) -> Result<FrameBuffer<'_>, Error>
Gets a cropped frame buffer.
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.
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>
Saves the frame buffer as an image to the specified path.
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> UnsafeUnpin 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