memento

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const GameimgPrefix = "/gameimg/"

must end with /

Variables

View Source
var BoardDrawers map[string]*BoardDrawer
View Source
var RenderMutex sync.Mutex

Functions

func RenderImage

func RenderImage(history *macondopb.GameHistory, wf WhichFile) ([]byte, error)

Types

type BoardDrawer

type BoardDrawer struct {
	Colors             []color.Color // all *image.Paletted in this struct share this palette
	HeaderPalImg       *image.Paletted
	Tile0Sprite        map[byte]*image.Paletted // SubImage of the original tiles sprites
	Tile1Sprite        map[byte]*image.Paletted
	BoardSprite        map[rune]*image.Paletted
	TextXSprite        map[rune]*image.Paletted
	Text0Sprite        map[rune]*image.Paletted
	Text1Sprite        map[rune]*image.Paletted
	BoardConfig        [][]rune
	EmptyBoardPalImg   *image.Paletted
	PadLeft            int
	PadTop             int
	PadRight           int
	PadBottom          int
	PadHeader          int
	PadRack            int
	RackGap            int
	HeaderHeight       int
	PadSpread          int
	SpreadHeight       int
	SpreadMax          int
	PaddingColorIndex  byte
	BackXColorIndex    byte
	Back0ColorIndex    byte
	Back1ColorIndex    byte
	LetterDistribution *tilemapping.LetterDistribution
}

type MementoService

type MementoService struct {
	// contains filtered or unexported fields
}

func (*MementoService) GameimgEndpoint

func (ms *MementoService) GameimgEndpoint(w http.ResponseWriter, r *http.Request, name string)

func (*MementoService) ServeHTTP

func (ms *MementoService) ServeHTTP(w http.ResponseWriter, r *http.Request)

impl http.Handler

type TilePainterTilesMeta

type TilePainterTilesMeta struct {
	TilesBytes  []byte
	Tile0Src    map[byte][2]int
	Tile1Src    map[byte][2]int
	BoardSrc    map[rune][2]int
	TextXSrc    map[rune][2]int
	Text0Src    map[rune][2]int
	Text1Src    map[rune][2]int
	ExpDimXY    [2]int
	BoardConfig [][]rune
}

Content generated by /tile_images from the frontend.

type WhichFile

type WhichFile struct {
	GameId          string
	HasNextEventNum bool
	NextEventNum    int
	FileType        string // "png", "gif", "animated-gif", "animated-gif-b", "animated-gif-c"
	WhichColor      int    // 0, 1, or -1
	Version         int
}

Jump to

Keyboard shortcuts

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