images

package module
v0.0.0-...-46361fd Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2016 License: MIT Imports: 18 Imported by: 0

README

Images

Build Status GoDoc Software License

This not stable version

Installation

$ go get github.com/mantyr/images

Author

Oleg Shevelev

Documentation

Index

Constants

View Source
const (
	FormatTIFF string = "tiff"
	FormatJPEG string = "jpeg"
	FormatGIF  string = "gif"
	FormatPNG  string = "png"
	FormatBMP  string = "bmp"
)

Variables

View Source
var Formats = [5]string{"tiff", "jpeg", "gif", "png", "bmp"}

Functions

func Clone

func Clone(img image.Image) *image.NRGBA

func Resize

func Resize(i image.Image, width, height int, filter ResampleFilter) *image.NRGBA

Types

type Image

type Image struct {
	Image   *image.NRGBA
	Address string
	Format  string
	Quality int

	Error error
	// contains filtered or unexported fields
}

func Open

func Open(address string) (i *Image, err error)

func OpenFile

func OpenFile(file *os.File) (i *Image, err error)

func (*Image) GetHash

func (i *Image) GetHash() string

func (*Image) Height

func (i *Image) Height() int

func (*Image) Height64

func (i *Image) Height64() float64

func (*Image) Negative

func (i *Image) Negative() (image *Image)

Превращает изображение в негатив или наоборот

func (*Image) Resize

func (i *Image) Resize(width, height int, params ...ResampleFilter) (image *Image)

func (*Image) ResizeCrop

func (i *Image) ResizeCrop(width, height int, params ...ResampleFilter) (img *Image)

func (*Image) ResizeIn

func (i *Image) ResizeIn(width, height int, params ...ResampleFilter) *Image

Картинка меньше прямоугольника

func (*Image) ResizeMax

func (i *Image) ResizeMax(width, height int, params ...ResampleFilter) *Image

Картинка меньше прямоугольника, но если изначальный размер ещё меньше то картинка не растягивается

func (*Image) ResizeOut

func (i *Image) ResizeOut(width, height int, params ...ResampleFilter) *Image

Картинка больше прямоугольника

func (*Image) Save

func (i *Image) Save(params ...string) (err error)

func (*Image) SetBmp

func (i *Image) SetBmp() *Image

func (*Image) SetFormat

func (i *Image) SetFormat(format string)

func (*Image) SetGif

func (i *Image) SetGif() *Image

func (*Image) SetJpeg

func (i *Image) SetJpeg() *Image

func (*Image) SetPNGBestCompression

func (i *Image) SetPNGBestCompression() *Image

func (*Image) SetPNGBestSpeed

func (i *Image) SetPNGBestSpeed() *Image

func (*Image) SetPNGNoCompression

func (i *Image) SetPNGNoCompression() *Image

func (*Image) SetPng

func (i *Image) SetPng() *Image

func (*Image) SetQuality

func (i *Image) SetQuality(quality int) *Image

func (*Image) SetTiff

func (i *Image) SetTiff() *Image

func (*Image) Width

func (i *Image) Width() int

func (*Image) Width64

func (i *Image) Width64() float64

type ResampleFilter

type ResampleFilter struct {
	Support float64
	Kernel  func(float64) float64
}
var BSpline ResampleFilter
var Bartlett ResampleFilter
var Blackman ResampleFilter
var Box ResampleFilter
var CatmullRom ResampleFilter
var Cosine ResampleFilter
var Gaussian ResampleFilter
var Hamming ResampleFilter
var Hann ResampleFilter
var Hermite ResampleFilter
var Lanczos ResampleFilter
var Linear ResampleFilter
var MitchellNetravali ResampleFilter
var NearestNeighbor ResampleFilter
var Welch ResampleFilter

Jump to

Keyboard shortcuts

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