package core:image/qoi

Overview

package qoi implements a QOI image reader

The QOI specification is at https://qoiformat.org.

Index

Variables (0)

This section is empty.

Procedure Groups (2)

Types

Error ¶

Error :: image.Error

Image ¶

Image :: image.Image

Options ¶

Options :: image.Options

QOI_Opcode_Tag ¶

QOI_Opcode_Tag :: enum u8 {
	// 2-bit tags
	INDEX = 0,   // 6-bit index into color array follows
	DIFF  = 64,  // 3x (RGB) 2-bit difference follows (-2..1), bias of 2.
	LUMA  = 128, // Luma difference
	RUN   = 192, // Run length encoding, bias -1
	// 8-bit tags
	RGB   = 254, // Raw RGB  pixel follows
	RGBA  = 255, // Raw RGBA pixel follows
}

RGBA_Pixel ¶

RGBA_Pixel :: [4]u8

RGB_Pixel ¶

RGB_Pixel :: [3]u8

Constants

QOI_Data_Mask ¶

QOI_Data_Mask :: 0b0011_1111

QOI_Opcode_Mask ¶

QOI_Opcode_Mask :: 0b1100_0000

Variables

This section is empty.

Procedures

destroy ¶

destroy :: proc "odin" (img: ^image.Image) {…}
 

Cleanup of image-specific data.

load_from_bytes ¶

load_from_bytes :: proc "odin" (data: []u8, options: image.Options, allocator: runtime.Allocator) -> (img: ^image.Image, err: image.Error) {…}

load_from_context ¶

load_from_context :: proc "odin" (ctx: ^$, options: image.Options = Options{}, allocator := context.allocator) -> (img: ^image.Image, err: image.Error) {…}

load_from_file ¶

load_from_file :: proc "odin" (filename: string, options: image.Options = Options{}, allocator := context.allocator) -> (img: ^image.Image, err: image.Error) {…}

qoi_hash ¶

qoi_hash :: proc "odin" (pixel: [4]u8) -> (index: u8) {…}

save_to_file ¶

save_to_file :: proc "odin" (output: string, img: ^image.Image, options: image.Options = Options{}, allocator := context.allocator) -> (err: image.Error) {…}

save_to_memory ¶

save_to_memory :: proc "odin" (output: ^bytes.Buffer, img: ^image.Image, options: image.Options = Options{}, allocator := context.allocator) -> (err: image.Error) {…}

Procedure Groups

Source Files

Generation Information

Generated with odin version dev-2022-10 (vendor "odin") Windows_amd64 @ 2022-10-05 21:11:47.476800300 +0000 UTC