qart: github.com/vitrun/qart Index | Files | Directories

package qart

import "github.com/vitrun/qart"

Package qart generates a pretty qr img *

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

Index

Package Files

img.go qart.go

func Encode Uses

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 Uses

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

EncodeByFile encodes the given url with a specific image

func EncodeUrl Uses

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

EncodeUrl encodes the url to the prepared image

type Image Uses

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 Uses

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 Uses

func (m *Image) Encode() error

Encode encodes

Directories

PathSynopsis
codingPackage coding implements low-level QR coding details.
gf256Package gf256 implements arithmetic over the Galois Field GF(256).
qr

Package qart imports 13 packages (graph) and is imported by 1 packages. Updated 2016-07-23. Refresh now. Tools for package owners.