Documentation ¶
Overview ¶
Package mosaic provides various composers to generate image collages.
Index ¶
- Variables
- func CirclesPie(dc *gg.Context, images ...image.Image) error
- func RegisterComposer(comps ...ComposerInfo) error
- func StripesVertical(dc *gg.Context, images ...image.Image) error
- func StripesVerticalMulti(dc *gg.Context, images ...image.Image) error
- func TilesDiamond(dc *gg.Context, images ...image.Image) error
- func TilesFocused(dc *gg.Context, images ...image.Image) error
- func TilesPerfect(dc *gg.Context, images ...image.Image) error
- type Composer
- type ComposerFunc
- type ComposerInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidImageCount is the error returned, when an invalid amount of // images is passed to a composer. ErrInvalidImageCount = errors.New("invalid number of images") )
Functions ¶
func RegisterComposer ¶
func RegisterComposer(comps ...ComposerInfo) error
RegisterComposer registers the given
Types ¶
type Composer ¶
type Composer interface { // Compose draws the images to the drawing context. Compose(dc *gg.Context, images ...image.Image) error }
A Composer creates image compositions
type ComposerFunc ¶
A ComposerFunc is a Composer which itself is a function.
type ComposerInfo ¶
type ComposerInfo struct { Composer Id string Name string Description string ImageCountHuman string CheckImageCount func(count int) bool RecommendedImageCounts []int }
ComposerInfo is a Composer with additional information.
func GetComposer ¶
func GetComposer(id string) (ComposerInfo, bool)
GetComposer returns the composer with the given id.
func GetComposers ¶
func GetComposers() []ComposerInfo
GetComposers returns a slice containing all composers.
func RecommendComposers ¶ added in v0.0.2
func RecommendComposers(count int) []ComposerInfo
RecommendComposers returns a slice of composers which are suitable for the given image count.
func (ComposerInfo) RecommendImageCount ¶
func (ci ComposerInfo) RecommendImageCount(imageCount int) int
RecommendImageCount recommends a suitable amount of images to use which is guaranteed to be less or equal to the amount provided.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
app/mosaicc
Package mosaicc contains the logic for the mosaic cli.
|
Package mosaicc contains the logic for the mosaic cli. |
pkg
|
|
geom
Package geom contains utilities for working with geometry.
|
Package geom contains utilities for working with geometry. |
Click to show internal directories.
Click to hide internal directories.