module qoi

May 22, 2022 ยท View on GitHub

contents

decode_header

fn decode_header(data []u8) ?Config

decode_header decodes a QOI header from memory.

[Return to contents]

encode

fn encode(data []u8, config Config) ?[]u8

encode encodes raw RGB or RGBA pixels into a QOI image in memory. The config struct must be filled with the image width, height, number of channels (3 = RGB, 4 = RGBA) and the colourspace.

[Return to contents]

read

fn read(filename string, channels int) ?[]u8

read reads and decodes a QOI image from the file system. If channels is 0, the number of channels from the file header is used. If channels is 3 or 4 the output format will be forced into this number of channels.

[Return to contents]

write

fn write(filename string, data []u8, config Config) ?

write encodes raw RGB or RGBA pixels into a QOI image and write it to the file system. The config struct must be filled with the image width, height, number of channels (3 = RGB, 4 = RGBA) and the colourspace.

[Return to contents]

decode

fn decode(data []u8, channels int) ?[]u8

decode decodes a QOI image from memory. If channels is 0, the number of channels from the file header is used. If channels is 3 or 4 the output format will be forced into this number of channels.

[Return to contents]

Powered by vdoc. Generated on: 22 May 2022 10:11:36