gozbar

package module
v0.0.0-...-24c7533 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: MIT Imports: 7 Imported by: 0

README

gozbar

golang zbar sdk

GoDoc Build Status

Reference

Documentation

Index

Constants

View Source
const (
	ZBAR_NONE    = C.ZBAR_NONE
	ZBAR_PARTIAL = C.ZBAR_PARTIAL
	ZBAR_EAN8    = C.ZBAR_EAN8
	ZBAR_UPCE    = C.ZBAR_UPCE
	ZBAR_ISBN10  = C.ZBAR_ISBN10
	ZBAR_UPCA    = C.ZBAR_UPCA
	ZBAR_EAN13   = C.ZBAR_EAN13
	ZBAR_ISBN13  = C.ZBAR_ISBN13
	ZBAR_I25     = C.ZBAR_I25
	ZBAR_CODE39  = C.ZBAR_CODE39
	ZBAR_PDF417  = C.ZBAR_PDF417
	ZBAR_QRCODE  = C.ZBAR_QRCODE
	ZBAR_CODE128 = C.ZBAR_CODE128
	ZBAR_SYMBOL  = C.ZBAR_SYMBOL
	ZBAR_ADDON2  = C.ZBAR_ADDON2
	ZBAR_ADDON5  = C.ZBAR_ADDON5
	ZBAR_ADDON   = C.ZBAR_ADDON
)

see zbar_symbol_type_t

View Source
const (
	ZBAR_CFG_ENABLE     = C.ZBAR_CFG_ENABLE
	ZBAR_CFG_ADD_CHECK  = C.ZBAR_CFG_ADD_CHECK
	ZBAR_CFG_EMIT_CHECK = C.ZBAR_CFG_EMIT_CHECK
	ZBAR_CFG_ASCII      = C.ZBAR_CFG_ASCII
	ZBAR_CFG_NUM        = C.ZBAR_CFG_NUM
	ZBAR_CFG_MIN_LEN    = C.ZBAR_CFG_MIN_LEN
	ZBAR_CFG_MAX_LEN    = C.ZBAR_CFG_MAX_LEN
	ZBAR_CFG_POSITION   = C.ZBAR_CFG_POSITION
	ZBAR_CFG_X_DENSITY  = C.ZBAR_CFG_X_DENSITY
	ZBAR_CFG_Y_DENSITY  = C.ZBAR_CFG_Y_DENSITY
)

see zbar_config_t

Variables

This section is empty.

Functions

func ZbarFourcc

func ZbarFourcc(a, b, c, d byte) uint32

* zbar/conver.c

  • see zbar_fourcc

Types

type Image

type Image struct {
	// contains filtered or unexported fields
}

* zbar.h

  • zbar_image_t

func ImageCreate

func ImageCreate(img image.Image) (obj *Image)

*

  • create gozbar image

func (*Image) Create

func (obj *Image) Create(img image.Image)

* zbar.h

  • see zbar_image_create

func (*Image) Destroy

func (obj *Image) Destroy()

*

  • image destroy

func (*Image) FirstSymbol

func (obj *Image) FirstSymbol() *Symbol

*

  • image decode successfully, get first symbol

func (*Image) Image

func (obj *Image) Image() *C.zbar_image_t

*

  • load zbar_image_t

type ImageScanner

type ImageScanner struct {
	// contains filtered or unexported fields
}

* zbar.h

  • zbar_image_scanner_t

func ImageScannerCreate

func ImageScannerCreate() (obj *ImageScanner)

*

  • create gozbar ImageScanner

func (*ImageScanner) Create

func (obj *ImageScanner) Create()

* zbar.h

  • see zbar_image_scanner_create

func (*ImageScanner) Destroy

func (obj *ImageScanner) Destroy()

*

  • ImageScanner destroy

func (*ImageScanner) ParseConfig

func (obj *ImageScanner) ParseConfig(config string) bool

*copy from zlib.h

  • parse configuration string using zbar_parse_config()
  • and apply to image scanner using zbar_image_scanner_set_config().
  • @returns 0 for success, non-0 for failure
  • @see zbar_parse_config()
  • @see zbar_image_scanner_set_config()
  • @since 0.4

func (*ImageScanner) ScanImage

func (obj *ImageScanner) ScanImage(image *C.zbar_image_t) int

*

  • scan image

func (*ImageScanner) SetConfig

func (obj *ImageScanner) SetConfig(symbology C.zbar_symbol_type_t, config C.zbar_config_t, value int) bool

*copy from zlib.h

  • parse a configuration string of the form "[symbology.]config[=value]".
  • the config must match one of the recognized names.
  • the symbology, if present, must match one of the recognized names.
  • if symbology is unspecified, it will be set to 0.
  • if value is unspecified it will be set to 1.
  • @returns 0 if the config is parsed successfully, 1 otherwise

type Symbol

type Symbol struct {
	// contains filtered or unexported fields
}

* zbar.h

  • zbar_symbol_t

func SymbolCreate

func SymbolCreate(symbol *C.zbar_symbol_t) (ret *Symbol)

*

  • create gozbar Symbol

func (*Symbol) Create

func (obj *Symbol) Create(symbol *C.zbar_symbol_t)

* zbar.h

  • see zbar_symbol_create

func (*Symbol) Each

func (obj *Symbol) Each(handler func(*SymbolInfo))

*

  • foreach by current symbol

func (*Symbol) EachData

func (obj *Symbol) EachData(handler func(string))

*

  • foreach by current symbol only data string

func (*Symbol) GetData

func (obj *Symbol) GetData() string

*

  • see zbar_symbol_get_data

func (*Symbol) GetDataLength

func (obj *Symbol) GetDataLength() int

*

  • see zbar_symbol_get_data_length

func (*Symbol) GetInfo

func (obj *Symbol) GetInfo() *SymbolInfo

*

  • get gozbar SymbolInfo

func (*Symbol) GetLocSize

func (obj *Symbol) GetLocSize() int

*

  • see zbar_symbol_get_loc_size

func (*Symbol) GetLocX

func (obj *Symbol) GetLocX(index int) int

*

  • see zbar_symbol_get_loc_x

func (*Symbol) GetLocY

func (obj *Symbol) GetLocY(index int) int

*

  • see zbar_symbol_get_loc_y

func (*Symbol) GetQuality

func (obj *Symbol) GetQuality() int

*

  • see zbar_symbol_get_quality

func (*Symbol) GetType

func (obj *Symbol) GetType() C.zbar_symbol_type_t

*

  • see zbar_symbol_get_loc_type

func (*Symbol) Next

func (obj *Symbol) Next() *Symbol

* copy from zbar.h

  • iterate the set to which this symbol belongs (there can be only one).
  • @returns the next symbol in the set, or
  • @returns NULL when no more results are available

type SymbolInfo

type SymbolInfo struct {
	Type    int32    `json:"type"`
	Data    string   `json:"data"`
	Length  int32    `json:"length"`
	Quality int32    `json:"quality"`
	LocSize int32    `json:"loc_size"`
	LocXY   []string `json:"loc_x_y"`
}

*

  • symbol info

Jump to

Keyboard shortcuts

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