Single-pixel buffer

单像素 buffer 工厂

此协议扩展允许客户端创建单像素 buffer。

支持此协议扩展的 compositor 也应该支持 viewporter 协议扩展。客户端可以使用 viewporter 将单像素 buffer 缩放到所需尺寸。

警告!此文件中描述的协议目前处于测试阶段。向后兼容的更改可能会与相应的接口版本提升一起添加。向后不兼容的更改只能通过创建此扩展的新主版本来进行。

单像素 buffer 的全局工厂

wp_single_pixel_buffer_manager_v1 接口是一个单像素 buffer 的工厂。

destroy()
销毁该管理器

销毁 wp_single_pixel_buffer_manager_v1 对象。

通过此接口创建的子对象不受影响。

create_u32_rgba_buffer(id: new_id<wl_buffer>, r: uint, g: uint, b: uint, a: uint)
参数
类型
描述
idnew_id<wl_buffer>
ruint
value of the buffer's red channel
guint
value of the buffer's green channel
buint
value of the buffer's blue channel
auint
value of the buffer's alpha channel
从 32 位 RGBA 值创建 1×1 的 buffer

从四个 32 位 RGBA 值创建一个单像素 buffer。

除非在其他协议扩展中指定,否则 RGBA 值使用预乘 alpha (pre-multiplied alpha)。

buffer 的宽度和高度为 1。

r、g、b 和 a 参数的有效范围从 UINT32_MIN (0) 到 UINT32_MAX (0xffffffff)。

这些参数应被解释为百分比,即:


合成器支持

Cage
Cage
0.2.0
COSMIC
COSMIC
1.0.0~beta.8
GameScope
GameScope
3.15.14
Hyprland
Hyprland
0.52.1
Jay
1.12.0
KWin
KWin
6.6
Labwc
Labwc
0.9.2
Louvre
Louvre
2.14.1
Mir
Mir
2.26
Muffin
Muffin
6.6.0
Mutter
Mutter
49.2
niri
niri
25.11
phoc
phoc
0.52
river
river
0.3.13
Sway
Sway
1.11
Treeland
Treeland
0.8.0
Wayfire
Wayfire
0.9.0
Weston
Weston
14.0.2
wp_single_pixel_buffer_manager_v1
1
1
x
1
1
1
1
1
x
x
1
x
1
1
1
x
1
1

Copyright © 2022 Simon Ser

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Footer

© 2026 Wayland Explorer

本网站与 Wayland 官方项目无任何关联。网站所有内容均根据 Wayland 协议 XML 文件自动生成。

本网站使用的 Visual Studio Code - Codicons 遵循 CC BY 4.0 许可。