senbay

package
v0.0.0-...-4226ece Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package senbay provides the functions to encode and decode to the senbay format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowResult

func ShowResult(senbayDict map[string]interface{})

Types

type BaseX

type BaseX struct {
	PN           int
	Table        []int
	ReverseTable []int
}

BaseX descrive base number based on PN

func NewBaseX

func NewBaseX(positionalNotation int) (*BaseX, error)

NewBaseX returns a new BaseX based on PN

type Data

type Data struct {
	PN int
	SF *Format
	// contains filtered or unexported fields
}

A Data is

func NewSenbayData

func NewSenbayData(PN int) (*Data, error)

NewSenbayData returns a new SenbayData struct based on PN

func (Data) AddFloat

func (SD Data) AddFloat(key string, value float32)

AddFloat add float value to senbayData

func (Data) AddFloat64

func (SD Data) AddFloat64(key string, value float64)

AddFloat64 add float64 value to senbayData

func (Data) AddInt

func (SD Data) AddInt(key string, value int)

AddInt add int value to senbayData

func (Data) AddInt64

func (SD Data) AddInt64(key string, value int64)

AddInt64 add int64 value to senbayData

func (Data) AddText

func (SD Data) AddText(key string, value string)

AddText add string value to senbayData

func (Data) Clear

func (SD Data) Clear()

Clear empties the contents of Data

func (Data) Decode

func (SD Data) Decode(text string) map[string]string

Decode converts the decoded text to the original data.

func (Data) Encode

func (SD Data) Encode(compress bool) string

Encode converts the data to decoded.

type Format

type Format struct {
	ReversedKeys map[string]string
	PN           int
	// contains filtered or unexported fields
}

Format is

func NewSenbayFormat

func NewSenbayFormat(PN int) (*Format, error)

NewSenbayFormat returns a new Format based on PN

type Handler

type Handler interface {
	Handle(senbayDict map[string]interface{})
}

func NewHandler

func NewHandler(fn HandlerFunc) Handler

type HandlerFunc

type HandlerFunc func(senbayDict map[string]interface{})

type InputMode

type InputMode int

type Reader

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

Reader describe an reader to interpret senbay style contents

func NewSenbayReader

func NewSenbayReader(videoInput string, nographic bool) *Reader

func NewSenbayVideoReader

func NewSenbayVideoReader(videoInput string, nographic bool) *Reader

NewSenbayVideoReader returns a new SenbayReader for a video

func (Reader) Start

func (reader Reader) Start(fn HandlerFunc)

Start interpreting captured image recorded in senbay style

type SenbayFrame

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

func NewSenbayFrame

func NewSenbayFrame(qrBoxSize uint, qrErrorCorrection int) *SenbayFrame

type Writer

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

func NewSenbayWriter

func NewSenbayWriter(outfile string, width uint, height uint, qrBoxSize uint,
	cameraNumber uint, codec string, fps uint) *Writer

func (Writer) Start

func (writer Writer) Start()

Jump to

Keyboard shortcuts

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