pub struct OffscreenTarget { /* private fields */ }Expand description
Frames drawn into a texture with depth and stencil, which
read_image reads back.
Implementations§
Source§impl OffscreenTarget
impl OffscreenTarget
Sourcepub fn new(backend: Rc<RendererBackend>, size: Size) -> Self
pub fn new(backend: Rc<RendererBackend>, size: Size) -> Self
A target of size physical pixels on backend.
Sourcepub fn backend(&self) -> &Rc<RendererBackend>
pub fn backend(&self) -> &Rc<RendererBackend>
The backend the target draws on.
pub fn size(&self) -> Size
Sourcepub fn resize(&self, size: Size)
pub fn resize(&self, size: Size)
Draws the next frame at size, and drops the image of the last one.
Sourcepub fn read_image(&self) -> Option<PremultipliedImage>
pub fn read_image(&self) -> Option<PremultipliedImage>
The last frame’s pixels, or None before the first frame of the
size.
Trait Implementations§
Source§impl FrameTarget for OffscreenTarget
impl FrameTarget for OffscreenTarget
Source§fn begin_frame(&self) -> Option<Rc<dyn DrawTarget>>
fn begin_frame(&self) -> Option<Rc<dyn DrawTarget>>
Begins a frame, and returns what the renderer draws it into, or
None
when the target has nothing to draw into now: it has no surface, or
the surface is hidden or out of date. The caller then skips the frame.
Until end_frame, each call returns the same
image.Source§fn end_frame(&self, encoder: &dyn GfxCommandEncoder) -> Handoff
fn end_frame(&self, encoder: &dyn GfxCommandEncoder) -> Handoff
Submits what the renderer recorded into
encoder for the frame, and
hands the frame’s image off.Auto Trait Implementations§
impl !Freeze for OffscreenTarget
impl !RefUnwindSafe for OffscreenTarget
impl !Send for OffscreenTarget
impl !Sync for OffscreenTarget
impl !UnwindSafe for OffscreenTarget
impl Forget for OffscreenTarget
impl Move for OffscreenTarget
impl Unpin for OffscreenTarget
impl UnsafeUnpin for OffscreenTarget
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