22 lines
510 B
Go
22 lines
510 B
Go
package imaging
|
|
|
|
import (
|
|
"fmt"
|
|
"image"
|
|
|
|
"git.fjla.uk/fred.boniface/map-dots/data"
|
|
"git.fjla.uk/fred.boniface/map-dots/log"
|
|
)
|
|
|
|
func Generate(height, width int, style, format string, data []data.LocationData) image.Image {
|
|
log.Msg.Debug("Image generation request: " + fmt.Sprint(width) + "x" + fmt.Sprint(height) + " " + format + " " + style)
|
|
img := createCanvas(width, height)
|
|
|
|
switch style {
|
|
case "circle":
|
|
log.Msg.Debug("Selected style is circles")
|
|
mapCirclesToCanvas(img, data)
|
|
}
|
|
return img
|
|
}
|