eggbite

package module
v0.0.0-...-a234ba5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: AGPL-3.0 Imports: 17 Imported by: 0

README

eggbite

codecov

An experiment package to help with Android scripting/automation.

notes: APIs are subject to change.

API Reference

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFormat = errors.New("invalid color format")
)

Functions

func CloseOCR

func CloseOCR()

func CropBytes

func CropBytes(imgBytes []byte, x1, y1, x2, y2 int) (image.Image, error)

func CropFile

func CropFile(filename string, x1, y1, x2, y2 int) (image.Image, error)

func CropImage

func CropImage(img image.Image, x1, y1, x2, y2 int) (image.Image, error)

func FindColor

func FindColor(src image.Image, colorToFind color.Color, similarity float64) (x, y int)

func FindColorWithOffset

func FindColorWithOffset(src image.Image, colorToFind color.Color, offset color.Color, similarity float64) (x, y int)

func FindColorWithRegion

func FindColorWithRegion(src image.Image, colorToFind color.Color, region image.Rectangle, similarity float64) (x, y int, e error)

func FindColorWithRegionAndOffset

func FindColorWithRegionAndOffset(src image.Image, colorToFind color.Color, offset color.Color, region image.Rectangle, similarity float64) (x, y int, e error)

func FindImage

func FindImage(src image.Image, toFind image.Image) (x, y int)

func FindTextWithBytes

func FindTextWithBytes(imgBytes []byte) (string, error)

func FindTextWithFile

func FindTextWithFile(fileName string) (string, error)

func GetColorNum

func GetColorNum(img image.Image, colorToFind color.Color, similarity float64) (uint, error)

func GetColorNumWithOffset

func GetColorNumWithOffset(img image.Image, colorToFind color.Color, offset color.Color, similarity float64) (uint, error)

func GetImageSimilarity

func GetImageSimilarity(src image.Image, compareWith image.Image, ht HashType) (float64, error)

func HexToRGB

func HexToRGB(hex string) (c color.RGBA, e error)

func ImageFromBytes

func ImageFromBytes(imgBytes []byte) (image.Image, error)

func ImageFromFile

func ImageFromFile(filename string) (image.Image, error)

func InitOCR

func InitOCR(language OCRLanguage)

func IsColor

func IsColor(color1, color2 color.Color, similarity float64) (isColor bool)

func IsColorWithOffset

func IsColorWithOffset(color1, color2, offset color.Color, similarity float64) bool

func RGBToHex

func RGBToHex(src color.Color) string

func ResizeImageBytes

func ResizeImageBytes(imgBytes []byte, width, height uint) (image.Image, error)

Types

type HashType

type HashType func(img image.Image) (*goimagehash.ImageHash, error)

type OCRLanguage

type OCRLanguage string
const (
	English           OCRLanguage = "eng"
	ChineseSimplified OCRLanguage = "chi_sim"
)

Jump to

Keyboard shortcuts

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