Versions in this module Expand all Collapse all v0 v0.1.0 Feb 18, 2026 Changes in this version + var ErrChecksum = errors.New("checksum error") + var ErrFormat = errors.New("format error") + var ErrNotFound = errors.New("barcode not found") + var ErrWriter = errors.New("writer error") + func BitMatrixToImage(matrix interface{ ... }) *image.Gray + func CrossProductZ(a, b, c ResultPoint) float64 + func Distance(a, b ResultPoint) float64 + func Encode(contents string, format Format, width, height int, opts *EncodeOptions) (*bitutil.BitMatrix, error) + func RegisterReader(format Format, factory readerFactory) + func RegisterWriter(format Format, factory writerFactory) + type Binarizer interface + BlackMatrix func() (*bitutil.BitMatrix, error) + BlackRow func(y int, row *bitutil.BitArray) (*bitutil.BitArray, error) + Height func() int + LuminanceSource func() LuminanceSource + Width func() int + func NewBinarizerFromSource(template Binarizer, source LuminanceSource) Binarizer + type BinarizerFactory interface + CreateBinarizer func(source LuminanceSource) Binarizer + type BinaryBitmap struct + func NewBinaryBitmap(binarizer Binarizer) *BinaryBitmap + func (b *BinaryBitmap) BlackMatrix() (*bitutil.BitMatrix, error) + func (b *BinaryBitmap) BlackRow(y int, row *bitutil.BitArray) (*bitutil.BitArray, error) + func (b *BinaryBitmap) Crop(left, top, width, height int) *BinaryBitmap + func (b *BinaryBitmap) Height() int + func (b *BinaryBitmap) RotateCounterClockwise() *BinaryBitmap + func (b *BinaryBitmap) Width() int + type DecodeOptions struct + AllowedEANExtensions []int + AllowedLengths []int + AlsoInverted bool + AssumeCode39CheckDigit bool + AssumeGS1 bool + CharacterSet string + PossibleFormats []Format + PureBarcode bool + TryHarder bool + type EncodeOptions struct + CharacterSet string + Code128Compact bool + ErrorCorrection string + ForceCodeSet string + GS1Format bool + Margin *int + PDF417AutoECI bool + PDF417Compact bool + PDF417Compaction int + PDF417Dimensions *PDF417DimensionConfig + QRCompact bool + QRMaskPattern int + QRVersion int + type Format int + const FormatAztec + const FormatCodabar + const FormatCode128 + const FormatCode39 + const FormatCode93 + const FormatDataMatrix + const FormatEAN13 + const FormatEAN8 + const FormatITF + const FormatMaxiCode + const FormatPDF417 + const FormatQRCode + const FormatRSS14 + const FormatRSSExpanded + const FormatUPCA + const FormatUPCE + func (f Format) String() string + type ImageLuminanceSource struct + func NewGrayImageLuminanceSource(img *image.Gray) *ImageLuminanceSource + func NewImageLuminanceSource(img image.Image) *ImageLuminanceSource + func (s *ImageLuminanceSource) Crop(left, top, cropWidth, cropHeight int) *ImageLuminanceSource + func (s *ImageLuminanceSource) Height() int + func (s *ImageLuminanceSource) Matrix() []byte + func (s *ImageLuminanceSource) RotateCounterClockwise() *ImageLuminanceSource + func (s *ImageLuminanceSource) Row(y int, row []byte) []byte + func (s *ImageLuminanceSource) Width() int + type LuminanceSource interface + Height func() int + Matrix func() []byte + Row func(y int, row []byte) []byte + Width func() int + type MultiFormatReader struct + func NewMultiFormatReader() *MultiFormatReader + func (r *MultiFormatReader) Decode(image *BinaryBitmap, opts *DecodeOptions) (*Result, error) + func (r *MultiFormatReader) DecodeWithFormat(image *BinaryBitmap, format Format, opts *DecodeOptions) (*Result, error) + func (r *MultiFormatReader) Reset() + type MultiFormatWriter struct + func NewMultiFormatWriter() *MultiFormatWriter + func (w *MultiFormatWriter) Encode(contents string, format Format, width, height int, opts *EncodeOptions) (*bitutil.BitMatrix, error) + type MultipleBarcodeReader interface + DecodeMultiple func(image *BinaryBitmap, opts *DecodeOptions) ([]*Result, error) + type PDF417DimensionConfig struct + MaxCols int + MaxRows int + MinCols int + MinRows int + type Reader interface + Decode func(image *BinaryBitmap, opts *DecodeOptions) (*Result, error) + Reset func() + type Result struct + Format Format + Metadata map[ResultMetadataKey]interface{} + NumBits int + Points []ResultPoint + RawBytes []byte + Text string + Timestamp time.Time + func Decode(image *BinaryBitmap, opts *DecodeOptions) (*Result, error) + func NewResult(text string, rawBytes []byte, points []ResultPoint, format Format) *Result + func (r *Result) AddResultPoints(points []ResultPoint) + func (r *Result) PutMetadata(key ResultMetadataKey, value interface{}) + type ResultMetadataKey int + const MetadataByteSegments + const MetadataErasuresCorrected + const MetadataErrorCorrectionLevel + const MetadataErrorsCorrected + const MetadataIssueNumber + const MetadataOrientation + const MetadataOther + const MetadataPDF417ExtraMetadata + const MetadataPossibleCountry + const MetadataStructuredAppendParity + const MetadataStructuredAppendSequence + const MetadataSuggestedPrice + const MetadataSymbologyIdentifier + const MetadataUPCEANExtension + type ResultPoint struct + X float64 + Y float64 + func OrderBestPatterns(patterns [3]ResultPoint) [3]ResultPoint + type Writer interface + Encode func(contents string, format Format, width, height int, opts *EncodeOptions) (*bitutil.BitMatrix, error)