compressed

package module
v0.0.0-...-4d07a44 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 6 Imported by: 0

README

Compressed Writer

go.dev reference

Compressed Writer is a writer that is used to draw QR Code image on a very small scale. Since the compressed writer would only use a two-tone palette to generate the image, and automatically compressed in PNG format.

Check codes for more details about compress principle.

Usage

option := compressed.Option{
	Padding:   4, // padding pixels around the qr code.
	BlockSize: 1, // block pixels which represents a bit data.
}

w, err := compressed.New(name, &option)
	if err != nil {
	panic(err)
}

if err := qrc.Save(w); err != nil {
	panic(err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(filename string, opt *Option) (qrcode.Writer, error)

func NewWithWriter

func NewWithWriter(writeCloser io.WriteCloser, opt *Option) qrcode.Writer

Types

type Option

type Option struct {
	Padding   int
	BlockSize int
}

Jump to

Keyboard shortcuts

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