artbase

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2023 License: CC0-1.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const Version = "0.1.2-20230402"

Variables

View Source
var Cache = make(map[string]*pixelart.Image)

///

todo/check -  make (local) cache public - why? why not?
                            or just keep as "internal" detail
note: remember map always requires make or map literal to init/setup

Functions

func Mutex added in v0.0.5

func Mutex(name string) *sync.Mutex

Types

type Collection

type Collection struct {
	Name   string
	Width  int
	Height int
	Path   string
	Url    string
	// note:  background==false (default) => transparent
	//        background==true            => images have backgrounds (NOT transparent)
	Background bool
	Count      int
}

func DownloadCollections added in v1.1.0

func DownloadCollections(url string) []*Collection

func ParseCollections added in v1.1.0

func ParseCollections(txt string) []*Collection

func ReadCollections added in v1.1.0

func ReadCollections(path string) []*Collection

func (*Collection) HandleStripPNG added in v0.0.5

func (col *Collection) HandleStripPNG() []byte

func (*Collection) HandleTilePNG

func (col *Collection) HandleTilePNG(id int,
	opts PNGOpts) []byte

func (*Collection) HandleTileSVG

func (col *Collection) HandleTileSVG(id int,
	opts SVGOpts) []byte

func (*Collection) Image

func (col *Collection) Image() *pixelart.ImageComposite

type PNGOpts

type PNGOpts struct {
	Background     color.Color // default: nil
	BackgroundName string      // default: ""
	Silhouette     color.Color // default: nil
	SilhouetteName string      // default: ""
	Circle         bool        // default: false
	Mirror         bool        // default: false
	Transparent    bool        // default: false
	Zoom           int         // default: FIX??? use 1 NOT 0 - how?
	Resize         int         //  default:  0  (only specified if > 0)
	Save           bool        // default: false
	Flag           string      // default: ""
}

type SVGOpts

type SVGOpts struct {
	Background     color.Color // default: nil
	BackgroundName string      // default: ""
	Mirror         bool        // default: false
	Save           bool        // default: false
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL