udwImageResize

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustMaxWidthHeightResizeToPng

func MustMaxWidthHeightResizeToPng(req MustMaxWidthHeightRequest) (b []byte)

func MustReEncodeToPng

func MustReEncodeToPng(InContent []byte) (b []byte)

func MustResizeGoImageToGoImage

func MustResizeGoImageToGoImage(req MustResizeGoImageToGoImageRequest) image.Image

func MustResizeGoImageToPngFile

func MustResizeGoImageToPngFile(req MustResizeGoImageToPngFileRequest)

func MustResizeImageToCenter

func MustResizeImageToCenter(req ResizeImageToCenterReq) image.Image

func MustResizeImageToCenterToPng

func MustResizeImageToCenterToPng(req MustResizeImageToCenterToPngReq) (b []byte)

func MustResizePngContentToSquare

func MustResizePngContentToSquare(pngContent []byte, width int) (outPngContent []byte)

func MustResizePngFileSelfToRate

func MustResizePngFileSelfToRate(filepath string, rate float64)

func MustResizePngFileToHeightAndWidth

func MustResizePngFileToHeightAndWidth(req MustResizePngFileToHeightAndWidthRequest)

func Resize

func Resize(width, height uint, img image.Image, interp InterpolationFunction) image.Image

func Thumbnail

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

Types

type InterpolationFunction

type InterpolationFunction int
const (
	NearestNeighbor InterpolationFunction = iota

	Bilinear

	Bicubic

	MitchellNetravali

	Lanczos2

	Lanczos3
)

func (InterpolationFunction) String

func (i InterpolationFunction) String() string

type MustMaxWidthHeightRequest

type MustMaxWidthHeightRequest struct {
	InContent []byte

	MaxWidth            int
	MaxHeight           int
	PngCompressionLevel png.CompressionLevel
}

type MustResizeGoImageToGoImageRequest

type MustResizeGoImageToGoImageRequest struct {
	Height  int
	Width   int
	InImage image.Image
}

type MustResizeGoImageToPngFileRequest

type MustResizeGoImageToPngFileRequest struct {
	Height      int
	Width       int
	Image       image.Image
	OutFilePath string
}

type MustResizeImageToCenterToPngReq

type MustResizeImageToCenterToPngReq struct {
	InContent           []byte
	Width               int
	Height              int
	DisableLarger       bool
	PngCompressionLevel png.CompressionLevel
}

type MustResizePngFileToHeightAndWidthRequest

type MustResizePngFileToHeightAndWidthRequest struct {
	InFilePath  string
	OutFilePath string
	Height      int
	Width       int
}

type ResizeImageToCenterReq

type ResizeImageToCenterReq struct {
	InImg         image.Image
	Width         int
	Height        int
	DisableLarger bool
}

Jump to

Keyboard shortcuts

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