clone

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package clone provides image cloning function.

Index

Constants

View Source
const (
	// NoFill leaves the padded pixels empty.
	NoFill = iota
	// EdgeExtend extends the closest edge pixel.
	EdgeExtend
	// EdgeWrap wraps around the pixels of an image.
	EdgeWrap
)

Variables

This section is empty.

Functions

func AsRGBA

func AsRGBA(src image.Image) *image.RGBA

AsRGBA returns an RGBA copy of the supplied image.

func Pad added in v0.8.0

func Pad(src image.Image, padX, padY int, m PadMethod) *image.RGBA

Pad returns an RGBA copy of the src image paramter with its edges padded using the supplied PadMethod. Parameter padX and padY correspond to the amount of padding to be applied on each side. Parameter m is the PadMethod to fill the new pixels.

Usage example:

result := Pad(img, 5,5, EdgeExtend)

Types

type PadMethod added in v0.8.0

type PadMethod uint8

PadMethod is the method used to fill padded pixels.

Jump to

Keyboard shortcuts

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