Documentation ¶
Index ¶
- Variables
- type Generator
- func (gen *Generator) Draw(margin int)
- func (gen *Generator) DrawImage(path string, margin, pictureSize uint)
- func (gen *Generator) EncodeBinary(data *[]uint8) Generator
- func (gen *Generator) EncodeText(text string) Generator
- func (gen *Generator) GetModules() [][]bool
- func (gen *Generator) ToSvg(border int) (ret string, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // bitBuffer errors. ErrBitBufValOutOfRange = errors.New("package qr: bitBuffer.appendBits: value out of range") // modeType errors. ErrModeTypeVerNumOutOfRange = errors.New("package qr: modeType.numCharCountBits: version number out of range") )
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Represents an square grid of black and white cells for a QR Code symbol, and provides static functions to create a QR Code from user-supplied textual or binary data. This class covers the QR Code model 2 specification, supporting all versions (sizes) from 1 to 40, all 4 error correction levels, and only 3 character encoding modes.
func (*Generator) EncodeBinary ¶
Returns a QR Code symbol representing the given binary data string at the given error correction level.
This function always encodes using the binary segment mode, not any text mode. The maximum number of bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
func (*Generator) EncodeText ¶
Returns a QR Code symbol representing the specified Unicode text string at the specified error correction level.
As a conservative upper bound, this function is guaranteed to succeed for strings that have 2953 or fewer UTF-8 code units (not Unicode code points) if the low error correction level is used. The smallest possible QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
func (*Generator) GetModules ¶
Returns boolean matrix of modules of generated QR Code.