artbase

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: CC0-1.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const Version = "0.1.0-20220406"

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
View Source
var Collections = []Collection{
	{Name: "punks", Width: 24, Height: 24,
		Path:  "./punks.png",
		Url:   "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/punks.png",
		Count: 10000},

	{Name: "morepunks", Width: 24, Height: 24,
		Path:  "./morepunks.png",
		Url:   "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/morepunks.png",
		Count: 1000},

	{Name: "readymadepunks", Width: 24, Height: 24,
		Path: "./readymadepunks.png",
		Url:  "https://github.com/cryptopunksnotdead/punks.readymade/raw/master/readymades.png"},

	{Name: "bwpunks", Width: 24, Height: 24,
		Path:       "./bwpunks.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/bwpunks-24x24.png",
		Background: true},

	{Name: "frontpunks", Width: 24, Height: 24,
		Path: "./frontpunks.png",
		Url:  "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/frontpunks.png"},

	{Name: "intlpunks", Width: 24, Height: 24,
		Path: "./intlpunks.png",
		Url:  "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/intlpunks.png"},

	{Name: "punkforce", Width: 24, Height: 24,
		Path:       "./punkforce.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/punkforce/punkforce-24x24.png",
		Background: true},

	{Name: "cinemapunks", Width: 24, Height: 24,
		Path:       "./cinemapunks.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/cinemapunks/cinemapunks-24x24.png",
		Background: true},

	{Name: "mafiapunks", Width: 24, Height: 24,
		Path:       "./mafiapunks.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/mafiapunks/mafiapunks-24x24.png",
		Background: true},

	{Name: "youtubepunks", Width: 24, Height: 24,
		Path:       "./youtubepunks.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/youtubepunks/youtubepunks-24x24.png",
		Background: true},

	{Name: "goodbyepunks", Width: 24, Height: 24,
		Path:       "./goodbyepunks.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/goodbyepunks/goodbyepunks-24x24.png",
		Background: true},

	{Name: "boredapes", Width: 28, Height: 28,
		Path: "./boredapes.png",
		Url:  "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/boredapes.png"},

	{Name: "apes", Width: 35, Height: 35,
		Path:       "./apes.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/apes/apes-35x35.png",
		Background: true},

	{Name: "basicboredapes", Width: 50, Height: 50,
		Path:       "./basicboredapes.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/basicboredapeclub/basicboredapeclub-50x50.png",
		Background: true},

	{Name: "coolcats", Width: 24, Height: 24,
		Path: "./coolcats.png",
		Url:  "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/coolcats.png"},

	{Name: "luckycats", Width: 32, Height: 32,
		Path:  "./luckycats.png",
		Url:   "https://github.com/cryptopunksnotdead/punks.sandbox/raw/master/luckycats/i/luckycats-32x32.png",
		Count: 9},

	{Name: "mooncatrescue", Width: 24, Height: 24,
		Path: "./mooncatrescue.png",
		Url:  "https://github.com/cryptocopycats/awesome-mooncatrescue-bubble/raw/master/i/mooncatrescue.png"},

	{Name: "doge", Width: 24, Height: 24,
		Path: "./doge.png",
		Url:  "https://github.com/cryptopunksnotdead/programming-cryptopunks/raw/master/i/doge.png"},

	{Name: "dooggies", Width: 32, Height: 32,
		Path:       "./dooggies.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/dooggies-32x32.png",
		Background: true},

	{Name: "blockydoge", Width: 60, Height: 60,
		Path:       "./blockydoge.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/blockydoge/blockydoge-60x60.png",
		Background: true},

	{Name: "candybears", Width: 24, Height: 24,
		Path:  "./candybears.png",
		Url:   "https://github.com/cryptopunksnotdead/punks.sandbox/raw/master/candybears/i/candybears-24x24.png",
		Count: 12},

	{Name: "bears", Width: 24, Height: 24,
		Path:       "./bears.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/bears/bears-24x24.png",
		Background: true},

	{Name: "moonbears", Width: 34, Height: 34,
		Path:       "./moonbears.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/moonbears/moonbears-34x34.png",
		Count:      4000,
		Background: true},

	{Name: "lilmoonbirdies", Width: 24, Height: 24,
		Path:       "./lilmoonbirdies.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/lilmoonbirdies/lilmoonbirdies-24x24.png",
		Count:      10000,
		Background: true},

	{Name: "moonbirds", Width: 42, Height: 42,
		Path:       "./moonbirds.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/moonbirds/moonbirds-42x42.png",
		Count:      10000,
		Background: true},

	{Name: "fastfoodbirds-i", Width: 42, Height: 42,
		Path:       "./fastfoodbirds-i.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/fastfoodmoonbirds/fastfoodmoonbirds-42x42.png",
		Background: true},

	{Name: "fastfoodbirds-ii", Width: 42, Height: 42,
		Path:       "./fastfoodbirds-ii.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/fastfoodmoonbirds-ii/fastfoodmoonbirds-ii-42x42.png",
		Background: true},

	{Name: "fastfoodbirds-iii", Width: 42, Height: 42,
		Path:       "./fastfoodbirds-iii.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/fastfoodmoonbirds-iii/fastfoodmoonbirds-iii-42x42.png",
		Background: true},

	{Name: "starbirds", Width: 42, Height: 42,
		Path:       "./starbirds.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/starbirds/starbirds-42x42.png",
		Count:      3000,
		Background: true},

	{Name: "moonbirdpunks", Width: 50, Height: 50,
		Path:       "./moonbirdpunks.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/moonbirdpunks/moonbirdpunks-50x50.png",
		Count:      2469,
		Background: true},

	{Name: "8bits", Width: 24, Height: 24,
		Path:       "./8bits.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/8bits/8bits-24x24.png",
		Count:      8888,
		Background: true},

	{Name: "blockheads", Width: 25, Height: 25,
		Path:       "./blockheads.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/blockheads-25x25.png",
		Background: true},

	{Name: "nouns", Width: 32, Height: 32,
		Path:       "./nouns.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/nouns-32x32.png",
		Background: true},

	{Name: "womenpixies", Width: 98, Height: 98,
		Path:       "./womenpixies.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/womenpixies/womenpixies-98x98.png",
		Background: true},

	{Name: "wiener", Width: 32, Height: 32,
		Path:       "./wiener.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/wiener-32x32.png",
		Background: true},

	{Name: "gophers", Width: 32, Height: 32,
		Path:  "./gophers.png",
		Url:   "https://github.com/cryptopunksnotdead/lets-go-programming-cryptopunks/raw/master/gophers.png",
		Count: 35},

	{Name: "rocks", Width: 24, Height: 24,
		Path:  "./rocks.png",
		Url:   "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/rocks.png",
		Count: 100},

	{Name: "punkrocks", Width: 24, Height: 24,
		Path:  "./punkrocks.png",
		Url:   "https://github.com/cryptopunksnotdead/awesome-24px/raw/master/collection/punkrocks.png",
		Count: 10},
}
View Source
var Templates = make(map[string]*template.Template)

Functions

func Mutex added in v0.0.5

func Mutex(name string) *sync.Mutex

func RenderCollection

func RenderCollection(data *Collection) []byte

func RenderHome

func RenderHome(data []Collection) []byte

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 (*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