跳转到主要内容

Frame

搜索

结构体 Frame 

源码
pub struct Frame<'a> { /* private fields */ }
展开描述

表示从图形捕获项捕获的帧。

§Example

// 从捕获会话获取一帧
let mut buffer = frame.buffer()?;
buffer.save_as_image("screenshot.png", ImageFormat::Png)?;

实现§

源码§

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

构造一个新的 Frame

源码

pub const fn width(&self) -> u32

获取帧的宽度。

源码

pub fn dirty_regions(&self) -> Result<Vec<DirtyRegion>, Error>

获取帧的脏区域。

源码

pub const fn height(&self) -> u32

获取帧的高度。

源码

pub fn timestamp(&self) -> Result<TimeSpan, Error>

获取帧的时间戳。

源码

pub const fn color_format(&self) -> ColorFormat

获取帧的颜色格式。

源码

pub const fn as_raw_surface(&self) -> &IDirect3DSurface

获取帧的原始表面。

源码

pub const fn as_raw_texture(&self) -> &ID3D11Texture2D

获取帧的原始纹理。

源码

pub const fn device(&self) -> &ID3D11Device

获取与此帧关联的底层 Direct3D 设备。

源码

pub const fn device_context(&self) -> &ID3D11DeviceContext

获取用于此帧上 GPU 操作的设备上下文。

源码

pub const fn desc(&self) -> &D3D11_TEXTURE2D_DESC

获取帧的纹理描述。

源码

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_without_title_bar(&mut self) -> Result<FrameBuffer<'_>, 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> Any for T
where T: 'static + ?Sized,

源码§

fn type_id(&self) -> TypeId

获取 selfTypeId了解更多
源码§

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

源码§

fn borrow(&self) -> &T

从拥有的值不可变地借用。 了解更多
源码§

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

源码§

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

从拥有的值可变地借用。 了解更多
源码§

impl<T> From<T> for T

源码§

fn from(t: T) -> T

原样返回参数。

源码§

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

源码§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换由 From<T> for U 的实现决定。

源码§

impl<T> IntoEither for T

源码§

fn into_either(self, into_left: bool) -> Either<Self, Self>

into_lefttrue 时,将 self 转换为 Left 变体的 Either<Self, Self>; 否则将其转换为 Right 变体的 Either<Self, Self>了解更多
源码§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

into_left(&self) 返回 true 时,将 self 转换为 Left 变体的 Either<Self, Self>; 否则将其转换为 Right 变体的 Either<Self, Self>了解更多
源码§

impl<T> Pointable for T

源码§

const ALIGN: usize

指针的对齐方式。
源码§

type Init = T

用于初始化的类型。
源码§

unsafe fn init(init: <T as Pointable>::Init) -> usize

使用给定的初始化器初始化 a。 了解更多
源码§

unsafe fn deref<'a>(ptr: usize) -> &'a T

解引用给定的指针。 了解更多
源码§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

可变地解引用给定的指针。 了解更多
源码§

unsafe fn drop(ptr: usize)

丢弃给定指针所指向的对象。 了解更多
源码§

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

源码§

type Error = Infallible

在转换出错时返回的类型。
源码§

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

执行转换。
源码§

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

源码§

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

在转换出错时返回的类型。
源码§

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

执行转换。