bitmap

package
v0.0.0-...-555bf8b Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: 0BSD Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client = &BitMap{Images: make(map[string]*imgDecode)}

Functions

func Call

func Call(drawType, imageName string, args ...interface{}) (interface{}, error)

func Clip

func Clip(in io.Reader, out io.Writer, wi, hi, x0, y0, x1, y1, quality int) (err error)

补上缺失的代码 * Clip 图片裁剪 * 入参:图片输入、输出、缩略图宽、缩略图高、Rectangle{Pt(x0, y0), Pt(x1, y1)},精度 * 规则:如果精度为0则精度保持不变 * * 返回:error */

func CreateRoundCircle

func CreateRoundCircle(src image.Image) (*image.RGBA, error)

func CreateRoundRect

func CreateRoundRect(src image.Image, r int, c *color.RGBA) (*image.RGBA, error)

func CreateRoundRect1

func CreateRoundRect1(rd io.Reader, r int, c *color.RGBA) (*image.RGBA, error)

CreateRoundRect1 创建圆角矩形 r为输入图像 r为圆角半径 color为圆角颜色

func CreateRoundRectWithRGBA

func CreateRoundRectWithRGBA(src image.Image, r int) (*image.RGBA, error)

func CreateRoundRectWithoutColor

func CreateRoundRectWithoutColor(rd io.Reader, r int) (*image.RGBA, error)

func Format2GIF

func Format2GIF(in io.Reader, out io.Writer) error

Format2GIF将图片转换为GIF格式

func Format2JPEG

func Format2JPEG(in io.Reader, out io.Writer) error

Format2JPEG 将图片转换为JPEG格式

func Format2PNG

func Format2PNG(in io.Reader, out io.Writer) error

Format2PNG 将图片转换为PNG格式

func GetRGBA

func GetRGBA(c int) *color.RGBA

0xC8CED4

func LuaOutErr

func LuaOutErr(str string) error

func Merge

func Merge(src []io.Reader, dst io.Writer) error

Merge 九宫格头像合成 固定新图大小132*132px 间隙3px 至少一张图片

func Merge6Grid

func Merge6Grid(src []io.Reader, dst io.Writer) error

Merge6Grid 6宫格 rule NO1:至少3张图 最多6张图 NO2:第一张大小 60*60 其他大小 28*28 间隔4px 合成图大小102*102 NO3:排列顺序 从左至右 从上到小 再 从右到左 ++| ++| --|

func Scale

func Scale(in io.Reader, out io.Writer, width, height, quality int) (int, int, error)

* Scale 缩略图生成 * 入参:图片输入、输出,缩略图宽、高,精度 * 规则: 如果width 或 hight其中有一个为0,则大小不变 如果精度为0则精度保持不变 * 返回:缩略图真实宽、高、error

Types

type BitMap

type BitMap struct {
	Images map[string]*imgDecode
}

type HEX

type HEX struct {
	// contains filtered or unexported fields
}

func (HEX) Hex2rgb

func (color HEX) Hex2rgb() (*RGB, error)

type Point

type Point struct {
	// contains filtered or unexported fields
}

type RGB

type RGB struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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