scan

package
v0.0.0-...-49f0b03 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatmullRom

func CatmullRom(a, b, c, d uint8, x float64) uint8

func FindTransform

func FindTransform(sources, dests []FPoint) []float64

func ImageBiCatrom

func ImageBiCatrom(im image.Image, x, y float64) color.RGBA

func YBiCatrom

func YBiCatrom(im *image.YCbCr, x, y float64) uint8

Types

type AffineTransform

type AffineTransform interface {
	TransformInt(x, y int) (int, int)
	Transform(x, y float64) (float64, float64)
}

type BubblesJson

type BubblesJson struct {
	DrawSettings *DrawSettings `json:"draw_settings"`

	// Bubbles is a list per ballot style, indexed in the same order as the source document ballot styles.
	Bubbles []Contest `json:"bubbles"`
}

type Contest

type Contest map[string]ContestSelections

type ContestSelections

type ContestSelections map[string][]float64

{"csel1": [44.2, 491.4000000000001, 22.67716535433071, 8.255859375], "csel2": [44.2, 458.2000000000001, 22.67716535433071, 8.255859375]} []float64 is length 4, [x,y, width,height]

type DrawSettings

type DrawSettings struct {
	PageSize   []float64 `json:"pagesize"`
	PageMargin float64   `json:"pageMargin"`
}

type FPoint

type FPoint struct {
	X float64
	Y float64
}

func FPointFromInt

func FPointFromInt(x, y int) FPoint

func (*FPoint) SetInt

func (fp *FPoint) SetInt(x, y int)

type MatrixTransform

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

func (MatrixTransform) Transform

func (mt MatrixTransform) Transform(x, y float64) (float64, float64)

func (MatrixTransform) TransformInt

func (mt MatrixTransform) TransformInt(x, y int) (int, int)

type Scanner

type Scanner struct {
	Bj BubblesJson

	DebugOut io.Writer

	TargetsPngPath string
	DebugPngPath   string
	BubblesPngPath string
	// contains filtered or unexported fields
}

func (*Scanner) DebugOrigBubbles

func (s *Scanner) DebugOrigBubbles(outpath string) error

func (*Scanner) ProcessScannedImage

func (s *Scanner) ProcessScannedImage(im image.Image) (marked map[string]map[string]bool, err error)

func (*Scanner) ReadBubblesJson

func (s *Scanner) ReadBubblesJson(path string) error

func (*Scanner) ReadOrigImage

func (s *Scanner) ReadOrigImage(origname string) error

func (*Scanner) ReadScannedImage

func (s *Scanner) ReadScannedImage(fname string) (marked map[string]map[string]bool, err error)

func (*Scanner) SetOrigImage

func (s *Scanner) SetOrigImage(orig image.Image) error

Jump to

Keyboard shortcuts

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