XU XUv0.8.8
中文

API

#image/gif

import: #image/gif

counts: 3 fns, 0 methods, 1 types, 0 consts, 0 ifaces

GIF first-frame decode and RGBA encode.

struct GIF

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

Purpose

GIF87a/GIF89a first-frame decode + encode aligned with `image/gif` Decode / Encode of a paletted 2-D image. No animation, no interlace, no Image interface: pixels land in image.RGBA.

Parameters

width int
field (int)
height int
field (int)
img image.RGBA
field (image.RGBA)

decode

XuAPI
pub fn decode(src &string) GIF

Purpose

Decode. Throws on failure.

Parameters

src &string
source (borrowed; caller keeps it; type &string)

Returns

GIF — a value of this type

at

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

Purpose

at; returns color.RGBA.

Parameters

g &GIF
g (borrowed; caller keeps it; type &GIF)
x int
value (int)
y int
value (int)

Returns

color.RGBA — a value of this type

encode_rgba

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

Purpose

Encode. Throws on failure.

Parameters

img &image.RGBA
img (borrowed; caller keeps it; type &image.RGBA)
pal &[]color.RGBA
pal (borrowed; caller keeps it; type &[]color.RGBA)

Returns

string — result string