Documentation ¶
Index ¶
- Constants
- Variables
- func NewCodaBarReader() gozxing.Reader
- func NewCodaBarWriter() gozxing.Writer
- func NewCode128Reader() gozxing.Reader
- func NewCode128Writer() gozxing.Writer
- func NewCode39Reader() gozxing.Reader
- func NewCode39ReaderWithCheckDigitFlag(usingCheckDigit bool) gozxing.Reader
- func NewCode39ReaderWithFlags(usingCheckDigit, extendedMode bool) gozxing.Reader
- func NewCode39Writer() gozxing.Writer
- func NewCode93Reader() gozxing.Reader
- func NewCode93Writer() gozxing.Writer
- func NewEAN13Reader() gozxing.Reader
- func NewEAN13Writer() gozxing.Writer
- func NewEAN8Reader() gozxing.Reader
- func NewEAN8Writer() gozxing.Writer
- func NewITFReader() gozxing.Reader
- func NewITFWriter() gozxing.Writer
- func NewMultiFormatUPCEANReader(hints map[gozxing.DecodeHintType]interface{}) gozxing.Reader
- func NewUPCAReader() gozxing.Reader
- func NewUPCAWriter() gozxing.Writer
- func NewUPCEReader() gozxing.Reader
- func NewUPCEWriter() gozxing.Writer
- func PatternMatchVariance(counters, pattern []int, maxIndividualVariance float64) float64
- func RecordPattern(row *gozxing.BitArray, start int, counters []int) error
- func RecordPatternInReverse(row *gozxing.BitArray, start int, counters []int) error
- type OneDReader
- type OneDimensionalCodeWriter
- type RowDecoder
- type UPCEANExtension2Support
- type UPCEANExtension5Support
- type UPCEANExtensionSupport
Constants ¶
const ( // These two values are critical for determining how permissive the decoding will be. // We've arrived at these values through a lot of trial and error. Setting them any higher // lets false positives creep in quickly. UPCEANReader_MAX_AVG_VARIANCE = 0.48 UPCEANReader_MAX_INDIVIDUAL_VARIANCE = 0.7 )
Variables ¶
var ( // Start/end guard pattern. UPCEANReader_START_END_PATTERN = []int{1, 1, 1} // Pattern marking the middle of a UPC/EAN pattern, separating the two halves. UPCEANReader_MIDDLE_PATTERN = []int{1, 1, 1, 1, 1} // end guard pattern. UPCEANReader_END_PATTERN = []int{1, 1, 1, 1, 1, 1} // "Odd", or "L" patterns used to encode UPC/EAN digits. UPCEANReader_L_PATTERNS = [][]int{ {3, 2, 1, 1}, {2, 2, 2, 1}, {2, 1, 2, 2}, {1, 4, 1, 1}, {1, 1, 3, 2}, {1, 2, 3, 1}, {1, 1, 1, 4}, {1, 3, 1, 2}, {1, 2, 1, 3}, {3, 1, 1, 2}, } // As above but also including the "even", or "G" patterns used to encode UPC/EAN digits. UPCEANReader_L_AND_G_PATTERNS [][]int )
Functions ¶
func NewCodaBarReader ¶
func NewCodaBarWriter ¶
func NewCode128Reader ¶
func NewCode128Writer ¶
func NewCode39Reader ¶
NewCode39Reader Creates a reader that assumes all encoded data is data, and does not treat the final character as a check digit. It will not decoded "extended Code 39" sequences.
func NewCode39ReaderWithCheckDigitFlag ¶
NewCode39ReaderWithCheckDigitFlag Creates a reader that can be configured to check the last character as a check digit. It will not decoded "extended Code 39" sequences.
@param usingCheckDigit if true, treat the last data character as a check digit, not data, and verify that the checksum passes.
func NewCode39ReaderWithFlags ¶
NewCode39ReaderWithFlags Creates a reader that can be configured to check the last character as a check digit, or optionally attempt to decode "extended Code 39" sequences that are used to encode the full ASCII character set.
@param usingCheckDigit if true, treat the last data character as a check digit, not data, and verify that the checksum passes. @param extendedMode if true, will attempt to decode extended Code 39 sequences in the text.
func NewCode39Writer ¶
func NewCode93Reader ¶
func NewCode93Writer ¶
func NewEAN13Reader ¶
func NewEAN13Writer ¶
func NewEAN8Reader ¶
func NewEAN8Writer ¶
func NewITFReader ¶
func NewITFWriter ¶
func NewMultiFormatUPCEANReader ¶
func NewMultiFormatUPCEANReader(hints map[gozxing.DecodeHintType]interface{}) gozxing.Reader
func NewUPCAReader ¶
func NewUPCAWriter ¶
func NewUPCEReader ¶
func NewUPCEWriter ¶
func PatternMatchVariance ¶
PatternMatchVariance Determines how closely a set of observed counts of runs of black/white values matches a given target pattern. This is reported as the ratio of the total variance from the expected pattern proportions across all pattern elements, to the length of the pattern.
@param counters observed counters @param pattern expected pattern @param maxIndividualVariance The most any counter can differ before we give up @return ratio of total variance between counters and pattern compared to total pattern size
func RecordPattern ¶
RecordPattern Records the size of successive runs of white and black pixels in a row, starting at a given point. The values are recorded in the given array, and the number of runs recorded is equal to the size of the array. If the row starts on a white pixel at the given start point, then the first count recorded is the run of white pixels starting from that point; likewise it is the count of a run of black pixels if the row begin on a black pixels at that point.
@param row row to count from @param start offset into row to start at @param counters array into which to record counts @throws NotFoundException if counters cannot be filled entirely from row before running out
of pixels
Types ¶
type OneDReader ¶
type OneDReader struct {
RowDecoder
}
OneDReader Encapsulates functionality and implementation that is common to all families of one-dimensional barcodes.
func NewOneDReader ¶
func NewOneDReader(rowDecoder RowDecoder) *OneDReader
func (*OneDReader) Decode ¶
func (this *OneDReader) Decode( image *gozxing.BinaryBitmap, hints map[gozxing.DecodeHintType]interface{}) (*gozxing.Result, error)
Decode Note that we don't try rotation without the try harder flag, even if rotation was supported.
func (*OneDReader) DecodeWithoutHints ¶
func (this *OneDReader) DecodeWithoutHints(image *gozxing.BinaryBitmap) (*gozxing.Result, error)
func (*OneDReader) Reset ¶
func (this *OneDReader) Reset()
type OneDimensionalCodeWriter ¶
type OneDimensionalCodeWriter struct {
// contains filtered or unexported fields
}
func NewOneDimensionalCodeWriter ¶
func NewOneDimensionalCodeWriter(enc encoder) *OneDimensionalCodeWriter
func NewUPCEANWriter ¶
func NewUPCEANWriter(enc encoder) *OneDimensionalCodeWriter
func (*OneDimensionalCodeWriter) Encode ¶
func (this *OneDimensionalCodeWriter) Encode( contents string, format gozxing.BarcodeFormat, width, height int, hints map[gozxing.EncodeHintType]interface{}) (*gozxing.BitMatrix, error)
Encode the contents following specified format. {@code width} and {@code height} are required size. This method may return bigger size {@code BitMatrix} when specified size is too small. The user can set both {@code width} and {@code height} to zero to get minimum size barcode. If negative value is set to {@code width} or {@code height}, {@code IllegalArgumentException} is thrown.
func (*OneDimensionalCodeWriter) EncodeWithoutHint ¶
func (this *OneDimensionalCodeWriter) EncodeWithoutHint( contents string, format gozxing.BarcodeFormat, width, height int) (*gozxing.BitMatrix, error)
type RowDecoder ¶
type RowDecoder interface { // decodeRow Attempts to decode a one-dimensional barcode format given a single row of an image // @param rowNumber row number from top of the row // @param row the black/white pixel data of the row // @param hints decode hints // @return {@link Result} containing encoded string and start/end of barcode // @throws NotFoundException if no potential barcode is found // @throws ChecksumException if a potential barcode is found but does not pass its checksum // @throws FormatException if a potential barcode is found but format is invalid DecodeRow(rowNumber int, row *gozxing.BitArray, hints map[gozxing.DecodeHintType]interface{}) (*gozxing.Result, error) }
type UPCEANExtension2Support ¶
type UPCEANExtension2Support struct {
// contains filtered or unexported fields
}
func NewUPCEANExtension2Support ¶
func NewUPCEANExtension2Support() *UPCEANExtension2Support
type UPCEANExtension5Support ¶
type UPCEANExtension5Support struct {
// contains filtered or unexported fields
}
func NewUPCEANExtension5Support ¶
func NewUPCEANExtension5Support() *UPCEANExtension5Support
type UPCEANExtensionSupport ¶
type UPCEANExtensionSupport struct {
// contains filtered or unexported fields
}
func NewUPCEANExtensionSupport ¶
func NewUPCEANExtensionSupport() *UPCEANExtensionSupport
Source Files ¶
- codabar_reader.go
- codabar_writer.go
- code128_reader.go
- code128_writer.go
- code39_reader.go
- code39_writer.go
- code93_reader.go
- code93_writer.go
- ean13_reader.go
- ean13_writer.go
- ean8_reader.go
- ean8_writer.go
- ean_manufacturer_org_support.go
- itf_reader.go
- itf_writer.go
- multi_format_upcean_reader.go
- one_dimensional_code_writer.go
- oned_reader.go
- upca_reader.go
- upca_writer.go
- upce_reader.go
- upce_writer.go
- upcean_extension2_support.go
- upcean_extension5_support.go
- upcean_extension_support.go
- upcean_reader.go
- upcean_writer.go