util

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedFormat means the given image format (or file extension) is unsupported.
	ErrUnsupportedFormat = errors.New("imaging: unsupported image format")
)

Functions

func CompareImage

func CompareImage(img1 *image.Image, img2 *image.Image) int

CompareImage calcule le nombre de pixel de différence entre deux images

func Exists

func Exists(path string) (bool, error)

func IsInBoundaries

func IsInBoundaries(img *image.NRGBA, x, y int) bool

func Max

func Max(a, b int) int

Max retourne le max

func Min

func Min(a, b int) int

Min retourne le min

func OpenPng

func OpenPng(name string) (*image.Image, error)

OpenPng permet d'ouvrir un PNG

func RemoveContents

func RemoveContents(dir string) error

func Save

func Save(img image.Image, filename string) (err error)

Save saves the image to file with the specified filename. The format is determined from the filename extension: "jpg" (or "jpeg"), "png", "gif", "tif" (or "tiff") and "bmp" are supported.

func Uint32toUint8

func Uint32toUint8(val uint32) uint8

func WriteImage

func WriteImage(w io.Writer, img image.Image, format Format) error

WritePng permet d'écrire un PNG

Types

type Format

type Format int

Format is an image file format.

const (
	JPEG Format = iota
	PNG
	GIF
	TIFF
	BMP
)

Image file formats.

func (Format) String

func (f Format) String() string

Jump to

Keyboard shortcuts

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