Documentation ¶
Index ¶
- func Clip(srcimg image.Image, x, y, w, h int) (dstimg *image.RGBA)
- func ClipImage(srcfile, dstfile string, x, y, w, h int, f Format) (err error)
- func ClipImageCache(srcfile string, x, y, w, h int, f Format) (dstfile string, useCache bool, err error)
- func Composite(dstimg draw.Image, compimg image.Image, x, y int)
- func CompositeImage(srcfile, compfile, dstfile string, x, y int, f Format) (err error)
- func CompositeImageSet(srcfile string, compinfos []CompositeInfo, dstfile string, f Format) (err error)
- func CompositeImageUri(srcDatauri, compDataUri string, x, y int, f Format) (dstDataUri string, err error)
- func ConvertDataUriToImage(dataUri string, dstfile string, f Format) (err error)
- func ConvertImage(srcfile, dstfile string, f Format) (err error)
- func ConvertImageCache(srcfile string, f Format) (dstfile string, useCache bool, err error)
- func ConvertImageObjectToDataUri(img image.Image, f Format) (dataUri string, err error)
- func ConvertImageToDataUri(imgfile string) (dataUri string, err error)
- func Fill(srcimg image.Image, width, height int, style FillStyle) (dstimg *image.RGBA, err error)
- func FillImage(srcfile, dstfile string, width, height int, style FillStyle, f Format) (err error)
- func FillImageCache(srcfile string, width, height int, style FillStyle, f Format) (dstfile string, useCache bool, err error)
- func FlipImageHorizontal(srcfile, dstfile string, f Format) (err error)
- func FlipImageVertical(srcfile, dstfile string, f Format) (err error)
- func GetDominantColorOfImage(imgfile string) (h, s, v float64, err error)
- func GetImageSize(imgfile string) (w, h int, err error)
- func GetImagesInDir(dir string) ([]string, error)
- func GetPreferScaleClipRect(refWidth, refHeight, imgWidth, imgHeight int) (x, y, w, h int, err error)
- func GetSize(img image.Image) (w, h int)
- func Hsv2Rgb(h, s, v float64) (r, g, b uint8)
- func IsSupportedImage(imgfile string) bool
- func LoadImage(imgfile string) (img image.Image, err error)
- func LoadImageFromDataUri(dataUri string) (img image.Image, err error)
- func NewImageWithColor(dstfile string, width, height int, r, g, b, a uint8, f Format) (err error)
- func NewWithColor(width, height int, r, g, b, a uint8) (dstimg *image.RGBA, err error)
- func Rgb2Hsv(r, g, b uint8) (h, s, v float64)
- func RotateImageLeft(srcfile, dstfile string, f Format) (err error)
- func RotateImageRight(srcfile, dstfile string, f Format) (err error)
- func SaveImage(dstfile string, m image.Image, f Format) (err error)
- func Scale(srcimg image.Image, newWidth, newHeight int) (dstimg *image.RGBA)
- func ScaleImage(srcfile, dstfile string, newWidth, newHeight int, f Format) (err error)
- func ScaleImageCache(srcfile string, newWidth, newHeight int, f Format) (dstfile string, useCache bool, err error)
- func ScaleImagePrefer(srcfile, dstfile string, newWidth, newHeight int, f Format) (err error)
- func ScalePrefer(srcimg image.Image, newWidth, newHeight int) (dstimg *image.RGBA, err error)
- func SniffImageFormat(file string) (string, error)
- func Thumbnail(srcimg image.Image, maxWidth, maxHeight int) (dstimg *image.RGBA)
- func ThumbnailImage(srcfile, dstfile string, maxWidth, maxHeight int, f Format) (err error)
- func ThumbnailImageCache(srcfile string, maxWidth, maxHeight int, f Format) (dstfile string, useCache bool, err error)
- type CompositeInfo
- type FillStyle
- type Format
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClipImage ¶
ClipImage clip image file that format is recognized and save it with target format.
func ClipImageCache ¶
func ClipImageCache(srcfile string, x, y, w, h int, f Format) (dstfile string, useCache bool, err error)
ClipImageCache clip any recognized format image and save to cache directory, if already exists, just return it.
func CompositeImage ¶
CompositeImage composite two image files.
func CompositeImageSet ¶
func CompositeImageSet(srcfile string, compinfos []CompositeInfo, dstfile string, f Format) (err error)
CompositeImageSet composite a set of image files.
func CompositeImageUri ¶
func CompositeImageUri(srcDatauri, compDataUri string, x, y int, f Format) (dstDataUri string, err error)
CompositeImageUri composite two images which format in data uri.
func ConvertDataUriToImage ¶
ConvertDataUriToImage convert data uri to image file.
func ConvertImage ¶
ConvertImage converts from any recognized format to target format image.
func ConvertImageCache ¶
ConvertImageCache converts from any recognized format to cache directory, if already exists, just return it.
func ConvertImageObjectToDataUri ¶
ConvertImageToDataUri convert image.Image object to data uri.
func ConvertImageToDataUri ¶
ConvertImageToDataUri convert image file to data uri.
func Fill ¶
FillImage generate a new image in target width and height through source image, there are many fill sytles to choice from.
func FillImage ¶
FillImage generate a new image file in target width and height through source image file, there are many fill sytles to choice from.
func FillImageCache ¶
func FillImageCache(srcfile string, width, height int, style FillStyle, f Format) (dstfile string, useCache bool, err error)
FillImageCache generate a new image in target width and height through source image, and save it to cache directory, if already exists, just return it.
func FlipImageHorizontal ¶
FlipImageHorizontal flip image in horizontal direction, and save as target format.
func FlipImageVertical ¶
FlipImageVertical flip image in vertical direction, and save as target format.
func GetDominantColorOfImage ¶
GetDominantColorOfImage return the dominant hsv color of an image.
func GetImageSize ¶
GetImageSize return image's width and height.
func GetImagesInDir ¶
func GetPreferScaleClipRect ¶
func GetPreferScaleClipRect(refWidth, refHeight, imgWidth, imgHeight int) (x, y, w, h int, err error)
GetPreferScaleClipRect get the maximum rectangle in center of image which with the same scale to reference width/heigh.
func Hsv2Rgb ¶
Hsv2Rgb convert color format from HSV(h=[0..360), s,v=[0..1]) to RGB(r, g, b=[0..255]).
func IsSupportedImage ¶
IsSupportedImage check if image file is supported.
func LoadImageFromDataUri ¶
LoadImageFromDataUri convert data uri to image object.
func NewImageWithColor ¶
NewImageWithColor create a new image file with target size and rgba.
func NewWithColor ¶
NewWithColor create a new image object with target size and rgba.
func Rgb2Hsv ¶
Rgb2Hsv convert color format from RGB(r, g, b=[0..255]) to HSV(h=[0..360), s,v=[0..1]).
func RotateImageLeft ¶
RotateImageLeft rotate image to left side.
func RotateImageRight ¶
RotateImageLeft rotate image to right side.
func ScaleImage ¶
ScaleImage returns a new image file with the given width and height created by resizing the given image.
func ScaleImageCache ¶
func ScaleImageCache(srcfile string, newWidth, newHeight int, f Format) (dstfile string, useCache bool, err error)
ScaleImageCache resize any recognized format image file and save to cache directory, if already exists, just return it.
func ScaleImagePrefer ¶
ScaleImagePrefer resize image file to new width and heigh, and maintain the original proportions unchanged.
func ScalePrefer ¶
ScalePrefer resize image object to new width and heigh, and maintain the original proportions unchanged.
func SniffImageFormat ¶
func ThumbnailImage ¶
ThumbnailImage resize target image file with limited maximum width and height.