artbase

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: CC0-1.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const Version = "0.1.0"

Variables

View Source
var Cache = make(map[string]image.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"},

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

	{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: "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: "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: "wiener", Width: 32, Height: 32,
		Path:       "./wiener.png",
		Url:        "https://github.com/pixelartexchange/collections/raw/master/wiener-32x32.png",
		Background: true},

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

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

Functions

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) 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: ""
	Mirror         bool        // default: false
	Zoom           int         // default: FIX??? use 1 NOT 0 - how?
	Save           bool        // default: false
}

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