module

QOI

The Quite OK Image Format for Fast, Lossless Compression

Constants

MAGIC = StaticArray[113_u8, 111_u8, 105_u8, 102_u8]

First 4 bytes in QOI file.

PADDING = StaticArray[0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 1_u8]

Last 8 bytes in QOI file.

VERSION = "0.1.0"

Class methods

decode(qoi : IO | String | Path, raw : IO | String | Path) : QOI::Description

Decode a QOI file, writing pixels to raw IO in format found in image description.

decode(qoi : IO | String | Path) : Tuple(QOI::Description, Array(QOI::Pixel))

Decode a QOI file, returning image description and array of pixels.

encode(qoi : IO | String | Path, description : QOI::Description, pixels : Iterator(QOI::Pixel) | Iterable(QOI::Pixel)) : Nil

Encode a QOI file, reading pixels from an iterator.

encode(qoi : IO | String | Path, description : QOI::Description, raw : IO | String | Path) : Nil

Encode a QOI file, reading pixels from raw IO in format found in image description.

is_qoi?(path : Path | String) : Bool

Check whether or not file in path is a probably valid QOI file by checking if it starts with QOI magic bytes.

read_chunks(qoi : IO, description : QOI::Description) : QOI::ChunkReader

Try reading pixels from the input, returning pixel iterator.

read_description(qoi : IO) : QOI::Description

Try reading QOI image description from the input.

read_magic(qoi : IO) : Nil

Try reading magic header from the input, starting decoding process.

read_padding(qoi : IO) : Nil

Try reading padding, ending decoding process.

write_chunks(qoi : IO, description : QOI::Description) : QOI::ChunkWriter

Try writing pixels to output, reading them from iterator.

write_description(qoi : IO, description : QOI::Description) : Nil

Try writing description to output.

write_magic(qoi : IO) : Nil

Try writing QOI magic bytes to output, starting encoding process.

write_padding(qoi : IO) : Nil

Try writing padding, ending encoding process.

Nested types