utils

package
v0.0.0-...-a86b3a3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KERNEL    = 3
	Threshold = 16
)

Variables

This section is empty.

Functions

func DownloadImage

func DownloadImage(url string) (path string, err error)

DownloadImage ...

func DownloadOrLoadImage

func DownloadOrLoadImage(image1path string) (rgba *image.RGBA64, err error)

DownloadOrLoadImage ...

func NewImage

func NewImage(file string) (rgba *image.RGBA64, err error)

NewImage ...

func RunDiffBatch

func RunDiffBatch(batchpath string, output string) (exitcode int, err error)

RunDiffBatch ...

Types

type DiffBatch

type DiffBatch struct {
	Diffs []DiffImage `json:"diffs"`
}

DiffBatch ...

type DiffImage

type DiffImage struct {
	Image     string   `json:"img"`
	Baselines []string `json:"baselines"`
	TC        string   `json:"tc"`
	UUID      string   `json:"uuid"`
}

DiffImage ...

type DiffResult

type DiffResult struct {
	TC    string    `json:"tc"`
	UUID  string    `json:"uuid"`
	Stats DiffStats `json:"stats"`
	Err   string    `json:"err"`
}

DiffResult ...

func (*DiffResult) SetError

func (b *DiffResult) SetError(err error, img string)

SetError ...

type DiffResults

type DiffResults struct {
	Results []DiffResult `json:"results"`
	Elapsed string       `json:"elapsed"`
}

DiffResults ...

type DiffStats

type DiffStats struct {
	NumPixels  int64 `json:"numpixels"`
	DiffPixels int64 `json:"diffpixels"`
	ExactSame  bool  `json:"exactsame"`
}

DiffStats ...

func Compare16

func Compare16(pic1 *image.RGBA64, pic2 *image.RGBA64) (stats DiffStats, err error)

Compare16 ...

func (*DiffStats) Report

func (p *DiffStats) Report()

Report ...

Jump to

Keyboard shortcuts

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