pub struct FrameBuffer<'a> { /* private fields */ }展开描述
实现§
源码§impl<'a> FrameBuffer<'a>
impl<'a> FrameBuffer<'a>
源码pub const fn new(
raw_buffer: &'a mut [u8],
width: u32,
height: u32,
row_pitch: u32,
depth_pitch: u32,
color_format: ColorFormat,
) -> Self
pub const fn new( raw_buffer: &'a mut [u8], width: u32, height: u32, row_pitch: u32, depth_pitch: u32, color_format: ColorFormat, ) -> Self
构造一个新的 FrameBuffer。
源码pub const fn depth_pitch(&self) -> u32
pub const fn depth_pitch(&self) -> u32
获取帧缓冲区的深度距。
源码pub const fn color_format(&self) -> ColorFormat
pub const fn color_format(&self) -> ColorFormat
获取帧缓冲区的颜色格式。
源码pub const fn has_padding(&self) -> bool
pub const fn has_padding(&self) -> bool
检查缓冲区是否有填充。
源码pub const fn as_raw_buffer(&mut self) -> &mut [u8] ⓘ
pub const fn as_raw_buffer(&mut self) -> &mut [u8] ⓘ
获取原始像素数据,可能包含填充。
源码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 FrameBuffer<'a>
impl<'a> RefUnwindSafe for FrameBuffer<'a>
impl<'a> Send for FrameBuffer<'a>
impl<'a> Sync for FrameBuffer<'a>
impl<'a> Unpin for FrameBuffer<'a>
impl<'a> UnsafeUnpin for FrameBuffer<'a>
impl<'a> !UnwindSafe for FrameBuffer<'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>。 了解更多