Documentation ¶
Overview ¶
Package smartcrop implements a content aware image cropping library based on Jonas Wagner's smartcrop.js https://github.com/jwagner/smartcrop.js
Package smartcrop implements a content aware image cropping library based on Jonas Wagner's smartcrop.js https://github.com/jwagner/smartcrop.js
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidDimensions gets returned when the supplied dimensions are invalid ErrInvalidDimensions = errors.New("Expect either a height or width") )
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer interface {
FindBestCrop(img image.Image, width, height int) (image.Rectangle, error)
}
Analyzer interface analyzes its struct and returns the best possible crop with the given width and height returns an error if invalid
func NewAnalyzer ¶
NewAnalyzer returns a new Analyzer using the given Resizer.
Click to show internal directories.
Click to hide internal directories.