imaging

package
v0.0.0-...-98db5b7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: CC-BY-4.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Giffer

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

Giffer contains a gif and the delay. It is used to append image.Images to a gif. So that it will eventually be able encode it to a writer

func NewGiffer

func NewGiffer(loopcount int, delay int) *Giffer

NewGiffer is an extention to the gif package from google. loopcount = -1 = one run, 0 = infinity, n = n loops delay is in 1/100 seconds

func (*Giffer) Append

func (g *Giffer) Append(img image.Image)

Append appends an image to the Giffer

func (*Giffer) Encode

func (g *Giffer) Encode(w io.Writer) error

Encode encodes the gif to the writer

func (*Giffer) MakeGrayGif

func (g *Giffer) MakeGrayGif(imgs []image.Image)

MakeGrayGif will take an array of images and make a gif out if it

type ImageV2

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

ImageV2 is a wrapper for an img.Image. It is made so that it can be used in the Encoder interface.

func UpgradeImagetoV2

func UpgradeImagetoV2(img image.Image) *ImageV2

UpgradeImagetoV2 upgrades an image.Image to an ImageV2 so it can be use the encoder interface

func (*ImageV2) At

func (i *ImageV2) At(x int, y int) color.Color

At returns the color.Color at x,y

func (*ImageV2) Bounds

func (i *ImageV2) Bounds() image.Rectangle

Bounds returns an image.Rectangle

func (*ImageV2) ColorModel

func (i *ImageV2) ColorModel() color.Model

ColorModel returns the colormodel for image

func (*ImageV2) Encode

func (i *ImageV2) Encode(w io.Writer) error

Encode will encode the imagev2 to a jpeg unless you set it to png with SetPNG

func (*ImageV2) SetPNG

func (i *ImageV2) SetPNG(png bool)

SetPNG will set the PNG flag. if true then if will encode the image to png if false it will encode to jpg. Default is jpg

type Imager

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

Imager takes tensors and to the best its ability turn it into an image.Image

func MakeImager

func MakeImager(handle *cudnn.Handler) (*Imager, error)

MakeImager makes an imager

func (*Imager) ByBatches

func (im *Imager) ByBatches(handle *cudnn.Handler, x *layers.Tensor, h, w uint) ([]image.Image, error)

ByBatches will return the images by batches if h xor w is zero then the ration will be kept. if both are zero then the ratio is not

func (*Imager) TileBatches

func (im *Imager) TileBatches(handle *cudnn.Handler, x *layers.Tensor, h, w, hstride, wstride int32) (image.Image, error)

TileBatches will take the batches and lay place them withing the HWC space like tiles. Channel dim is limited to 1-4. If c=1: [r,r,r,255]; If c=2: [r,g,avg(r,g),255]; c=3: [r,g,b,255]; c=4: [r,g,b,a];

Jump to

Keyboard shortcuts

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