Documentation ¶
Index ¶
- func ApplyFilter(img *image.RGBA, f Filter) *image.RGBA
- func Flatten(p []int) []int
- func FromFile(path string) (*image.RGBA, error)
- func Get(img *image.RGBA, f Filter, step int) [][]int
- func GetNext(img *image.RGBA, f Filter, step int) ([]int, *image.RGBA)
- func ToFile(path string, img *image.RGBA) error
- func ToRGBA(img image.Image) *image.RGBA
- type Filter
- func NewBlueFilter(threshold uint8, inverted bool) (Filter, error)
- func NewFilter(f func(color.RGBA) bool, trueValue, falseValue color.RGBA) Filter
- func NewGreenFilter(threshold uint8, inverted bool) (Filter, error)
- func NewGreyFilter(threshold uint8, inverted bool) (Filter, error)
- func NewRedFilter(threshold uint8, inverted bool) (Filter, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFilter ¶
ApplyFilter returns a new image object where every pixel is replaced either with the filters true value or it's false value depending on the original pixels value.
func Flatten ¶
Flatten removes every corner from a given polygon that is exactly on the line of the two adjacent corners.
func FromFile ¶
FromFile is a function for the users convenience. It reads either a jpeg or a png file and returns an image.RGBA object which can then be used with this libarary.
func Get ¶
Get returns all the polygons that are available based on the given filter and the given step size.
Note: A higher step size reduces the count of corners per polygon but increases the chance that the resulting polygons overlap.
func GetNext ¶
GetNext returns the next polygon in this image and another image with the pixels of this polygon removed. The return value is nil iff there are no true pixels for this filter in this image.
Types ¶
type Filter ¶
A Filter is any type that has a Filter function to return wether a certain color is part of a polygon or not
func NewBlueFilter ¶
NewBlueFilter returns a new filter object that accepts any color with a higher grey value than given. If inverted is true it accepts any color with a grey value less than the given one.
func NewGreenFilter ¶
NewGreenFilter returns a new filter object that accepts any color with a higher grey value than given. If inverted is true it accepts any color with a grey value less than the given one.
func NewGreyFilter ¶
NewGreyFilter returns a new filter object that accepts any color with a higher grey value than given. If inverted is true it accepts any color with a grey value less than the given one.