pub struct RecordingCompose {
app: Application,
renderer: Renderer,
scene: RecordingScene,
target: RenderTexture,
width: u32,
height: u32,
has_camera_frame: bool,
has_screen_frame: bool,
}Expand description
Owner of the wisp + wgpu pipeline. Single-thread. Construct on
the encoder feed thread + call Self::compose_frame once per
frame.
Fields§
§app: Application§renderer: Renderer§scene: RecordingScene§target: RenderTexture§width: u32§height: u32§has_camera_frame: boolTracks whether we’ve ever uploaded a camera frame. Used so
the scene doesn’t render a stale-empty VideoTexture cam
rect when the user disabled the cam channel.
has_screen_frame: boolSame for screen.
Implementations§
Source§impl RecordingCompose
impl RecordingCompose
Sourcepub fn new(
width: u32,
height: u32,
screen_dims: StreamDimensions,
cam_dims: StreamDimensions,
) -> Result<Self, Error>
pub fn new( width: u32, height: u32, screen_dims: StreamDimensions, cam_dims: StreamDimensions, ) -> Result<Self, Error>
Boot a fresh wisp Application + allocate the BGRA
RenderTexture for the configured output resolution.
§Errors
Returns the underlying [wisp::Error] if the adapter / device
can’t be created. On macOS dev machines this should always
succeed.
Sourcepub fn compose_frame(
&mut self,
camera_slot: &FrameSlot,
screen_slot: &FrameSlot,
) -> Option<ComposedFrame>
pub fn compose_frame( &mut self, camera_slot: &FrameSlot, screen_slot: &FrameSlot, ) -> Option<ComposedFrame>
Pull the latest BGRA from each slot, upload to the scene,
render to the target, read back via RenderTexture::read_pixels.
Returns None when neither slot has ever been written
to — caller should skip pushing anything to the encoder
this tick.
Sourcepub fn set_screen_transform(&mut self, transform: Transform)
pub fn set_screen_transform(&mut self, transform: Transform)
Set the screen sprite’s local transform — the editor’s crop-then-zoom
framing (ED.15/ED.16). The recorder never calls this, so its screen
stays at the base fill transform. Apply before Self::compose_frame
so it lands on that frame.
Sourcepub fn set_screen_clip(&mut self, shape: Option<MaskShape>)
pub fn set_screen_clip(&mut self, shape: Option<MaskShape>)
Set (or clear) the screen sprite’s clip — the editor’s rounded-corner frame window (ED.18). The recorder never calls this, so its screen stays full-bleed and un-clipped.
Sourcepub fn set_background_gradient(
&mut self,
from: Color,
to: Color,
angle_deg: f32,
)
pub fn set_background_gradient( &mut self, from: Color, to: Color, angle_deg: f32, )
Paint the editor backdrop as a linear gradient (ED.18). The recorder never calls this, so its scene has no backdrop node.
Sourcepub fn set_background_color(&mut self, color: Color)
pub fn set_background_color(&mut self, color: Color)
Paint the editor backdrop as a flat color (ED.18).
Sourcepub fn set_background_visible(&mut self, visible: bool)
pub fn set_background_visible(&mut self, visible: bool)
Toggle the gradient/color backdrop (ED.18) — the wallpaper↔gradient lever.
Sourcepub fn set_frame_shadow(
&mut self,
window: Rect,
corner_radius: f32,
offset: Vec2,
color: Color,
)
pub fn set_frame_shadow( &mut self, window: Rect, corner_radius: f32, offset: Vec2, color: Color, )
Draw the framed-screen drop shadow (ED.18). The recorder never calls this, so its scene has no shadow.
Sourcepub fn set_frame_shadow_visible(&mut self, visible: bool)
pub fn set_frame_shadow_visible(&mut self, visible: bool)
Toggle the drop shadow (ED.18).
Sourcepub fn set_frame_border(
&mut self,
window: Rect,
corner_radius: f32,
stroke: Stroke,
)
pub fn set_frame_border( &mut self, window: Rect, corner_radius: f32, stroke: Stroke, )
Draw the inset border (ED.18).
Sourcepub fn set_frame_border_visible(&mut self, visible: bool)
pub fn set_frame_border_visible(&mut self, visible: bool)
Toggle the inset border (ED.18).
Sourcepub fn set_background_wallpaper(&mut self, width: u32, height: u32, rgba: &[u8])
pub fn set_background_wallpaper(&mut self, width: u32, height: u32, rgba: &[u8])
Set the wallpaper backdrop from decoded RGBA8 (ED.18). The recorder never calls this.
Sourcepub fn set_background_wallpaper_visible(&mut self, visible: bool)
pub fn set_background_wallpaper_visible(&mut self, visible: bool)
Toggle the wallpaper backdrop (ED.18) — the wallpaper↔gradient lever.
Sourcepub fn set_cursor(
&mut self,
pointer_ndc: Vec2,
half: f32,
ripples: &[CursorRipple],
)
pub fn set_cursor( &mut self, pointer_ndc: Vec2, half: f32, ripples: &[CursorRipple], )
Draw the editor cursor overlay (ED.19) — pointer at pointer_ndc
sized by half, with click ripples. The recorder never calls this.
Sourcepub fn set_cursor_visible(&mut self, visible: bool)
pub fn set_cursor_visible(&mut self, visible: bool)
Toggle the editor cursor overlay’s visibility (ED.19).
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Output dimensions in pixels.
Auto Trait Implementations§
impl !Freeze for RecordingCompose
impl !RefUnwindSafe for RecordingCompose
impl Send for RecordingCompose
impl !Sync for RecordingCompose
impl Unpin for RecordingCompose
impl UnsafeUnpin for RecordingCompose
impl !UnwindSafe for RecordingCompose
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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