pack

package
v0.0.0-...-1e8ba1f Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2016 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressTree

func CompressTree(reader io.Reader, writer io.Writer) error

func DecodeHeader

func DecodeHeader(reader io.Reader, header *OctreeHeader) error

func DecodeNode

func DecodeNode(reader io.Reader, format OctreeFormat, color *Color, children []uint32) error

func EncodeHeader

func EncodeHeader(writer io.Writer, header OctreeHeader) error

func EncodeNode

func EncodeNode(writer io.Writer, format OctreeFormat, color Color, children []uint32) error

func TranscodeTree

func TranscodeTree(reader io.Reader, writer io.Writer, format OctreeFormat) error

Types

type Box

type Box struct {
	Pos  Point
	Size float64
}

func (Box) Intersect

func (b Box) Intersect(p Point) bool

type BuildConfig

type BuildConfig struct {
	Worker         BuildWorker
	Writer         io.Writer
	Bounds         Box
	VoxelsPerAxis  int
	Format         OctreeFormat
	Optimize       bool
	ColorFilter    bool
	ColorThreshold float32
}

type BuildStatus

type BuildStatus struct {
	Status OptStatus
}

func BuildTree

func BuildTree(cfg *BuildConfig) (BuildStatus, error)

type BuildWorker

type BuildWorker func(chan<- Sample) error

type Color

type Color struct {
	R, G, B, A float32
}

type OctreeFormat

type OctreeFormat byte
const (
	MipR8G8B8A8UnpackUI32 OctreeFormat = iota
	MipR8G8B8A8UnpackUI16
	MipR4G4B4A4UnpackUI16
	MipR5G6B5UnpackUI16

	MipR8G8B8A8PackUI28
	MipR4G4B4A4PackUI30
	MipR5G6B5PackUI30
	MipR3G3B2PackUI31
)

func (OctreeFormat) ColorSize

func (f OctreeFormat) ColorSize() int

func (OctreeFormat) IndexSize

func (f OctreeFormat) IndexSize() int

func (OctreeFormat) NodeSize

func (f OctreeFormat) NodeSize() int

type OctreeHeader

type OctreeHeader struct {
	Sign          [4]byte
	Version       byte
	Format        OctreeFormat
	Flags         byte
	Unused        byte
	NumNodes      uint64
	NumLeafs      uint64
	VoxelsPerAxis uint32
}

func (*OctreeHeader) BigEndian

func (h *OctreeHeader) BigEndian() bool

func (*OctreeHeader) Compressed

func (h *OctreeHeader) Compressed() bool

func (*OctreeHeader) Optimized

func (h *OctreeHeader) Optimized() bool

func (*OctreeHeader) Size

func (h *OctreeHeader) Size() int

type OptStatus

type OptStatus struct {
	NumMerged uint32
	MemMap    []int64
}

func OptimizeTree

func OptimizeTree(reader io.ReadSeeker, writer io.Writer, outputFormat OctreeFormat, colorThreshold float32, colorFilter bool) (OptStatus, error)

type Point

type Point struct {
	X, Y, Z float64
}

type Sample

type Sample struct {
	Pos Point
	Col Color
}

Jump to

Keyboard shortcuts

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