package smartcrop
import "github.com/muesli/smartcrop"
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 ¶
- Variables
- type Analyzer
- func NewAnalyzer(resizer options.Resizer) Analyzer
- func NewAnalyzerWithLogger(resizer options.Resizer, logger Logger) Analyzer
- type Crop
- type Logger
- type Score
Variables ¶
var ( // ErrInvalidDimensions gets returned when the supplied dimensions are invalid ErrInvalidDimensions = errors.New("Expect either a height or width") )
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.
func NewAnalyzerWithLogger ¶
NewAnalyzerWithLogger returns a new analyzer with the given Resizer and Logger.
type Crop ¶
Crop contains results
type Logger ¶
Logger contains a logger.
type Score ¶
Score contains values that classify matches
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
nfnt | |
options |
- Version
- v0.3.0 (latest)
- Published
- Oct 30, 2018
- Platform
- js/wasm
- Imports
- 13 packages
- Last checked
- 2 weeks ago –
Tools for package owners.