Skip to main content

Crate egui_pop_wayland

Crate egui_pop_wayland 

Source
Expand description

The Wayland layer of egui-pop’s image viewport.

winit binds no colour management and eframe configures every window 8-bit sRGB (see the register of upstream workarounds, docs/upstream.md), so an image cannot be shown in a wider gamut through the window’s own surface. This crate gives the image a surface of its own instead, under the window, that the compositor is told the encoding of (docs/wayland-colour.md):

  • Display::attach joins the connection winit opened, from the window’s raw handles, on an event queue of its own (winit never sees its events), and reads what the compositor’s wp_color_manager_v1 announces (Capabilities) and its preferred image description for the window (Description, kept current by Display::poll);
  • Display::subsurface makes a Subsurface: a wl_surface placed below the window’s, synchronised with it, taking no input, scaled through wp_viewporter; its SurfaceHandle is what wgpu creates a surface on;
  • Subsurface::tag declares its encoding (named primaries and transfer function), once the description is ready.

The crate knows nothing of egui or wgpu; the viewport maps its plain types. On other systems, and for a window that is not a Wayland one, Display::attach answers Unavailable.

Re-exports§

pub use raw_window_handle;

Structs§

Capabilities
What the compositor’s wp_color_manager_v1 announces to a version 1 client (what a Vulkan driver binding version 1 sees too).
Description
An image description as the compositor gives it (wp_image_description_info_v1): the encoding it prefers for a surface, and the display’s volume (the target).
Display
The compositor, as seen from a window: its globals, its colour manager’s announcements, the preferred description for the window.
Luminances
Luminances in cd/m².
Subsurface
An image’s surface under a window’s (see Display::subsurface).
SurfaceHandle
The raw handles of an image surface, for wgpu (Instance::create_surface): the window’s display and the subsurface’s wl_surface, kept alive as long as the handle is.

Enums§

Feature
Optional features of the protocol (wp_color_manager_v1.feature).
NamedPrimaries
Named primaries of the protocol (wp_color_manager_v1.primaries).
NamedTransfer
Named transfer functions of the protocol (wp_color_manager_v1.transfer_function).
Unavailable
Why there is no image surface.

Functions§

chromaticities
Protocol chromaticities (× 1 000 000) as [x, y] pairs.
intent_name
The name of a rendering intent’s protocol code.

Type Aliases§

Chromaticities
Chromaticities [x, y] of red, green, blue and white.