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::attachjoins 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’swp_color_manager_v1announces (Capabilities) and its preferred image description for the window (Description, kept current byDisplay::poll);Display::subsurfacemakes aSubsurface: awl_surfaceplaced below the window’s, synchronised with it, taking no input, scaled throughwp_viewporter; itsSurfaceHandleis what wgpu creates a surface on;Subsurface::tagdeclares 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_v1announces 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). - Surface
Handle - The raw handles of an image surface, for wgpu
(
Instance::create_surface): the window’s display and the subsurface’swl_surface, kept alive as long as the handle is.
Enums§
- Feature
- Optional features of the protocol (
wp_color_manager_v1.feature). - Named
Primaries - Named primaries of the protocol (
wp_color_manager_v1.primaries). - Named
Transfer - 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.