codescan

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

func LuminanceBGRA(bgra []byte, width, height, stride, maxSide int) (lum []byte, outW, outH int)

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.

func Reads

func Reads(k driver.CodeKind) bool

Reads reports whether codescan reads codes of kind k.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL