goimg

package module
v0.0.0-...-35bfd23 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

README

goimg

Documentation

Index

Constants

View Source
const (
	IMAGE_SINGLE_RED = iota
	IMAGE_SINGLE_GREEN
	IMAGE_SINGLE_BLUE
)
View Source
const (
	SAVE_JPEG = iota
	SAVE_PNG
)
View Source
const (
	ROTATE_LEFT = iota
	ROTATE_RIGHT
	ROTATE_FULL
	FLIP_HORIZONTAL
	FLIP_VERTICAL
)

Variables

This section is empty.

Functions

func CutImage

func CutImage(src image.Image, x0, y0, x1, y1 int) image.Image

裁剪图像 src:源图像 x0,x1,y0,y1:裁剪的定点矩阵参数 返回新的裁剪图像

func FlipImage

func FlipImage(dst image.Image, src image.Image, flag int) error

翻转图像 flag: FLIP_HORIZONTAL(水平翻转) FLIP_VERTICAL(垂直翻转) 源图像和目标图像的大小要保存相应

func IsExist

func IsExist(fileName string) bool

判断文件是否存在

func LevelReversed

func LevelReversed(src *image.RGBA) *image.RGBA

垂直增加镜像图像,仅支持RGBA格式的图像 处理完的图像是源图像的两倍(y_=2*y)

func OpenALPHAImage

func OpenALPHAImage(file string) (*image.Alpha, error)

以透明度模式打开图像

func OpenGRAYImage

func OpenGRAYImage(file string) (*image.Gray, error)

以灰度模式打开图像

func OpenImage

func OpenImage(file string) (image.Image, error)

打开普通模式的图像文件

func OpenRGBAImage

func OpenRGBAImage(file string) (*image.RGBA, error)

以RGBA模式打开图像

func OpenSingleImage

func OpenSingleImage(file string, flag int) (*image.RGBA, error)

以单通道模式打开图像 通道标志有三种 IMAGE_SINGLE_RED(红通道) IMAGE_SINGLE_GREEN(绿通道) IMAGE_SINGLE_BLUE(蓝通道)

func RotateImage

func RotateImage(dst image.Image, src image.Image, flag int) error

旋转图像 flag: ROTATE_LEFT(向左旋转) ROTATE_RIGHT(向右旋转) ROTATE_FULL(180度旋转) 源图像和目标图像的大小要保存相应

func SaveImage

func SaveImage(file string, img image.Image, flag int) error

保存图像文件 file: 图像路径 img: 图像对象 flag: 图像格式(SAVE_JPEG,SAVE_PNG)

func VerticalReversed

func VerticalReversed(src *image.RGBA) *image.RGBA

水平增加镜像图像,仅支持RGBA格式的图像 处理完的图像是源图像的两倍(x_=2*x)

Types

This section is empty.

Jump to

Keyboard shortcuts

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