voctree

package module
v0.0.0-...-e91fbdc Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: MIT Imports: 3 Imported by: 0

README

Voxel Octree

Octree storage designed for 8-bit data, stored on integer voxel boundaries

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cube

type Cube struct {
	Point
	SideShift uint8
}

type Point

type Point struct {
	X, Y, Z uint16
}

type Vocel1

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

Leaf case: one pixel in the cube, no subtress

func (*Vocel1) At

func (v1 *Vocel1) At(cube Cube) (pixel color.Gray)

func (*Vocel1) Nodes

func (v1 *Vocel1) Nodes() (count int)

func (*Vocel1) Set

func (v1 *Vocel1) Set(cube Cube, pixel color.Gray) (vnew Vocelish)

/ Set - set the pixel of the volume / / If the new pixel does not match the old pixel, split into 8 voxels

func (*Vocel1) String

func (v1 *Vocel1) String(cube Cube) (str string)

type Vocel8

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

Leaf case: 8 pixels in the cube, no subtrees

func (*Vocel8) At

func (v8 *Vocel8) At(cube Cube) (pixel color.Gray)

func (*Vocel8) Nodes

func (v8 *Vocel8) Nodes() (count int)

func (*Vocel8) Set

func (v8 *Vocel8) Set(cube Cube, pixel color.Gray) (vnew Vocelish)

/ Set - set the pixel of the volume /

func (*Vocel8) String

func (v8 *Vocel8) String(cube Cube) (str string)

type VocelTree

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

Tree case: subtrees

func (*VocelTree) At

func (vt *VocelTree) At(cube Cube) (pixel color.Gray)

func (*VocelTree) Nodes

func (vt *VocelTree) Nodes() (count int)

func (*VocelTree) Set

func (vt *VocelTree) Set(cube Cube, pixel color.Gray) (vnew Vocelish)

func (*VocelTree) String

func (vt *VocelTree) String(cube Cube) (str string)

type Vocelish

type Vocelish interface {
	Set(cube Cube, pixel color.Gray) (vnew Vocelish)
	At(cube Cube) (pixel color.Gray)
	Nodes() (count int)
	String(cube Cube) (str string)
}

type Voctree

type Voctree struct {
	Vocelish
	image.Rectangle
	SideShift uint8 // Power-of-8 size (0 = 1 voxel/side, 1 = 2 voxels/side, 2 = 4 voxels/side, ...)
}

Voxel Octree

func NewVoctree

func NewVoctree(sizex, sizey int) (v *Voctree)

func (*Voctree) At

func (v *Voctree) At(point Point) (pixel color.Gray)

func (*Voctree) GetPlane

func (v *Voctree) GetPlane(z int) (gray *image.Gray)

func (*Voctree) Set

func (v *Voctree) Set(point Point, pixel color.Gray)

func (*Voctree) SetPlane

func (v *Voctree) SetPlane(z int, gray *image.Gray) (err error)

func (*Voctree) String

func (v *Voctree) String() (str string)

Jump to

Keyboard shortcuts

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