Documentation ¶
Index ¶
- Variables
- func Bit2Byte(bits []bool) byte
- func Bit2Int(bits []bool) int
- func Bits2Bytes(datacode []bool, version int) []byte
- func Bool2Byte(datacode []bool) []byte
- func Byte2Bool(bl []byte) []bool
- func Copy(src interface{}) interface{}
- func ExportEveryGroup(size image.Rectangle, kong [][]Pos, filename string)
- func ExportGroup(size image.Rectangle, group []Pos, filename string)
- func ExportGroups(size image.Rectangle, kong []*PosGroup, filename string)
- func ExportMatrix(size image.Rectangle, points [][]bool, filename string)
- func GetData(unmaskmatrix, dataarea *Matrix) []bool
- func GetDataEncoder(version int) *dataEncoder
- func IsPositionDetectionPattern(bukonggroup, konggroup *PosGroup) bool
- func IsVertical(kf, kl *K) (offset float64)
- func Kong(group *PosGroup) bool
- func Line(start, end *Pos, matrix *Matrix) (line []bool)
- func LineWidth(positionDetectionPatterns [][]*PosGroup) float64
- func MaskFunc(code int) func(x, y int) bool
- func ParseBlock(m *Matrix, data []bool) []bool
- func QRReconstruct(data, ecc []byte) []byte
- func Radian(k *K)
- func Rectangle(group []Pos) (minx, maxx, miny, maxy int)
- func SplitGroup(poss *[][]bool, centerx, centery int, around *[]Pos)
- func StringBool(datacode []bool) string
- func StringByte(b []byte) string
- type Block
- type K
- type Matrix
- func (m *Matrix) At(x, y int) bool
- func (matrix *Matrix) Binarizat() uint8
- func (m *Matrix) Centerlist(line []bool, offset int) (li []int)
- func (m *Matrix) DataArea() *Matrix
- func (m *Matrix) FormatInfo() (ErrorCorrectionLevel, Mask int)
- func (m *Matrix) GetBin(poss []Pos) int
- func (matrix *Matrix) ReadImage()
- func (matrix *Matrix) SplitGroups() [][]Pos
- func (m *Matrix) Version() int
- type Pos
- type PosGroup
- type PositionDetectionPatterns
- type QRcodeVersion
- type RecoveryLevel
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AlignmentPatternCenter = [][]int{ {}, {}, {6, 18}, {6, 22}, {6, 26}, {6, 30}, {6, 34}, {6, 22, 38}, {6, 24, 42}, {6, 26, 46}, {6, 28, 50}, {6, 30, 54}, {6, 32, 58}, {6, 34, 62}, {6, 26, 46, 66}, {6, 26, 48, 70}, {6, 26, 50, 74}, {6, 30, 54, 78}, {6, 30, 56, 82}, {6, 30, 58, 86}, {6, 34, 62, 90}, {6, 28, 50, 72, 94}, {6, 26, 50, 74, 98}, {6, 30, 54, 78, 102}, {6, 28, 54, 80, 106}, {6, 32, 58, 84, 110}, {6, 30, 58, 86, 114}, {6, 34, 62, 90, 118}, {6, 26, 50, 74, 98, 122}, {6, 30, 54, 78, 102, 126}, {6, 26, 52, 78, 104, 130}, {6, 30, 56, 82, 108, 134}, {6, 34, 60, 86, 112, 138}, {6, 30, 58, 86, 114, 142}, {6, 34, 62, 90, 118, 146}, {6, 30, 54, 78, 102, 126, 150}, {6, 24, 50, 76, 102, 128, 154}, {6, 28, 54, 80, 106, 132, 158}, {6, 32, 58, 84, 110, 136, 162}, {6, 26, 54, 82, 110, 138, 166}, {6, 30, 58, 86, 114, 142, 170}, } Versions = []QRcodeVersion{}/* 160 elements not displayed */ )
View Source
var Debug = false
Functions ¶
func Bits2Bytes ¶
func Copy ¶
func Copy(src interface{}) interface{}
Copy creates a deep copy of whatever is passed to it and returns the copy in an interface{}. The returned value will need to be asserted to the correct type.
func GetDataEncoder ¶
func GetDataEncoder(version int) *dataEncoder
func IsVertical ¶
func ParseBlock ¶
func QRReconstruct ¶
func SplitGroup ¶
func StringBool ¶
func StringByte ¶
Types ¶
type Matrix ¶
type Matrix struct { OrgImage image.Image OrgSize image.Rectangle OrgPoints [][]bool Points [][]bool Size image.Rectangle Data []bool Content string }
func (*Matrix) FormatInfo ¶
func (*Matrix) SplitGroups ¶
type PositionDetectionPatterns ¶
func NewPositionDetectionPattern ¶
func NewPositionDetectionPattern(pdps [][]*PosGroup) *PositionDetectionPatterns
type QRcodeVersion ¶
type QRcodeVersion struct { // Version number (1-40 inclusive). Version int // Error recovery Level. Level RecoveryLevel DataEncoderType dataEncoderType // Encoded data can be split into multiple blocks. Each Block contains data // and error recovery bytes. // // Larger QR Codes contain more blocks. Block []Block // Number of bits required to pad the combined data & error correction bit // stream up to the symbol's full capacity. NumRemainderBits int }
QRcodeVersion describes the data length and encoding order of a single QR Code Version. There are 40 versions numbers x 4 recovery levels == 160 possible QRcodeVersion structures.
type RecoveryLevel ¶
type RecoveryLevel int
Error detection/recovery capacity.
There are several levels of error detection/recovery capacity. Higher levels of error recovery are able to correct more errors, with the trade-off of increased symbol size.
const ( // Level M: 15% error recovery. Good default choice. 0b00 Medium RecoveryLevel = iota // Level L: 7% error recovery. 0b01 Low // Level H: 30% error recovery.0b10 Highest // Level Q: 25% error recovery.0b11 High )
Click to show internal directories.
Click to hide internal directories.