Documentation
¶
Overview ¶
Package codescan reads QR codes and barcodes from a camera's frames in Go, for the platforms whose system reads none (Android, Windows and Linux): a frame's luminance, its Y plane or converted from BGRA, goes in and the first code of the kinds a driver.ScanRequest asks for comes out. It reads every kind but PDF417, which gozxing has no reader for.
Index ¶
- func Decode(lum []byte, width, height int, r driver.ScanRequest) *driver.ScannedCode
- func DecodeBGRA(bgra []byte, width, height, stride int, r driver.ScanRequest) *driver.ScannedCode
- func HasReader(r driver.ScanRequest) bool
- func LuminanceBGRA(bgra []byte, width, height, stride, maxSide int) (lum []byte, outW, outH int)
- func Reads(k driver.CodeKind) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(lum []byte, width, height int, r driver.ScanRequest) *driver.ScannedCode
Decode returns the first code of the kinds r asks for in a frame of width by height pixels whose luminance is lum, a byte a pixel, row by row; nil when it finds none.
func DecodeBGRA ¶
func DecodeBGRA(bgra []byte, width, height, stride int, r driver.ScanRequest) *driver.ScannedCode
DecodeBGRA converts a BGRA camera frame to luminance (capped at 960 px on its longer side) and decodes the first matching code for r.
func HasReader ¶
func HasReader(r driver.ScanRequest) bool
HasReader reports whether codescan reads at least one kind r asks for.
func LuminanceBGRA ¶
LuminanceBGRA converts a BGRA pixel buffer (B, G, R, A byte order) of width by height pixels and row byte stride into a luminance plane, downscaling so the longer side is at most maxSide when maxSide > 0.
Types ¶
This section is empty.