pub struct DxgiDuplicationFrameBuffer<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> DxgiDuplicationFrameBuffer<'a>
impl<'a> DxgiDuplicationFrameBuffer<'a>
Sourcepub const fn new(
raw_buffer: &'a mut [u8],
width: u32,
height: u32,
row_pitch: u32,
depth_pitch: u32,
format: DxgiDuplicationFormat,
) -> Self
pub const fn new( raw_buffer: &'a mut [u8], width: u32, height: u32, row_pitch: u32, depth_pitch: u32, format: DxgiDuplicationFormat, ) -> Self
Constructs a new FrameBuffer.
Sourcepub const fn depth_pitch(&self) -> u32
pub const fn depth_pitch(&self) -> u32
Gets the depth pitch of the frame buffer.
Sourcepub const fn format(&self) -> DxgiDuplicationFormat
pub const fn format(&self) -> DxgiDuplicationFormat
Gets the color format of the frame buffer.
Sourcepub const fn has_padding(&self) -> bool
pub const fn has_padding(&self) -> bool
Checks if the buffer has padding.
Sourcepub fn as_nopadding_buffer<'b>(&'b self, buffer: &'b mut Vec<u8>) -> &'b [u8] ⓘ
pub fn as_nopadding_buffer<'b>(&'b self, buffer: &'b mut Vec<u8>) -> &'b [u8] ⓘ
Gets the pixel data without padding.
Sourcepub const fn as_raw_buffer(&mut self) -> &mut [u8] ⓘ
pub const fn as_raw_buffer(&mut self) -> &mut [u8] ⓘ
Gets the raw pixel data, which may include padding.
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 DxgiDuplicationFrameBuffer<'a>
impl<'a> RefUnwindSafe for DxgiDuplicationFrameBuffer<'a>
impl<'a> Send for DxgiDuplicationFrameBuffer<'a>
impl<'a> Sync for DxgiDuplicationFrameBuffer<'a>
impl<'a> Unpin for DxgiDuplicationFrameBuffer<'a>
impl<'a> UnsafeUnpin for DxgiDuplicationFrameBuffer<'a>
impl<'a> !UnwindSafe for DxgiDuplicationFrameBuffer<'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