packing

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package packing offers a packing algorithm in 2D space.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

func (*Node) Region

func (n *Node) Region() (x, y, width, height int)

type Page

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

func NewPage

func NewPage(initSize int, maxSize int) *Page

func (*Page) Alloc

func (p *Page) Alloc(width, height int) *Node

func (*Page) CommitExtension

func (p *Page) CommitExtension()

CommitExtension commits Extend call.

func (*Page) Extend

func (p *Page) Extend(count int) bool

func (*Page) Free

func (p *Page) Free(node *Node)

func (*Page) IsEmpty

func (p *Page) IsEmpty() bool

func (*Page) RollbackExtension

func (p *Page) RollbackExtension()

RollbackExtension rollbacks Extend call once.

func (*Page) SetMaxSize

func (p *Page) SetMaxSize(size int)

func (*Page) Size

func (p *Page) Size() int

Jump to

Keyboard shortcuts

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