Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasicRenderer ¶
type BasicRenderer struct {
// contains filtered or unexported fields
}
func NewBasic ¶
func NewBasic(opts ...BasicRendererOption) (BasicRenderer, error)
NewBasic creates and returns a new BasicRenderer that implements the Renderer interface. The renderer simply fills in regions of the layout.L with images passed to it and returns the image. If there aren't enough images, some sections of the returned image will have the default color. Note: If BasicWithInterpolationFunc is not passed as an option, the BasicRenderer will use the resize.Lanczos3 algorithm to resize images to fit the bounding rectangles.
type BasicRendererOption ¶
type BasicRendererOption func(b *BasicRenderer) error
BasicRendererOption allows changes to the basic renderer.
func BasicWithAspectRatioIgnored ¶
func BasicWithAspectRatioIgnored() BasicRendererOption
BasicWithAspectRatioIgnored allows images to be scaled to fit the bounding rectangle of a layout.L region without preserving their aspect ratio. This reduces the number of calculations done at the cost of skewing images
func BasicWithInterpolationFunc ¶
func BasicWithInterpolationFunc(intFunc resize.InterpolationFunction) BasicRendererOption
BasicWithInterpolationFunc sets the interpolation function used by the basic renderer to resize images to fit the bounding rectangle of a layout.L region
type Renderer ¶
type Renderer interface { // Render draws an image with the bounding rectangle rect filled with the pattern defined in the // layout.L. Each L section will be filled with an image based on an entry from the // provider.AlbumInfo slice. If len(l) > len(ai) then some regions may be left blank. If len(ai) > // len(l) then not all Album Infos need to be used. Render(l *layout.Layout, ai []provider.AlbumInfo) (image.Image, error) }
Renderer allows for murum image rendering