img

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArtotBin = func(w bool) func(<-chan [][]bool) <-chan []string {
	return u.GenChanFn(func(in <-chan [][]bool, out chan<- []string) {
		for e := range in {
			out <- bin2art(e, w)
		}
	})
}

turning 2d binary matrix to string array. whether reverse color.

View Source
var BinotImg = func(threshold int) func(<-chan Gray) <-chan [][]bool {
	return u.GenChanFn(func(in <-chan Gray, out chan<- [][]bool) {
		for im := range in {
			out <- img2bin(im, &threshold)
		}
	})
}

turning image to 2d binary matrix. use threshold to adjust the binarization.

View Source
var ResizeAndGray = func(scale float64) func(<-chan Img) <-chan Gray {
	return u.GenChanFn(func(in <-chan Img, out chan<- Gray) {
		for i := range in {
			out <- grayNearestNeighbor(scale, i)
		}
	})
}

resize the image with scale value, using nearestNeighbor. return a stream chan function.

Functions

func LoadAImage

func LoadAImage(f io.Reader) (image.Image, error)

loading an image, only support png and jpeg. if pass a gif, return the first embedded image. if there is any thing wrong, panic.

Types

type Gray added in v1.3.0

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

func (Gray) Id added in v1.3.0

func (g Gray) Id() int

type Img

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

func NewImg added in v1.3.0

func NewImg(id int, value image.Image) Img

type Pale added in v1.0.1

type Pale = *image.Paletted

func LoadAGif

func LoadAGif(f io.Reader) ([]Pale, []int, error)

loading a gif, return arrays of image.

Jump to

Keyboard shortcuts

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