Documentation ¶
Index ¶
- Constants
- Variables
- type ArrayCarver
- func (a *ArrayCarver) Energy(x, y int) (float64, error)
- func (a *ArrayCarver) HRemoveSeam(seam []int) error
- func (a *ArrayCarver) HSeam() ([]int, error)
- func (a *ArrayCarver) Height() int
- func (a *ArrayCarver) Img() image.Image
- func (a *ArrayCarver) VRemoveSeam(seam []int) error
- func (a *ArrayCarver) VSeam() ([]int, error)
- func (a *ArrayCarver) Width() int
- type Carver
Constants ¶
View Source
const MaxEnergy = 1000.0
MaxEnergy is the default energy value used for borders (which would be otherwise undefined)
Variables ¶
View Source
var ( // ErrInvalid is thrown for invalid argument ErrInvalid = errors.New("invalid argument") )
Functions ¶
This section is empty.
Types ¶
type ArrayCarver ¶
type ArrayCarver struct {
// contains filtered or unexported fields
}
ArrayCarver is a simple, array based implementation of seam carving.
func NewArrayCarver ¶
func NewArrayCarver(img image.Image) (*ArrayCarver, error)
NewArrayCarver returns a new Carver for img
func (*ArrayCarver) Energy ¶
func (a *ArrayCarver) Energy(x, y int) (float64, error)
Energy returns the current energy of the point at (x,y)
func (*ArrayCarver) HRemoveSeam ¶
func (a *ArrayCarver) HRemoveSeam(seam []int) error
HRemoveSeam modifies the image, removing a horizontal seam
func (*ArrayCarver) HSeam ¶
func (a *ArrayCarver) HSeam() ([]int, error)
HSeam returns the optimal horizontal seam of the image
func (*ArrayCarver) Height ¶
func (a *ArrayCarver) Height() int
Height returns the current height of the image
func (*ArrayCarver) Img ¶
func (a *ArrayCarver) Img() image.Image
Img returns the current image from the Carver
func (*ArrayCarver) VRemoveSeam ¶
func (a *ArrayCarver) VRemoveSeam(seam []int) error
VRemoveSeam modifies the image, removing a vertical seam
func (*ArrayCarver) VSeam ¶
func (a *ArrayCarver) VSeam() ([]int, error)
VSeam returns the optimal vertical seam of the image
func (*ArrayCarver) Width ¶
func (a *ArrayCarver) Width() int
Width returns the current width of the image
Click to show internal directories.
Click to hide internal directories.