imagetk

package module
v0.0.0-...-f2d6fa6 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 18 Imported by: 1

README

imagetk

Toolkit for image processing in Golang

Documentation

Index

Constants

View Source
const (
	TOP_LEFT = iota
	TOP
	TOP_RIGHT
	LEFT
	CENTER
	RIGHT
	BOTTOM_LEFT
	BOTTOM
	BOTTOM_RIGHT
)

Variables

View Source
var ITKX = &ImageTK{Version: versionG}

Functions

This section is empty.

Types

type ImageTK

type ImageTK struct {
	Version string
}

func NewImageTK

func NewImageTK() *ImageTK

func (*ImageTK) EncodePNG

func (p *ImageTK) EncodePNG(imgA image.Image)

func (*ImageTK) EnlargeImage

func (p *ImageTK) EnlargeImage(src image.Image, scaleA float64) (image.Image, error)

func (*ImageTK) GetImageFileContent

func (p *ImageTK) GetImageFileContent(fileNameA string, imageTypeA string) image.Image

func (*ImageTK) GetImageFileContentAndThumb

func (p *ImageTK) GetImageFileContentAndThumb(fileNameA string, maxWidthA uint, maxHeightA uint, imageTypeA string) image.Image

func (*ImageTK) GetVersion

func (p *ImageTK) GetVersion() string

func (*ImageTK) HQ2x

func (p *ImageTK) HQ2x(src *image.RGBA) (*image.RGBA, error)

HQ2x - Enlarge image by 2x with hq2x algorithm

func (*ImageTK) LoadImage

func (p *ImageTK) LoadImage(fileNameA string) (image.Image, error)

func (*ImageTK) LoadPlotImage

func (p *ImageTK) LoadPlotImage(plt *plot.Plot, w vg.Length, h vg.Length) (*image.RGBA, error)

func (*ImageTK) LoadPlotImageInMemory

func (p *ImageTK) LoadPlotImageInMemory(plotA *plot.Plot, w vg.Length, h vg.Length, formatA string) (*bytes.Buffer, error)

LoadPlotImageInMemory formatA support png, jpg...

func (*ImageTK) LoadRGBAFromImage

func (p *ImageTK) LoadRGBAFromImage(imageA image.Image) (*image.RGBA, error)

func (*ImageTK) NewNRGBAFromHex

func (p *ImageTK) NewNRGBAFromHex(strA string) color.NRGBA

func (*ImageTK) NewNRGBAPFromHex

func (p *ImageTK) NewNRGBAPFromHex(strA string) *color.NRGBA

func (*ImageTK) NewPlotXY

func (p *ImageTK) NewPlotXY(xA, yA float64) plotter.XY

func (*ImageTK) NewRGBA

func (p *ImageTK) NewRGBA(r, g, b, a uint8) color.RGBA

func (*ImageTK) NewRGBAFromHex

func (p *ImageTK) NewRGBAFromHex(strA string) color.RGBA

func (*ImageTK) NewRGBAP

func (p *ImageTK) NewRGBAP(r, g, b, a uint8) *color.RGBA

func (*ImageTK) NewRGBAPFromHex

func (p *ImageTK) NewRGBAPFromHex(strA string) *color.RGBA

func (*ImageTK) ParseHexColor

func (p *ImageTK) ParseHexColor(x string) (r, g, b, a int)

ParseHexColor inspired by gg

func (*ImageTK) ResizeImage

func (p *ImageTK) ResizeImage(widthA, heightA int, img image.Image, interpA ...InterpolationFunction) image.Image

func (*ImageTK) SaveImageAs

func (p *ImageTK) SaveImageAs(imageA image.Image, filePathA string, formatA ...string) error

func (*ImageTK) Thumbnail

func (p *ImageTK) Thumbnail(maxWidth, maxHeight uint, img image.Image, interp InterpolationFunction) image.Image

type InterpolationFunction

type InterpolationFunction int
const (
	// Nearest-neighbor interpolation
	NearestNeighbor InterpolationFunction = iota
	// Bilinear interpolation
	Bilinear
	// Bicubic interpolation (with cubic hermite spline)
	Bicubic
	// Mitchell-Netravali interpolation
	MitchellNetravali
	// Lanczos interpolation (a=2)
	Lanczos2
	// Lanczos interpolation (a=3)
	Lanczos3
)

InterpolationFunction constants

Jump to

Keyboard shortcuts

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