Documentation ¶
Overview ¶
Package imagetemplate generates images from JSON templates and application-specific variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoadOptions ¶
type LoadOptions interface { FromBuilder(builder scaffold.Builder) (Loader, render.NamedProperties, error) FromBytes(bytes []byte) (Loader, render.NamedProperties, error) FromFile(path string) (Loader, render.NamedProperties, error) FromJSON(raw json.RawMessage) (Loader, render.NamedProperties, error) FromReader(reader io.Reader) (Loader, render.NamedProperties, error) }
LoadOptions chooses the input format for Loader.
type Loader ¶
type Loader interface { Load() LoadOptions Write() WriteOptions }
Loader creates image builders from several input options and writes the finished product to several output formats.
func NewUsing ¶
func NewUsing(fs vfs.FileSystem) Loader
NewUsing returns a new loader using a specified vfs.
type WriteOptions ¶
type WriteOptions interface { ToBuilder(props render.NamedProperties) (scaffold.Builder, error) ToBMP(props render.NamedProperties) ([]byte, error) ToCanvas(props render.NamedProperties) (render.Canvas, error) ToImage(props render.NamedProperties) (image.Image, error) ToBMPReader(props render.NamedProperties) (io.Reader, error) }
WriteOptions chooses the output format for Loader.
Directories ¶
Path | Synopsis |
---|---|
components
|
|
barcode
Package barcode is a component for rendering barcodes with customisable content and colour for both background and data channels.
|
Package barcode is a component for rendering barcodes with customisable content and colour for both background and data channels. |
circle
Package circle is a simple circle component with customisable size, colour, location and radius.
|
Package circle is a simple circle component with customisable size, colour, location and radius. |
datetime
Package datetime is a text-based time component with customisable content, size, colour, location and time format.
|
Package datetime is a text-based time component with customisable content, size, colour, location and time format. |
image
Package image is an embedded image component with support for jpg, png, bmp and tiff files.
|
Package image is an embedded image component with support for jpg, png, bmp and tiff files. |
rectangle
Package rectangle is a simple rectangle component with customisable size, colour and location.
|
Package rectangle is a simple rectangle component with customisable size, colour and location. |
text
Package text is a simple text component with customisable content, size, colour, location and font.
|
Package text is a simple text component with customisable content, size, colour, location and font. |
Package cutils provides common parsing/conversion code for components to cut down on duplication
|
Package cutils provides common parsing/conversion code for components to cut down on duplication |
internal
|
|
filesystem
Package filesystem is a mock filesystem.
|
Package filesystem is a mock filesystem. |
Package render renders images onto a canvas.
|
Package render renders images onto a canvas. |
Package scaffold parses JSON data, matches it to known template components and controls rendering of the resultant image.
|
Package scaffold parses JSON data, matches it to known template components and controls rendering of the resultant image. |
Click to show internal directories.
Click to hide internal directories.