Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Output formats PNG = "png" JPEG = "jpeg" GIF = "gif" )
View Source
const ( // DEFAULT_SCALE is the default scale for the QR Code image. DEFAULT_SCALE = 4 // DEFAULT_BORDER is the default border for the QR Code image. DEFAULT_BORDER = 0 // DEFAULT_OUTPUT_FORMAT is the default output format for the QR Code image. DEFAULT_OUTPUT_FORMAT = PNG )
View Source
const ( // MicroQR versions M1 = -1 M2 = -2 M3 = -3 M4 = -4 )
Variables ¶
View Source
var ErrContentTooLong = fmt.Errorf("content is too long")
Functions ¶
This section is empty.
Types ¶
type ErrorCorrectionLevel ¶
type ErrorCorrectionLevel int
Level of error correction Low - 7% Medium - 15% Quartile - 25% High - 30%
const ( ErrorCorrectionLevelLow ErrorCorrectionLevel = iota ErrorCorrectionLevelMedium ErrorCorrectionLevelQuartile ErrorCorrectionLevelHigh )
type OutputFormat ¶ added in v0.2.1
type OutputFormat string
type PlotOptions ¶ added in v0.2.0
type PlotOptions struct { // Scale is the scale for the QR Code image (in pixels). // The image will be len(data) * Scale x len(data) * Scale pixels. Scale int // Border is the border for the QR Code image (in pixels). Border int // OutputFormat is the format of the output image. OutputFormat OutputFormat }
type QRCode ¶
type QRCode struct { // Content Content string // Data Data [][]Cell // contains filtered or unexported fields }
QRCode is a struct that represents a QR Code.
func Create ¶
func Create(content string, options *QRCodeOptions) (*QRCode, error)
Create creates a QR Code with the given content and options.
func CreateMultiMode ¶
func CreateMultiMode(blocks []*encode.EncodeBlock, options *QRCodeOptionsMultiMode) (*QRCode, error)
CreateMultiMode creates a QR Code with multiple modes.
type QRCodeOptions ¶
type QRCodeOptions struct { // Encoding is the encoding mode. // Default: calculated based on the content (can undestand only numeric, alphanumeric, byte, kanji or utf-8 with ECI) Mode encode.EncodingMode // Level is the error correction level. // Default: ErrorCorrectionLevelLow. ErrorLevel ErrorCorrectionLevel // Version is the version of the QR Code. // Default: calculated based on the content. Version int // Enable micro QR code // Default: false MicroQR bool }
QRCodeOptions is a struct that represents the options for the QR Code.
type QRCodeOptionsMultiMode ¶
type QRCodeOptionsMultiMode struct { // Level is the error correction level. // Default: ErrorCorrectionLevelLow. ErrorLevel ErrorCorrectionLevel // Version is the version of the QR Code. // Default: calculated based on the content. Version int // Enable micro QR code // Default: false MicroQR bool }
QRCodeOptionsMultiMode is a struct that represents the options for building multi-mode QR Codes.
Click to show internal directories.
Click to hide internal directories.