Trait zng_ext_image::ImageRenderWindowsService

source ·
pub trait ImageRenderWindowsService:
    Send
    + Sync
    + 'static {
    // Required methods
    fn clone_boxed(&self) -> Box<dyn ImageRenderWindowsService>;
    fn new_window_root(
        &self,
        node: BoxedUiNode,
        render_mode: RenderMode,
        scale_factor: Option<Factor>,
    ) -> Box<dyn ImageRenderWindowRoot>;
    fn set_parent_in_window_context(&self, parent_id: WindowId);
    fn enable_frame_capture_in_window_context(
        &self,
        mask: Option<ImageMaskMode>,
    );
    fn open_headless_window(
        &self,
        new_window_root: Box<dyn FnOnce() -> Box<dyn ImageRenderWindowRoot> + Send>,
    );
    fn on_frame_image_ready(
        &self,
        update: &EventUpdate,
    ) -> Option<(WindowId, Img)>;
    fn close_window(&self, window_id: WindowId);
}
Expand description

Reference to a windows manager service that IMAGES can use to render images.

This service must be implemented by the window implementer, the WINDOWS service implements it.

Required Methods§

source

fn clone_boxed(&self) -> Box<dyn ImageRenderWindowsService>

Clone the service reference.

source

fn new_window_root( &self, node: BoxedUiNode, render_mode: RenderMode, scale_factor: Option<Factor>, ) -> Box<dyn ImageRenderWindowRoot>

Create a window root that presents the node.

source

fn set_parent_in_window_context(&self, parent_id: WindowId)

Set parent window for the headless render window.

source

fn enable_frame_capture_in_window_context(&self, mask: Option<ImageMaskMode>)

Enable frame capture for the window.

If mask is set captures only the given channel, if not set will capture the full BGRA image.

Called inside the WINDOW context for the new window.

source

fn open_headless_window( &self, new_window_root: Box<dyn FnOnce() -> Box<dyn ImageRenderWindowRoot> + Send>, )

Open the window.

The new_window_root is called inside the WINDOW context for the new window.

source

fn on_frame_image_ready(&self, update: &EventUpdate) -> Option<(WindowId, Img)>

Returns the rendered frame image if it is ready for reading.

source

fn close_window(&self, window_id: WindowId)

Close the window, does nothing if the window is not found.

Implementors§