store

package
v0.0.0-...-af67c94 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExists    = errors.New("already exists")
	ErrNotFound  = errors.New("not found")
	ErrWrongType = errors.New("wrong type")
)

Functions

This section is empty.

Types

type FQDNType

type FQDNType uint16
const (
	ANY               FQDNType = 0xFFFF
	NONE              FQDNType = 0x0000
	INDEX             FQDNType = 0x0001
	TIMESTAMP         FQDNType = 0x0002
	FPS               FQDNType = 0x0003
	DROPPED_FRAMES    FQDNType = 0x0004
	PATH              FQDNType = 0x0005
	IMAGES            FQDNType = 0x0100
	IMAGE             FQDNType = IMAGES + 1
	IMAGE_GRAYSCALE   FQDNType = IMAGES + 2
	IMAGE_TRANSFORMED FQDNType = IMAGES + 3
	SYNC_DATA         FQDNType = IMAGES + 4
	STEREO_LEFT       FQDNType = IMAGES + 5
	STEREO_RIGHT      FQDNType = IMAGES + 6
	DEPTH_IMAGE       FQDNType = IMAGES + 7
	MAP_IMAGE         FQDNType = IMAGES + 8
	ENVIRONMENT       FQDNType = 0x0F00
	USER_KEY_CODE     FQDNType = ENVIRONMENT + 1
	USER_MOUSE_DOWN   FQDNType = ENVIRONMENT + 2
	USER_MOUSE_UP     FQDNType = ENVIRONMENT + 3
	USER_MOUSE_MOVE   FQDNType = ENVIRONMENT + 4
	ENV_OBSERVATION   FQDNType = ENVIRONMENT + 5
	ENV_ACTION        FQDNType = ENVIRONMENT + 6
	ALGORITHMS        FQDNType = 0x0200
	KEY_POINTS        FQDNType = ALGORITHMS + 1
	DESCRIPTORS       FQDNType = ALGORITHMS + 2
	FEATURES          FQDNType = ALGORITHMS + 3
	DNN_MODEL         FQDNType = ALGORITHMS + 4
	DNN_BACKEND       FQDNType = ALGORITHMS + 5
	FEATURES_TYPE     FQDNType = ALGORITHMS + 6
	MATCHER           FQDNType = ALGORITHMS + 7
	DRAWER            FQDNType = 0x1001
)

func (FQDNType) String

func (i FQDNType) String() string

type ImageGetter

type ImageGetter interface {
	Image() image.Image
	Value() interface{}
}

type Store

type Store interface {
	Name() string
	SetName(string)
	Set(fqdn FQDNType, value Value) error
	Get(fqdn FQDNType) (Value, bool)
	Del(fqdn FQDNType) error
	CopyFrom(src Store)
	Clone(fqdn FQDNType) Store
	Close(fqdn FQDNType)
	ForEach(fqdnPattern FQDNType, callback func(fqdn FQDNType, val Value))

	Index() (int64, error)
	Timestamp() (int64, error)
	DropCount() (int64, error)
	FPS() (float32, error)
	Image(fqdn FQDNType) (ImageGetter, error)
	SetIndex(idx int64)
	SetDropCount(int64)
	SetFPS(float32)
	SetTimestamp(ts int64)
	SetImage(fqdn FQDNType, img ImageGetter)

	Byte(fqdn FQDNType) (byte, error)

	Int(fqdn FQDNType) (int, error)
	Int8(fqdn FQDNType) (int8, error)
	Int16(fqdn FQDNType) (int16, error)
	Int32(fqdn FQDNType) (int32, error)
	Int64(fqdn FQDNType) (int64, error)

	UInt(fqdn FQDNType) (uint, error)
	UInt8(fqdn FQDNType) (uint8, error)
	UInt16(fqdn FQDNType) (uint16, error)
	UInt32(fqdn FQDNType) (uint32, error)
	UInt64(fqdn FQDNType) (uint64, error)

	Float32(fqdn FQDNType) (float32, error)
	Float64(fqdn FQDNType) (float64, error)

	Bytes(fqdn FQDNType) ([]byte, error)

	Ints(fqdn FQDNType) ([]int, error)
	Int8s(fqdn FQDNType) ([]int8, error)
	Int16s(fqdn FQDNType) ([]int16, error)
	Int32s(fqdn FQDNType) ([]int32, error)
	Int64s(fqdn FQDNType) ([]int64, error)

	UInts(fqdn FQDNType) ([]uint, error)
	UInt8s(fqdn FQDNType) ([]uint8, error)
	UInt16s(fqdn FQDNType) ([]uint16, error)
	UInt32s(fqdn FQDNType) ([]uint32, error)
	UInt64s(fqdn FQDNType) ([]uint64, error)

	Float32s(fqdn FQDNType) ([]float32, error)
	Float64s(fqdn FQDNType) ([]float64, error)

	String(fqdn FQDNType) (string, error)
	Strings(fqdn FQDNType) ([]string, error)
	StringMap(fqdn FQDNType) (map[string]string, error)

	StoreList(fqdn FQDNType) ([]Store, error)
	StoreMap(fqdn FQDNType) (map[string]Store, error)

	Dump(fqdn FQDNType)
}

func New

func New() Store

func NewWithName

func NewWithName(name string) Store

type Value

type Value interface{}

type ValueCloner

type ValueCloner interface {
	Clone() (Value, error)
}

type ValueCloser

type ValueCloser interface {
	Close()
}

type ValueCloserWithError

type ValueCloserWithError interface {
	Close() error
}

type ValueMarshaller

type ValueMarshaller interface {
	Value
	Size() int
	MarshalToSizedBuffer([]byte) (int, error)
	Unmarshal([]byte) (Value, error)
}

type ValueWriter

type ValueWriter interface {
	Write(wr io.Writer, path string) error
}

Jump to

Keyboard shortcuts

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