Documentation ¶
Index ¶
- Variables
- func Bit2Byte(bits []bool) byte
- func Bit2Int(bits []bool) int
- func Bits2Bytes(dataCode []bool, version int) ([]byte, error)
- func Bool2Byte(dataCode []bool) []byte
- func Byte2Bool(bl []byte) []bool
- func Copy(src interface{}) interface{}
- func ExportGroups(size image.Rectangle, hollow []*PosGroup, filename string) error
- func GetData(unmaskMatrix, dataArea *Matrix) []bool
- func GetDataEncoder(version int) (*dataEncoder, error)
- func Hollow(group *PosGroup) bool
- func IsPositionDetectionPattern(solidGroup, hollowGroup *PosGroup) bool
- func IsVertical(kf, kl *K) (offset float64)
- 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, error)
- func QRReconstruct(data, ecc []byte) ([]byte, error)
- 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 FormatInfo
- type K
- type Matrix
- func (mx *Matrix) AtOrgPoints(x, y int) bool
- func (mx *Matrix) AtPoints(x, y int) bool
- func (mx *Matrix) Binarization() uint8
- func (mx *Matrix) CenterList(line []bool, offset int) (li []int)
- func (mx *Matrix) DataArea() *Matrix
- func (mx *Matrix) FormatInfo() (*FormatInfo, error)
- func (mx *Matrix) GetBin(poss []Pos) int
- func (mx *Matrix) ReadImage(batchPath string)
- func (mx *Matrix) SplitGroups() [][]Pos
- func (mx *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 */ )
Functions ¶
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 ExportGroups ¶
func GetDataEncoder ¶
func IsVertical ¶
func QRReconstruct ¶
func SplitGroup ¶
func StringBool ¶
func StringByte ¶
Types ¶
type FormatInfo ¶
type FormatInfo struct {
ErrorCorrectionLevel, Mask int
}
type Matrix ¶
type Matrix struct { OrgImage image.Image OrgSize image.Rectangle OrgPoints [][]bool Points [][]bool Size image.Rectangle Data []bool Content string }
func (*Matrix) AtOrgPoints ¶
func (*Matrix) Binarization ¶
func (*Matrix) FormatInfo ¶
func (mx *Matrix) FormatInfo() (*FormatInfo, error)
func (*Matrix) SplitGroups ¶
type PositionDetectionPatterns ¶
func NewPositionDetectionPattern ¶
func NewPositionDetectionPattern(PDPs [][]*PosGroup) (*PositionDetectionPatterns, error)
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.