XU XUv0.13.1
EN

#embedded/display

导入方式: #embedded/display

公开 API: 1 函数, 6 方法, 1 类型, 1 常量, 0 方法集

标准库包 `#embedded/display`。

const MAX_DIMENSION

XuAPI
pub const MAX_DIMENSION = 32768

用途

常量 MAX_DIMENSION,定义了相关的协议或算法配置参数。

struct Surface#T

XuAPI
pub struct Surface#T {
    pub backend T
}

用途

承载 backend 等属性的结构体。

公开字段

backend T
字段(T)

create

XuAPI
pub fn create#T(width int, height int, backend T, fill fn($&T, &geometry.Rect, int) bool, write fn($&T, &geometry.Span, &[]int) bool) Surface#T

用途

创建新的文件、目录或资源。

参数

width int
width(int)
height int
height(int)
backend T
backend(T)
fill fn($&T, &geometry.Rect, int) bool
fill(函数值;类型 fn($&T, &geometry.Rect, int) bool)
write fn($&T, &geometry.Span, &[]int) bool
write(函数值;类型 fn($&T, &geometry.Span, &[]int) bool)

返回值

Surface#T — 该类型的值

(&Surface#T) width

XuAPI
pub fn (surface &Surface#T) width() int

用途

在 &Surface#T 上执行 width 操作。

参数

surface &Surface#T
本次调用使用的 Surface#T 实例;以只读借用传入,调用方仍持有实例。

返回值

int — 该类型的值

(&Surface#T) height

XuAPI
pub fn (surface &Surface#T) height() int

用途

在 &Surface#T 上执行 height 操作。

参数

surface &Surface#T
本次调用使用的 Surface#T 实例;以只读借用传入,调用方仍持有实例。

返回值

int — 该类型的值

(&Surface#T) valid

XuAPI
pub fn (surface &Surface#T) valid() bool

用途

&Surface#T 上的操作:是否合法。

参数

surface &Surface#T
本次调用使用的 Surface#T 实例;以只读借用传入,调用方仍持有实例。

返回值

bool — 是否成立

($&Surface#T) fill_rect

XuAPI
pub fn (surface $&Surface#T) fill_rect(x int, y int, width int, height int, color int) bool

用途

$&Surface#T 上的操作:执行 fill rect 操作。

参数

surface $&Surface#T
本次调用使用的 Surface#T 实例;以独占借用传入,方法可修改它,调用方仍持有实例。
x int
值(int)
y int
值(int)
width int
width(int)
height int
height(int)
color int
color(int)

返回值

bool — 是否成立

($&Surface#T) clear

XuAPI
pub fn (surface $&Surface#T) clear(color int) bool

用途

清空所有已缓冲或存储的数据项与内部状态。

参数

surface $&Surface#T
本次调用使用的 Surface#T 实例;以独占借用传入,方法可修改它,调用方仍持有实例。
color int
color(int)

返回值

bool — 是否成立

($&Surface#T) write_rgb565

XuAPI
pub fn (surface $&Surface#T) write_rgb565(x int, y int, pixels &[]int, count int) bool

用途

$&Surface#T 上的操作:写入rgb565。

参数

surface $&Surface#T
本次调用使用的 Surface#T 实例;以独占借用传入,方法可修改它,调用方仍持有实例。
x int
值(int)
y int
值(int)
pixels &[]int
pixels(只读借用,调用方仍持有原值;类型 &[]int)
count int
count(int)

返回值

bool — 是否成立