qart

package module
v0.0.0-...-bf64b92 Latest Latest
Warning

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

Go to latest
Published: May 31, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

README

Qart

Instead of scribbling on redundant pieces and relying on error correction to preserve the meaning, qart engineers the encoded values to create the picture in a code with no inherent errors.

Technical Details

Check http://research.swtch.com/qart for detail. The original code is written by iRuss Cox and can be downloaded at code.google.com/p/rsc/source/browse/qr

Documentation

Overview

Package qart generates a pretty qr img *

  • Copyright ©2014-04-07 Alex <zhirun.yu@duitang.com>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(url string, src []byte, seed int64, version, scale, mask, x, y int,
	randCtrl, dither, onlyData, saveCtrl bool) []byte

Encode encodes a string with an image as the background

func EncodeByFile

func EncodeByFile(url, srcImg, dstImg string, version int)

EncodeByFile encodes the given url with a specific image

func EncodeUrl

func EncodeUrl(url string, img *Image) []byte

EncodeUrl encodes the url to the prepared image

Types

type Image

type Image struct {
	Target   [][]int
	Dx       int
	Dy       int
	URL      string
	Tag      string
	Version  int
	Mask     int
	Scale    int
	Rotation int
	Size     int

	// RandControl says to pick the pixels randomly.
	RandControl bool
	Seed        int64

	// Dither says to dither instead of using threshold pixel layout.
	Dither bool

	// OnlyDataBits says to use only data bits, not check bits.
	OnlyDataBits bool

	// Code is the final QR code.
	Code *qr.Code

	// Control is a PNG showing the pixels that we controlled.
	// Pixels we don't control are grayed out.
	SaveControl bool
	Control     []byte
}

Image generates the pretty qr code

func InitImage

func InitImage(src []byte, seed int64, version, scale, mask, x, y int,
	randCtrl, dither, onlyData, saveCtrl bool) *Image

InitImage prepares the image

func (*Image) Encode

func (m *Image) Encode() error

Encode encodes

Directories

Path Synopsis
Package coding implements low-level QR coding details.
Package coding implements low-level QR coding details.
Package gf256 implements arithmetic over the Galois Field GF(256).
Package gf256 implements arithmetic over the Galois Field GF(256).

Jump to

Keyboard shortcuts

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