Index

Package: Bins

Description

private package Tiles.Atlases.Bins is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Bin

type Bin is tagged limited private;
A Bin represents a rectangular 2D space that can be filled with smaller 2D rectangles. Each rectangle added to the bin via Insert() receives a location in the bin where it resides, according to the bin packing algorithm. This class uses the MAXRECTS bin packing algorithm with the BSSF (Best Short Side Fit) heuristic.

Types

Rect

type Rect is
        record
            x, y   : Integer := 0;
            width,
            height : Integer := 0;
        end record;
A Rect represents the size and location of a rectangle, packed in a Bin.

A_Bin

type A_Bin is access all Bin'Class;

Subprograms & Entries

Create_Bin

function Create_Bin
( width, height: Positive ) return A_Bin;
Creates a new bin of the specified size.

Insert

function Insert
( this: not null access Bin'Class;
width, height: Natural ) return Rect;
Inserts a single rectangle into the bin.

Delete

procedure Delete
( this: in out A_Bin );
Deletes the Bin.