optimizer

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: EUPL-1.2 Imports: 8 Imported by: 0

README

Bitmap-optimizer

Bitmap optimizer is a bespoke codegen to embed a bitmap image into a binary for quick drawing individual colours in parallel.

It generates Go-source files that have a uint32-slice per colour.

Its intended usecase is for continuous drawing bitmap images to online-graffitiboards such as reddits "Place".

The lists are unique overall, and therefore safe to draw in parallel.

Usage:
Usage of optimize:
  -input-file string
    	Image file to optimize (use - for stdin) (default "-")
  -output-file string
    	Go file to output (use - for stdout) (default "-")
  -package string
    	package name for Go file (default "main")
Example:
package main

//go:generate optimizer -input-file=file.bmp -output-file=colours.go -package main

func main() {
    // Point unpacks the uint32 in X,Y coordinates where X and Y [0, 0xFF)
    x,y := Point(Colours["#000000"][0])
    draw(x,y, "#000000")
}

func draw(_, _ int, _ string) {

}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Optimize

func Optimize(img image.Image, out io.Writer, packagename string) error

Types

This section is empty.

Directories

Path Synopsis
cmd
optimize command

Jump to

Keyboard shortcuts

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