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

        Source Files