Documentation ¶
Index ¶
- Constants
- Variables
- func BackgroundImage(width, height int, bg color.RGBA) *image.RGBA
- func BigMin(minz, maxz, zcode int64) int64
- func BlendColor(c1, c2 color.RGBA, a float32) color.RGBA
- func Clamp32f(x, a, b float32) float32
- func ColorToHex(col color.RGBA) string
- func CoordToInterleaved(c Coord) (result int64)
- func CoordToPlain(c Coord) int64
- func DecodeFromBigEndian(key []byte) (int64, error)
- func DecodeStringFromBytes(key []byte) (pos int64, err error)
- func DecodeStringFromBytesToInterleaved(key []byte) (v int64, err error)
- func EncodeStringToBytes(key int64) ([]byte, error)
- func EncodeStringToBytesFromInterleaved(key int64) ([]byte, error)
- func EncodeToBigEndian(key int64) ([]byte, error)
- func EncodeToMem(img image.Image) []byte
- func FromBigEndian(key []byte) int64
- func HashImage(img *image.RGBA) []byte
- func IdentityTranscoder(key []byte) ([]byte, error)
- func IsPostgreSQL(host string) (string, bool)
- func LoadPNG(path string, bg color.RGBA) image.Image
- func Max(a, b int) int
- func Min(a, b int) int
- func NaiveBigMin(minz, maxz, zcode int64) int64
- func Order(a, b int) (int, int)
- func Order16(a, b int16) (int16, int16)
- func Order64(a, b int64) (int64, int64)
- func ParseColor(col string) (color.RGBA, error)
- func ParseColorDefault(col string, def color.RGBA) color.RGBA
- func PrintVersionAndExit()
- func SaveAsPNG(path string, img image.Image) (err error)
- func SaveAsPNGAtomic(path string, img image.Image) (err error)
- func StringToBytes(key int64) []byte
- func ToBigEndian(key int64) []byte
- func TranscodeInterleavedToPlain(key []byte) ([]byte, error)
- func TranscodePlainToInterleaved(key []byte) ([]byte, error)
- func TransformInterleavedToPlain(pos int64) int64
- func TransformPlainToInterleaved(pos int64) int64
- type BaseTileCreator
- type BaseTileHash
- type BaseTileUpdateFunc
- type Block
- type BlockConsumer
- type BlockProducer
- type Colors
- type Coord
- type Coverage3D
- type Cuboid
- type DBClient
- type DBClientFactory
- type DecodedBlock
- type KeyDecoder
- type KeyEncoder
- type KeyJoiner
- type KeySplitter
- type KeyTranscoder
- type KeyTransformer
- type PGClient
- type PGClientFactory
- type Range
- type RedisClient
- type RedisClientFactory
- type Renderer
- func (r *Renderer) CreateImage(colors []color.RGBA, background color.RGBA) *image.RGBA
- func (r *Renderer) CreateShadedImage(xOfs, zOfs, width, height int, cols *Colors, background color.RGBA) *image.RGBA
- func (r *Renderer) GetPos() (int16, int16)
- func (r *Renderer) IsEmpty() bool
- func (r *Renderer) IsFilled() bool
- func (r *Renderer) RenderBlock(block *Block, colors *Colors) (err error)
- func (r *Renderer) Reset()
- func (r *Renderer) SetPos(xOfs, zOfs int16)
- type YOrder
Constants ¶
View Source
const ( MaxHeight = 1934 MinHeight = -1934 )
View Source
const DefaultTransparentDim = 2.0 / 100.0
DefaultTransparentDim sets the default dimming factor of transparent nodes to 2%.
View Source
const MTSatelliteVersion = "0.9.1"
Variables ¶
View Source
var ( ErrNoMoreBlocks = errors.New("no more blocks") ErrMapContentSizeMismatch = errors.New("content size does not match") ErrBlockTruncated = errors.New("block is truncated") )
Error returned if a Producer has run to its end.
View Source
var BackgroundColor = color.RGBA{R: 0xff, G: 0xff, B: 0xff, A: 0xff}
View Source
var ResizeFilter = rez.NewLanczosFilter(3)
ResizeFilter is used to scale down the pyramid tiles.
Functions ¶
func ColorToHex ¶
func CoordToInterleaved ¶
func CoordToPlain ¶
func DecodeFromBigEndian ¶
func DecodeStringFromBytes ¶
DecodeStringFromBytes constructs a database key out of byte slice.
func EncodeStringToBytes ¶
EncodeStringToBytes encodes a block pos to byte slice.
func EncodeToBigEndian ¶
func EncodeToMem ¶
func FromBigEndian ¶
func IdentityTranscoder ¶
func IsPostgreSQL ¶
func NaiveBigMin ¶
NaiveBigMin is for correctness checks of BigMin only.
func PrintVersionAndExit ¶
func PrintVersionAndExit()
func StringToBytes ¶
func ToBigEndian ¶
Types ¶
type BaseTileCreator ¶
type BaseTileCreator struct {
// contains filtered or unexported fields
}
func NewBaseTileCreator ¶
func (*BaseTileCreator) Close ¶
func (btc *BaseTileCreator) Close() error
func (*BaseTileCreator) RenderArea ¶
func (btc *BaseTileCreator) RenderArea(x, z int16) error
func (*BaseTileCreator) WriteFunc ¶
func (btc *BaseTileCreator) WriteFunc(i, j int, update BaseTileUpdateFunc) func() (bool, error)
WriteFunc returns a function intended to be run in background so the creation of the next tile with this creator can be done concurrently.
type BaseTileHash ¶
func NewBaseTileHash ¶
func NewBaseTileHash(maxEntries int) *BaseTileHash
type BaseTileUpdateFunc ¶
type BlockConsumer ¶
type BlockConsumer interface { Consume(*Block) error // Closes the open database connections. Close() error }
BlockConsumer is used to store blocks in a new Minetest database.
type BlockProducer ¶
type BlockProducer interface { // error is ErrNoMoreBlocks if it run out of blocks. Next(*Block) error // Closes the open database connections. Close() error }
BlockProducer is used to over a existing Minetest database and return its content block by block.
type Colors ¶
type Colors struct { Colors []color.RGBA NameIndex map[string]int32 NumTransparent int32 TransparentDim float32 }
func ParseColors ¶
func (*Colors) BlendColors ¶
func (*Colors) IsTransparent ¶
type Coord ¶
type Coord struct {
X, Y, Z int16
}
func InterleavedToCoord ¶
func PlainToCoord ¶
type Coverage3D ¶
type Coverage3D struct {
// contains filtered or unexported fields
}
func NewCoverage3D ¶
func NewCoverage3D() *Coverage3D
func (*Coverage3D) Insert ¶
func (c3d *Coverage3D) Insert(c Coord)
func (*Coverage3D) Query ¶
func (c3d *Coverage3D) Query(c1, c2 Coord) []Range
type DBClientFactory ¶
func CreateDBClientFactory ¶
func CreateDBClientFactory(host string, port int) (DBClientFactory, error)
type DecodedBlock ¶
type DecodedBlock struct { Version byte Transparent bool MapContent []byte AirID int32 IgnoreID int32 IndexMap map[int32]int32 }
func NewDecodedBlock ¶
func NewDecodedBlock(data []byte, colors *Colors) (db *DecodedBlock, err error)
func (*DecodedBlock) AirOnly ¶
func (db *DecodedBlock) AirOnly() bool
type KeyDecoder ¶
type KeyEncoder ¶
type KeySplitter ¶
type KeyTranscoder ¶
type KeyTransformer ¶
type PGClientFactory ¶
type PGClientFactory struct {
// contains filtered or unexported fields
}
func NewPGClientFactory ¶
func NewPGClientFactory(connS string) (*PGClientFactory, error)
func (*PGClientFactory) Close ¶
func (pgcf *PGClientFactory) Close() error
func (*PGClientFactory) Create ¶
func (pgcf *PGClientFactory) Create() (DBClient, error)
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
func NewRedisClient ¶
func NewRedisClient(network, address string) (client *RedisClient, err error)
func (*RedisClient) Close ¶
func (client *RedisClient) Close() error
func (*RedisClient) QueryCuboid ¶
type RedisClientFactory ¶
type RedisClientFactory struct {
// contains filtered or unexported fields
}
func NewRedisClientFactory ¶
func NewRedisClientFactory(host string, port int) (*RedisClientFactory, error)
func (*RedisClientFactory) Close ¶
func (rcf *RedisClientFactory) Close() error
func (*RedisClientFactory) Create ¶
func (rcf *RedisClientFactory) Create() (DBClient, error)
type Renderer ¶
type Renderer struct { RejectedBlocks int SolidBlocks int TransparentBlocks int // contains filtered or unexported fields }
func NewRenderer ¶
func (*Renderer) CreateImage ¶
func (*Renderer) CreateShadedImage ¶
func (*Renderer) RenderBlock ¶
Click to show internal directories.
Click to hide internal directories.