Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResizeGray ¶
func ResizeGray(img *image.Gray, fx float64, fy float64, interpolation Interpolation) (*image.Gray, error)
ResizeGray resizes an grayscale (Gray) image. Input parameters: rbga imaga which will be resized; fx, fy scaling factors, their value has to be a positive float, the new size of the image will be computed as originalWidth * fx and originalHeight * fy; interpolation method, currently the following methods are supported: InterNearest, InterLinear, InterCatmullRom, InterLanczos. Example of usage:
res, err := resize.ResizeGray(img, 2.5, 3.5, resize.InterLinear)
func ResizeRGBA ¶
func ResizeRGBA(img *image.RGBA, fx float64, fy float64, interpolation Interpolation) (*image.RGBA, error)
ResizeRGBA resizes an RGBA image. Input parameters: rbga imaga which will be resized; fx, fy scaling factors, their value has to be a positive float, the new size of the image will be computed as originalWidth * fx and originalHeight * fy; interpolation method, currently the following methods are supported: InterNearest, InterLinear, InterCatmullRom, InterLanczos. Example of usage:
res, err := resize.ResizeRGBA(img, 2.5, 3.5, resize.InterLinear)
Types ¶
type CatmullRom ¶
type CatmullRom struct{}
CatmullRom - Struct for Catmull-Rom filter
func NewCatmullRom ¶
func NewCatmullRom() *CatmullRom
NewCatmullRom creates a new Catmull-Rom filter
func (*CatmullRom) GetS ¶
func (r *CatmullRom) GetS() float64
GetS returns the support value for Catmull-Rom filter
func (*CatmullRom) Interpolate ¶
func (r *CatmullRom) Interpolate(x float64) float64
Interpolate returns the coefficient for x value using Catmull-Rom interpolation
type Interpolation ¶
type Interpolation int
Interpolation method types
const ( // InterNearest - takes the nearest pixel. InterNearest Interpolation = iota // InterLinear - Linear interpolation between two pixels. More info: https://en.wikipedia.org/wiki/Linear_interpolation InterLinear // InterCatmullRom - Catmull-Rom resampling. More info: https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline InterCatmullRom // InterLanczos - Lanczos resampling. More info: https://en.wikipedia.org/wiki/Lanczos_resampling InterLanczos )
type Lanczos ¶
type Lanczos struct{}
Lanczos - struct for Lanczos filter
func (*Lanczos) Interpolate ¶
Interpolate returns the coefficient for x value using Lanczos interpolation