barcode/barcode.go

22 lines
455 B
Go
Raw Normal View History

2013-12-11 13:31:11 +00:00
package barcode
import "image"
2013-12-11 14:52:59 +00:00
// Contains some meta information about a barcode
2013-12-11 13:31:11 +00:00
type Metadata struct {
2013-12-11 14:52:59 +00:00
// the name of the barcode kind
CodeKind string
// contains 1 for 1D barcodes or 2 for 2D barcodes
2013-12-11 13:31:11 +00:00
Dimensions byte
}
2013-12-11 14:52:59 +00:00
// a rendered and encoded barcode
2013-12-11 13:31:11 +00:00
type Barcode interface {
image.Image
2013-12-11 14:52:59 +00:00
// returns some meta information about the barcode
2013-12-11 13:31:11 +00:00
Metadata() Metadata
2013-12-11 14:52:59 +00:00
// the data that was encoded in this barcode
2013-12-11 13:31:11 +00:00
Content() string
CheckSum() int
2013-12-11 13:31:11 +00:00
}