XU XUv0.8.8
EN

API

#image/gif

import: #image/gif

counts: 3 函数, 0 方法, 1 类型, 0 常量, 0 方法集

GIF 首帧解码与 RGBA 编码。

struct GIF

XuAPI
pub struct GIF {
    pub width int
    pub height int
    pub img image.RGBA
}

用途

公开结构体 `GIF`。

参数

width int
字段(int)
height int
字段(int)
img image.RGBA
字段(image.RGBA)

decode

XuAPI
pub fn decode(src &string) GIF

用途

解码。失败时 throw。

参数

src &string
源数据(借用,调用方仍持有;类型 &string)

返回

GIF — 该类型的值

at

XuAPI
pub fn at(g &GIF, x int, y int) color.RGBA

用途

at,返回 color.RGBA。

参数

g &GIF
g(借用,调用方仍持有;类型 &GIF)
x int
值(int)
y int
值(int)

返回

color.RGBA — 该类型的值

encode_rgba

XuAPI
pub fn encode_rgba(img &image.RGBA, pal &[]color.RGBA) string

用途

编码。失败时 throw。

参数

img &image.RGBA
img(借用,调用方仍持有;类型 &image.RGBA)
pal &[]color.RGBA
pal(借用,调用方仍持有;类型 &[]color.RGBA)

返回

string — 结果字符串