snip

package module
v0.0.0-...-8a046b9 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2019 License: MIT Imports: 10 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crop

func Crop(img image.Image, field Field, c *chan ExtractedIMG)

Crop is responsible for cutting the selected region of an image.

func Decode

func Decode(image io.Reader, contentType string) (imageRef image.Image, err error)

Decode responsible for decoding and instantiating image based on a content-type.

func Rotate

func Rotate(img image.Image, angle float64) image.Image

Rotate Method responsible for free image rotation

func Threshold

func Threshold(img image.Image, limiar uint8) image.Image

Threshold is responsible for define a new image using color based on limiar passing on the function call

Types

type ExtractedIMG

type ExtractedIMG struct {
	Image image.Image
	Field Field
}

type Field

type Field struct {
	Key    string    `json:"key"`
	Mask   FieldMask `json:"mask"`
	Regexp []string  `json:"regexp"`
}

type FieldMask

type FieldMask struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

FieldMask is the struct to define a mask used on crop method

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

func Extract

func Extract(img image.Image, fields []Field) []KeyValue

Jump to

Keyboard shortcuts

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