index

package
v0.0.0-...-c082557 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	// Write the given image data into the index
	Index(name string, data *analysis.ImageData) error

	// Finish creating the index
	Close() error
}

Builder is an interface for building an index

func NewBoltIndexBuilder

func NewBoltIndexBuilder(source string) (Builder, error)

NewBoltIndexBuilder Creates a Bolt index builder

type Index

type Index interface {
	// Find the best matching image for the given source image
	Search(img *image.NRGBA, aspectRatio image.Point) (string, error)
}

Index is an interface for wrapping up an image index for finding matching images

func BuildInMemoryIndex

func BuildInMemoryIndex(storage storage.Storage, multiple int, fuzziness int) (Index, error)

BuildInMemoryIndex builds an in memory index of the image samples at the given multiple of the aspect ratio. 0 is special in that it is a 1x1. fuzziness is how many of the top-N best matching tiles to randomly choose from for final selection

func NewBoltIndex

func NewBoltIndex(source string, multiple, fuzziness int) (Index, error)

NewBoltIndex creates a bolt index for searching

Jump to

Keyboard shortcuts

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