pic

package
v0.0.0-...-8375e82 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedFormat = errors.New("imaging: unsupported image format")
)

Functions

func CloneImage

func CloneImage(img image.Image) *image.NRGBA

CloneImage returns a copy of the given image.

func DecodeImage

func DecodeImage(r io.Reader) (image.Image, string, error)

Decode reads an image from r.

func Encode

func Encode(w io.Writer, img image.Image, name string) error

encode image file

func EncodeImage

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

EncodeImage writes the image img to w in the specified format (JPEG, PNG, GIF, BMP).

func NewImage

func NewImage(width, height int, fillColor color.Color) *image.NRGBA

NewImage creates a new image with the specified width and height, and fills it with the specified color.

func OpenImage

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

OpenImage loads an image from file

func SaveImage

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

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

func UrlReader

func UrlReader(url string) (image.Image, string, error)

get url image

func UrlReaderToByte

func UrlReaderToByte(url string) ([]byte, error)

get url image byte

Types

type Format

type Format int
const (
	JPEG Format = iota
	PNG
	GIF
	BMP
)

func (Format) String

func (f Format) String() string

Directories

Path Synopsis
Package bmp implements a BMP image decoder and encoder.
Package bmp implements a BMP image decoder and encoder.
Package resize implements various image resizing methods.
Package resize implements various image resizing methods.

Jump to

Keyboard shortcuts

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