#image/gif
Xu 0.16.0 API
import: #image/gif
counts: 3 functions, 0 methods, 1 types, 0 constants, 0 method sets
GIF first-frame decode and RGBA encode.
struct GIF
pub struct GIF {
pub width int
pub height int
pub img image.RGBA
}
Purpose
Structure encapsulating width, height, img.
Public fields
width int- field (int)
height int- field (int)
img image.RGBA- field (image.RGBA)
decode
pub fn decode(src &string) GIF
Purpose
Decode data from encoded representation. Throws on failure; handle the error or propagate it to the caller.
Parameters
src &string- source (read-only borrow; caller keeps the original; type &string)
Returns
GIF — a value of this type
at
pub fn at(g &GIF, x int, y int) color.RGBA
Purpose
Execute at.
Parameters
g &GIF- g (read-only borrow; caller keeps the original; type &GIF)
x int- value (int)
y int- value (int)
Returns
color.RGBA — a value of this type
encode_rgba
pub fn encode_rgba(img &image.RGBA, pal &[]color.RGBA) string
Purpose
Encode rgba data. Throws on failure; handle the error or propagate it to the caller.
Parameters
img &image.RGBA- img (read-only borrow; caller keeps the original; type &image.RGBA)
pal &[]color.RGBA- pal (read-only borrow; caller keeps the original; type &[]color.RGBA)
Returns
string — result string