Documentation
¶
Overview ¶
qrencode provides functions to generate QR codes.
Index ¶
- Constants
- type BitGrid
- func (g *BitGrid) Clear()
- func (g *BitGrid) Empty(x, y int) bool
- func (g *BitGrid) Get(x, y int) bool
- func (g *BitGrid) Height() int
- func (g *BitGrid) Image(blockSize int) image.Image
- func (g *BitGrid) ImageWithMargin(blockSize, margin int) image.Image
- func (g *BitGrid) Set(x, y int, v bool)
- func (g *BitGrid) String() string
- func (g *BitGrid) Width() int
- type BitVector
- type ECLevel
Examples ¶
Constants ¶
View Source
const ( ECLevelM = ECLevel(0) ECLevelL = ECLevel(1) ECLevelH = ECLevel(2) ECLevelQ = ECLevel(3) )
View Source
const ( PENALTY_WEIGHT_N1 = 3 PENALTY_WEIGHT_N2 = 3 PENALTY_WEIGHT_N3 = 40 PENALTY_WEIGHT_N4 = 10 )
Penalty weights from section 6.8.2.1
View Source
const (
NUM_MASK_PATTERNS = 8
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitGrid ¶
type BitGrid struct {
// contains filtered or unexported fields
}
func Encode ¶
QR encode the content at the specified error correction level (ecLevel).
Example ¶
grid, err := Encode("Testing one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty.", ECLevelQ) if err != nil { return } f, err := os.Create("/tmp/qr.png") if err != nil { return } defer f.Close() png.Encode(f, grid.Image(8))
Output:
func EncodeBytes ¶
QR encode the content at the specified error correction level (ecLevel).
func NewBitGrid ¶
func (*BitGrid) Image ¶
Return an image of the grid, with black blocks for true items and white blocks for false items, with the given block size and a default margin.
func (*BitGrid) ImageWithMargin ¶
Return an image of the grid, with black blocks for true items and white blocks for false items, with the given block size and margin.
type BitVector ¶
type BitVector struct {
// contains filtered or unexported fields
}
func (*BitVector) AppendBits ¶
Click to show internal directories.
Click to hide internal directories.