package
0.0.0-20240105075242-dddda54ea9f0
Repository: https://github.com/linuxdeepin/go-lib.git
Documentation: pkg.go.dev
# README
Go 图形处理库, 主要围绕 Go 自身的 image 库进行增强开发. 支持对图片进行 剪切, 翻转, 缩放, 混合等操作.
关于 API 的命名风格, 以 Clip 操作为例:
-
Clip 对 image.Image 对象进行剪切操作
-
ClipImage 对目标文件进行剪切操作
-
ClipImageCache 对目标文件进行剪切操作, 同时将处理后的文件放到缓 存目录, 下次对同一文件进行相同操作时可以大大提高速度
# Functions
ClipImage clip image object.
ClipImage clip image file that format is recognized and save it with target format.
ClipImageCache clip any recognized format image and save to cache directory, if already exists, just return it.
CompositeImage composite two image objects.
CompositeImage composite two image files.
CompositeImageSet composite a set of image files.
CompositeImageUri composite two images which format in data uri.
ConvertDataUriToImage convert data uri to image file.
ConvertImage converts from any recognized format to target format image.
ConvertImageCache converts from any recognized format to cache directory, if already exists, just return it.
ConvertImageToDataUri convert image.Image object to data uri.
ConvertImageToDataUri convert image file to data uri.
FillImage generate a new image in target width and height through source image, there are many fill sytles to choice from.
FillImage generate a new image file in target width and height through source image file, there are many fill sytles to choice from.
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.
FlipImageHorizontal flip image in horizontal direction, and save as target format.
FlipImageVertical flip image in vertical direction, and save as target format.
GetDominantColorOfImage return the dominant hsv color of an image.
GetImageFormat return image format, such as "png", "jpeg".
No description provided by the author
GetImageSize return image's width and height.
GetPreferScaleClipRect get the maximum rectangle in center of image which with the same scale to reference width/heigh.
No description provided by the author
Hsv2Rgb convert color format from HSV(h=[0..360), s,v=[0..1]) to RGB(r, g, b=[0..255]).
IsSupportedImage check if image file is supported.
LoadImage load image file and return image.Image object.
LoadImageFromDataUri convert data uri to image object.
NewImageWithColor create a new image file with target size and rgba.
NewWithColor create a new image object with target size and rgba.
Rgb2Hsv convert color format from RGB(r, g, b=[0..255]) to HSV(h=[0..360), s,v=[0..1]).
RotateImageLeft rotate image to left side.
RotateImageLeft rotate image to right side.
SaveImage save image.Image object to target file.
Scale resize image object to new width and height.
ScaleImage returns a new image file with the given width and height created by resizing the given image.
ScaleImageCache resize any recognized format image file and save to cache directory, if already exists, just return it.
ScaleImagePrefer resize image file to new width and heigh, and maintain the original proportions unchanged.
ScalePrefer resize image object to new width and heigh, and maintain the original proportions unchanged.
No description provided by the author
Thumbnail resize image object with limited maximum width and height.
ThumbnailImage resize target image file with limited maximum width and height.
ThumbnailImageCache resize target image file with limited maximum width and height, and save to cache directory, if already exists, just return it.
# Constants
居中.
平铺.
Registered image format.
Registered image format.
Registered image format.
Registered image format.
# Structs
No description provided by the author