Skip to main content

RecordingCompose

Struct RecordingCompose 

Source
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: bool

Tracks 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: bool

Same for screen.

Implementations§

Source§

impl RecordingCompose

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn set_background_color(&mut self, color: Color)

Paint the editor backdrop as a flat color (ED.18).

Source

pub fn set_background_visible(&mut self, visible: bool)

Toggle the gradient/color backdrop (ED.18) — the wallpaper↔gradient lever.

Source

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.

Source

pub fn set_frame_shadow_visible(&mut self, visible: bool)

Toggle the drop shadow (ED.18).

Source

pub fn set_frame_border( &mut self, window: Rect, corner_radius: f32, stroke: Stroke, )

Draw the inset border (ED.18).

Source

pub fn set_frame_border_visible(&mut self, visible: bool)

Toggle the inset border (ED.18).

Source

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.

Source

pub fn set_background_wallpaper_visible(&mut self, visible: bool)

Toggle the wallpaper backdrop (ED.18) — the wallpaper↔gradient lever.

Source

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.

Source

pub fn set_cursor_visible(&mut self, visible: bool)

Toggle the editor cursor overlay’s visibility (ED.19).

Source

pub fn dimensions(&self) -> (u32, u32)

Output dimensions in pixels.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

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

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> WasmNotSend for T
where T: Send,