pub struct Frame<'a> { /* private fields */ }展开描述
实现§
源码§impl<'a> Frame<'a>
impl<'a> Frame<'a>
源码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
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
构造一个新的 Frame。
源码pub fn dirty_regions(&self) -> Result<Vec<DirtyRegion>, Error>
pub fn dirty_regions(&self) -> Result<Vec<DirtyRegion>, Error>
获取帧的脏区域。
源码pub const fn color_format(&self) -> ColorFormat
pub const fn color_format(&self) -> ColorFormat
获取帧的颜色格式。
源码pub const fn as_raw_surface(&self) -> &IDirect3DSurface
pub const fn as_raw_surface(&self) -> &IDirect3DSurface
获取帧的原始表面。
源码pub const fn as_raw_texture(&self) -> &ID3D11Texture2D
pub const fn as_raw_texture(&self) -> &ID3D11Texture2D
获取帧的原始纹理。
源码pub const fn device_context(&self) -> &ID3D11DeviceContext
pub const fn device_context(&self) -> &ID3D11DeviceContext
获取用于此帧上 GPU 操作的设备上下文。
源码pub fn buffer(&mut self) -> Result<FrameBuffer<'_>, Error>
pub fn buffer(&mut self) -> Result<FrameBuffer<'_>, Error>
获取帧缓冲区。
源码pub 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>
获取裁剪后的帧缓冲区。
源码pub fn buffer_without_title_bar(&mut self) -> Result<FrameBuffer<'_>, Error>
pub fn buffer_without_title_bar(&mut self) -> Result<FrameBuffer<'_>, Error>
获取不带标题栏的帧缓冲区。
源码pub 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>
将帧缓冲区另存为图像到指定路径。
自动 trait 实现§
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 实现§
源码§impl<T> IntoEither for T
impl<T> IntoEither for T
源码§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
当
into_left 为 true 时,将 self 转换为
Left 变体的
Either<Self, Self>;
否则将其转换为
Right 变体的
Either<Self, Self>。 了解更多源码§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
当
into_left(&self) 返回 true 时,将 self 转换为
Left 变体的
Either<Self, Self>;
否则将其转换为
Right 变体的
Either<Self, Self>。 了解更多