BinPacker

class BinPacker(val size: Size, val algo: BinPacker.Algo = MaxRects(size))

Constructors

Link copied to clipboard
constructor(size: Size, algo: BinPacker.Algo = MaxRects(size))

Types

Link copied to clipboard
interface Algo
Link copied to clipboard
object Companion
Link copied to clipboard
class ImageDoNotFitException(val width: Double, val height: Double, val packer: BinPacker) : Throwable
Link copied to clipboard
class Result<T>(val maxWidth: Double, val maxHeight: Double, val items: List<Pair<T, Rectangle?>>)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val size: Size
Link copied to clipboard

Functions

Link copied to clipboard
fun add(width: Double, height: Double): Rectangle
fun add(width: Float, height: Float): Rectangle
fun add(width: Int, height: Int): Rectangle
Link copied to clipboard
fun <T> addBatch(items: Iterable<T>, getSize: (T) -> Size): BinPacker.Result<T>
Link copied to clipboard
fun <T> BinPacker.Algo.addBatch(items: Iterable<T>, getSize: (T) -> Size): List<Pair<T, Rectangle?>>
Link copied to clipboard
fun addOrNull(width: Double, height: Double): Rectangle?
fun addOrNull(width: Float, height: Float): Rectangle?
fun addOrNull(width: Int, height: Int): Rectangle?