qoi

package module
v0.0.0-...-34f66f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 7 Imported by: 0

README

qoi

qoi is a Golang package for encoding and decoding QOI (Quite OK Image) format images. QOI is a lossless image format that offers a good balance between simplicity, speed, and compression. This package allows you to easily work with QOI images in your Go applications.

Features

  • Encoding: Convert raw image data to the QOI format.
  • Decoding: Convert QOI images back to raw image data.
  • Simple API: Easy-to-use functions for both encoding and decoding.

Installation

To install the package, run:

go get github.com/kriticalflare/qoi

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Documentation

Index

Constants

View Source
const MAGIC_BYTES string = "qoif"

Variables

View Source
var END_MARKER []byte = []byte{0, 0, 0, 0, 0, 0, 0, 1}

Functions

func Decode

func Decode(buffer []byte) (*state, error)

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

func Encode

func Encode(rgba []byte, height uint32, width uint32, channels uint8, colorspace uint8) ([]byte, error)

func ImageDecode

func ImageDecode(r io.Reader) (image.Image, error)

func ImageEncode

func ImageEncode(w io.Writer, m image.Image) error

Types

type Header struct {
	Magic      string
	Width      uint32
	Height     uint32
	Channels   uint8
	Colorspace uint8
}

func ReadHeader

func ReadHeader(file []byte) (*Header, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL