The qoi Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The qoi Reference Manual

This is the qoi Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:39:51 2022 GMT+0.

Table of Contents


1 Introduction

QOI

QOI is a Common Lisp library for reading and writing QOI (Quite OK Image Format) files.

decoding/reading

decode takes an input stream of octets and decodes it to an image. image is an 1D array of size width * height * channels (channels = 3 for RGB file and = 4 for RGBA file).

To decode a qoi file simply:

(with-open-file (stream #p"./dice.qoi" :element-type '(unsigned-byte 8))
  (decode stream))

decode returns multiple values: (values image width height channels colorspace).

encoding/writing

encode takes an binary output stream and an image array then encodes the image and writes it to that stream.

To encode and save an image to output-file smiply:

(with-open-file (stream output-file
                        :direction :output
                        :if-exists :supersede
                        :element-type '(unsigned-byte 8))
  (encode stream image width height channels colorspace))

License

MIT


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 qoi

Library for encoding/decoding QOI (Quite OK Image Format) files

Author

Bibek Panthi <bpanthi977@gmail.com>

License

MIT

Version

0.0.1

Dependency

alexandria (system).

Source

qoi.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 qoi/qoi.asd

Source

qoi.asd.

Parent Component

qoi (system).

ASDF Systems

qoi.


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.2 qoi/package.lisp

Source

qoi.asd.

Parent Component

qoi (system).

Packages

qoi.


Previous: , Up: Lisp   [Contents][Index]

3.1.3 qoi/qoi.lisp

Dependency

package.lisp (file).

Source

qoi.asd.

Parent Component

qoi (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 qoi

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Ordinary functions

Function: decode (stream)

decode qoi from ‘stream’ of type (unsigned-byte 8)
Returns ‘image’ : an 1D array with consecutive pixel values
Also returns width, height, channels and colorspace values of the image

Package

qoi.

Source

qoi.lisp.

Function: encode (stream image width height channels colorspace)

encode ‘image’ in ‘qoi’ format; writing to ‘stream’ of type (unsigned-byte 8) ‘image’ is 1D array of size width*height*channels of type (integer 0 255) ‘channels’ = 3 or 4 (i.e. RGB or RGBA)
‘colorspace’ = 1 or 0; This value doesn’t affect the encoding

Package

qoi.

Source

qoi.lisp.


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Constants

Constant: +qoi-magic+

Magic bytes as integer

Package

qoi.

Source

qoi.lisp.

Constant: +qoi-op-diff+
Package

qoi.

Source

qoi.lisp.

Constant: +qoi-op-luma+
Package

qoi.

Source

qoi.lisp.

Constant: +qoi-op-rgb+
Package

qoi.

Source

qoi.lisp.

Constant: +qoi-op-rgba+
Package

qoi.

Source

qoi.lisp.

Constant: +qoi-op-run+
Package

qoi.

Source

qoi.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.2 Macros

Macro: copy-array ((from m) (to n) alphap)
Package

qoi.

Source

qoi.lisp.

Macro: setf-array ((last? position array) &rest values)

stores ‘values’ at consecutive position in ‘array’. if last? is false don’t store last value

Package

qoi.

Source

qoi.lisp.


Previous: , Up: Internals   [Contents][Index]

5.2.3 Ordinary functions

Function: read-uint32-be (stream)

Read unsigned 32 bit integer in big endian from stream

Package

qoi.

Source

qoi.lisp.

Function: write-uint32-be (stream int)

Write unsigned 32 bit integer in big endian to stream

Package

qoi.

Source

qoi.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts