Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CropAnchor ¶
type CropAnchor int
const ( Center CropAnchor = iota TopLeft Top TopRight Left Right BottomLeft Bottom BottomRight )
type Options ¶
type Options struct {
Width int
Height int
Quality int
Anchor CropAnchor
Transform TransformType
Strategy ResampleStrategy
CopyExif bool
}
func NewOptions ¶
func NewOptions(transform TransformType, width, height int, copyExif bool) Options
Create Options that default to crop center strategy, image quality 90% and Resize strategy lanczos
type ResampleStrategy ¶
type ResampleStrategy int
const ( Lanczos ResampleStrategy = iota NearestNeighbor Box Linear Hermite MitchellNetravali CatmullRom BSpline Gaussian Bartlett Hann Hamming Blackman Welch Cosine )
type TransformType ¶
type TransformType int
const ( //Scales the image to given dimension. To keep aspect ratio the image is cropped ResizeAndCrop TransformType = iota //Cuts a specified region of the image Crop //Scale the image to the specified dimensions. To keep aspect ratio set either width or height to 0 Resize //Scale the image to fit the maximum specified dimensions. ResizeAndFit )
Click to show internal directories.
Click to hide internal directories.