spz

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 14 Imported by: 0

README

SPZ File Format

Niantic Scaniverse's SPZ format

API

Read

Deserialize a gaussian splat from the input reader.

spz.Read(in io.Reader) (*spz.Cloud, error)
Load

Opens the file located at the filePath and deserializes a gaussian splat.

spz.Load(filePath string) (*spz.Cloud, error)
Read Header

Deserialize a SPZ File Header from the input reader.

spz.ReadHeader(in io.Reader) (*spz.Header, error)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write added in v0.21.3

func Write(cloud modeling.Mesh, out io.Writer) error

Types

type Cloud

type Cloud struct {
	Header Header
	Mesh   modeling.Mesh
}

func Load

func Load(filePath string) (*Cloud, error)

Opens the file located at the filePath and deserializes a gaussian splat.

func Read

func Read(inUncompressed io.Reader) (*Cloud, error)

Deserialize a gaussian splat from the input reader.

type Header struct {
	Magic          uint32 `json:"magic"`     // Must be 0x5053474e (NGSP = Niantic gaussian splat)
	Version        uint32 `json:"version"`   // Must be 2
	NumPoints      uint32 `json:"numPoints"` // Cant be greater than 10000000
	ShDegree       uint8  `json:"shDegree"`  // Must be between 0 and 3
	FractionalBits uint8  `json:"fractionalBits"`
	Flags          uint8  `json:"flags"`
	Reserved       uint8  `json:"reserved"` // Must be 0
}

func ReadHeader added in v0.18.0

func ReadHeader(in io.Reader) (*Header, error)

func (Header) Float16Positions

func (pgh Header) Float16Positions() bool

func (Header) ShDimensions added in v0.18.0

func (pgh Header) ShDimensions() (int, error)

func (Header) Validate

func (pgh Header) Validate() error

type ReadNode added in v0.21.3

type ReadNode = nodes.Struct[modeling.Mesh, ReadNodeData]

type ReadNodeData added in v0.21.3

type ReadNodeData struct {
	Data nodes.NodeOutput[[]byte]
}

func (ReadNodeData) Process added in v0.21.3

func (gad ReadNodeData) Process() (modeling.Mesh, error)

Jump to

Keyboard shortcuts

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