#image/png
Xu 0.16.0 API
import: #image/png
counts: 7 functions, 0 methods, 0 types, 0 constants, 0 method sets
PNG encode/decode (8-bit, non-interlaced).
encode_rgba
pub fn encode_rgba(img &image.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)
Returns
string — result string
decode
pub fn decode(src &string) image.RGBA
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
image.RGBA — a value of this type
decode_rgba8
pub fn decode_rgba8(src &[]u8) image.RGBA8
Purpose
Decode rgba8 data. Throws on failure; handle the error or propagate it to the caller.
Parameters
src &[]u8- source (read-only borrow; caller keeps the original; type &[]u8)
Returns
image.RGBA8 — a value of this type
decode_rgba8_string
pub fn decode_rgba8_string(src &string) image.RGBA8
Purpose
Decode rgba8 string data. 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
image.RGBA8 — a value of this type
encode_rgba_bytes
pub fn encode_rgba_bytes(pixels &string,width int,height int) string
Purpose
Encode tightly packed top-left straight RGBA8 with filter None and stored DEFLATE. Byte buffers keep memory bounded without per-byte integer slots. Only IHDR/IDAT/IEND are emitted: no text, EXIF or other host metadata. Throws on failure; handle the error or propagate it to the caller.
Parameters
pixels &string- pixels (read-only borrow; caller keeps the original; type &string)
width int- width (int)
height int- height (int)
Returns
string — result string
encode_rgba8_string
pub fn encode_rgba8_string(img &image.RGBA8) string
Purpose
Encode rgba8 string data. Throws on failure; handle the error or propagate it to the caller.
Parameters
img &image.RGBA8- img (read-only borrow; caller keeps the original; type &image.RGBA8)
Returns
string — result string
encode_rgba8
pub fn encode_rgba8(img &image.RGBA8) []u8
Purpose
Encode rgba8 data. Throws on failure; handle the error or propagate it to the caller.
Parameters
img &image.RGBA8- img (read-only borrow; caller keeps the original; type &image.RGBA8)
Returns
[]u8 — slice result