decode
XuAPI
pub fn decode(data &string) image.RGBA用途
从编码数据中还原原始数据。失败时抛出错误,调用方需处理或继续传播。
参数
data&string- 数据(只读借用,调用方仍持有原值;类型 &string)
返回值
image.RGBA — 该类型的值
#image/jpeg基线 JPEG 解码与 RGBA 编码。
decodepub fn decode(data &string) image.RGBA从编码数据中还原原始数据。失败时抛出错误,调用方需处理或继续传播。
data &stringimage.RGBA — 该类型的值
encode_rgbapub fn encode_rgba(img &image.RGBA) string编码 rgba 数据。失败时抛出错误,调用方需处理或继续传播。
img &image.RGBAstring — 结果字符串