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§
sourcefn clone_boxed(&self) -> Box<dyn ImageRenderWindowsService>
fn clone_boxed(&self) -> Box<dyn ImageRenderWindowsService>
Clone the service reference.
sourcefn new_window_root(
&self,
node: BoxedUiNode,
render_mode: RenderMode,
scale_factor: Option<Factor>,
) -> Box<dyn ImageRenderWindowRoot>
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.
sourcefn set_parent_in_window_context(&self, parent_id: WindowId)
fn set_parent_in_window_context(&self, parent_id: WindowId)
Set parent window for the headless render window.
sourcefn enable_frame_capture_in_window_context(&self, mask: Option<ImageMaskMode>)
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.
sourcefn open_headless_window(
&self,
new_window_root: Box<dyn FnOnce() -> Box<dyn ImageRenderWindowRoot> + Send>,
)
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.
sourcefn on_frame_image_ready(&self, update: &EventUpdate) -> Option<(WindowId, Img)>
fn on_frame_image_ready(&self, update: &EventUpdate) -> Option<(WindowId, Img)>
Returns the rendered frame image if it is ready for reading.
sourcefn close_window(&self, window_id: WindowId)
fn close_window(&self, window_id: WindowId)
Close the window, does nothing if the window is not found.