transformation

package
v0.0.0-...-5e2ffb6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CpcCoordinates

func CpcCoordinates(address, startingAddress uint16, lineOctetWidth int) (int, int, error)

func DeltaAddress

func DeltaAddress(x, y, lineOctetWidth int) int

func ExportDelta

func ExportDelta(filename string, dc *DeltaCollection, mode uint8, cfg *config.MartineConfig) error

func GetTilePostion

func GetTilePostion(t *Tile, refs []Tile) int

func ProceedDelta

func ProceedDelta(filespath []string, initialAddress uint16, cfg *config.MartineConfig, mode uint8) error

nolint:funlen, gocognit

func RollLeft

func RollLeft(rla, sla, iterations int,
	screenMode uint8,
	size constants.Size,
	downgraded *image.NRGBA,
	newPalette color.Palette) []*image.NRGBA

func RollLow

func RollLow(keeplow, lostlow, iterations int,
	screenMode uint8,
	size constants.Size,
	downgraded *image.NRGBA,
	newPalette color.Palette) []*image.NRGBA

func RollRight

func RollRight(rra, sra, iterations int,
	screenMode uint8,
	size constants.Size,
	downgraded *image.NRGBA,
	newPalette color.Palette) []*image.NRGBA

func RollUp

func RollUp(keephigh, losthigh, iterations int,
	screenMode uint8,
	size constants.Size,
	downgraded *image.NRGBA,
	newPalette color.Palette) []*image.NRGBA

func Rotate

func Rotate(in *image.NRGBA,
	p color.Palette,
	size constants.Size,
	mode uint8,
	rollIteration int,
	resizeAlgo imaging.ResampleFilter) ([]*image.NRGBA, error)

func Rotate3d

func Rotate3d(in *image.NRGBA,
	p color.Palette,
	size constants.Size,
	mode uint8,
	resizeAlgo imaging.ResampleFilter,
	rollIteration,
	rotation3DX0,
	rotation3DY0 int,
	rotation3DType int,
) ([]*image.NRGBA, error)

func TileMode

func TileMode(ex *config.MartineConfig, mode uint8, iterationX, iterationY int) error

nolint: funlen

func TilesAreEquals

func TilesAreEquals(s1, s2 *Tile) bool

func X

func X(offset uint16, lineOctetWidth int) uint16

func Y

func Y(offset uint16, lineOctetWidth int) uint16

func Zigzag

func Zigzag(in *image.NRGBA) *image.NRGBA

Types

type AnalyzeBoard

type AnalyzeBoard struct {
	Tiles      [][]image.Image
	BoardTiles []BoardTile
	TileSize   constants.Size
	ImageSize  constants.Size
	TileMap    [][]int
}

func AnalyzeTilesBoard

func AnalyzeTilesBoard(im image.Image, size constants.Size) *AnalyzeBoard

func AnalyzeTilesBoardWithTiles

func AnalyzeTilesBoardWithTiles(im image.Image, size constants.Size, tiles []Tile) *AnalyzeBoard

func (*AnalyzeBoard) AddTile

func (a *AnalyzeBoard) AddTile(sprite *Tile, x, y int)

func (*AnalyzeBoard) Analyse

func (a *AnalyzeBoard) Analyse(sprite *Tile, x, y int) int

func (*AnalyzeBoard) GetUniqTiles

func (a *AnalyzeBoard) GetUniqTiles() []Tile

func (*AnalyzeBoard) Image

func (a *AnalyzeBoard) Image(filePath string, bt []BoardTile, size constants.Size) error

func (*AnalyzeBoard) NewTile

func (a *AnalyzeBoard) NewTile(sprite *Tile, x, y int)

func (*AnalyzeBoard) Palette

func (a *AnalyzeBoard) Palette() color.Palette

func (*AnalyzeBoard) ReduceTilesNumber

func (a *AnalyzeBoard) ReduceTilesNumber(threshold float64) []BoardTile

func (*AnalyzeBoard) SaveAllSprites

func (a *AnalyzeBoard) SaveAllSprites(folderpath string, palette color.Palette, mode uint8, cfg *config.MartineConfig) error

func (*AnalyzeBoard) SaveBoardTile

func (a *AnalyzeBoard) SaveBoardTile(folderpath string, bt []BoardTile) error

func (*AnalyzeBoard) SaveFlatFile

func (a *AnalyzeBoard) SaveFlatFile(folderpath string, palette color.Palette, mode uint8, cfg *config.MartineConfig) error

func (*AnalyzeBoard) SaveSchema

func (a *AnalyzeBoard) SaveSchema(filePath string) error

func (*AnalyzeBoard) SaveSprites

func (a *AnalyzeBoard) SaveSprites(folderpath string, palette color.Palette, mode uint8, cfg *config.MartineConfig) error

func (*AnalyzeBoard) SaveTilemap

func (a *AnalyzeBoard) SaveTilemap(filePath string) error

func (*AnalyzeBoard) SetAddTile

func (a *AnalyzeBoard) SetAddTile(x, y, index int)

func (*AnalyzeBoard) Sort

func (a *AnalyzeBoard) Sort() []BoardTile

func (*AnalyzeBoard) String

func (a *AnalyzeBoard) String() string

func (*AnalyzeBoard) TileIndex

func (a *AnalyzeBoard) TileIndex(tile *Tile, tiles []BoardTile) int

type BoardTile

type BoardTile struct {
	Occurence     int
	TilePositions []TilePosition
	Tile          *Tile
}

func (*BoardTile) AddTile

func (b *BoardTile) AddTile(tp []TilePosition)

func (*BoardTile) String

func (b *BoardTile) String() string

type DeltaCollection

type DeltaCollection struct {
	OccurencePerFrame uint8
	Items             []DeltaItem
}

func Delta

func Delta(scr1, scr2 []byte, isSprite bool, size constants.Size, mode uint8, x0, y0 uint16, lineOctetWidth int) *DeltaCollection

func DeltaMode0

func DeltaMode0(current *image.NRGBA, currentPalette color.Palette, next *image.NRGBA, nextPalette color.Palette, cfg *config.MartineConfig) (*DeltaCollection, error)

func DeltaMode1

func DeltaMode1(current *image.NRGBA, currentPalette color.Palette, next *image.NRGBA, nextPalette color.Palette, cfg *config.MartineConfig) (*DeltaCollection, error)

nolint: funlen, gocognit

func DeltaMode2

func DeltaMode2(current *image.NRGBA, currentPalette color.Palette, next *image.NRGBA, nextPalette color.Palette, cfg *config.MartineConfig) (*DeltaCollection, error)

nolint:funlen, gocognit

func NewDeltaCollection

func NewDeltaCollection() *DeltaCollection

func (*DeltaCollection) Add

func (dc *DeltaCollection) Add(b byte, address uint16)

func (*DeltaCollection) ItemsSortByByte

func (d *DeltaCollection) ItemsSortByByte() []DeltaItem

func (*DeltaCollection) Marshall

func (dc *DeltaCollection) Marshall() ([]byte, error)

format byte value, number of occurence, offsets values.

func (*DeltaCollection) NbAdresses

func (dc *DeltaCollection) NbAdresses() int

func (*DeltaCollection) Occurences

func (d *DeltaCollection) Occurences() int

func (*DeltaCollection) Save

func (dc *DeltaCollection) Save(filename string) error

func (*DeltaCollection) ToString

func (dc *DeltaCollection) ToString() string

type DeltaCollectionV2

type DeltaCollectionV2 struct {
	*DeltaCollection
}

func (*DeltaCollectionV2) Marshall

func (dc *DeltaCollectionV2) Marshall() ([]byte, error)

nolint: funlen

func (*DeltaCollectionV2) Save

func (dc *DeltaCollectionV2) Save(filename string) error

type DeltaItem

type DeltaItem struct {
	Byte    byte
	Offsets []uint16
}

func NewDeltaItem

func NewDeltaItem() DeltaItem

func (*DeltaItem) NbAddresses

func (di *DeltaItem) NbAddresses() int

func (*DeltaItem) ToString

func (di *DeltaItem) ToString() string

type DeltaV2

type DeltaV2 struct {
	HighByte uint8
	LowBytes []uint8
	Byte     uint8
}

func NewDeltaV2

func NewDeltaV2() *DeltaV2

func (*DeltaV2) AddLowByte

func (d *DeltaV2) AddLowByte(v uint8)

type Tile

type Tile struct {
	Size   constants.Size
	Colors [][]color.Color
}

func ExtractTile

func ExtractTile(im image.Image, size constants.Size, posX, posY int) (*Tile, error)

func GetTile

func GetTile(boards []BoardTile, x, y int) *Tile

func GetUniqTiles

func GetUniqTiles(board []BoardTile) []Tile

func NewTile

func NewTile(size constants.Size) *Tile

func (*Tile) Image

func (t *Tile) Image() *image.NRGBA

type TilePosition

type TilePosition struct {
	PixelX int
	PixelY int
}

func (*TilePosition) String

func (s *TilePosition) String() string

Jump to

Keyboard shortcuts

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