Skip to content

Containers

Containers and views used by Blend2D.

Blend2D needs certain containers to function, but it cannot use Delphi containers other than TArray<T>. In addition, the underlying representation of all classes that inherit from TBLObjectCore need to provide reference counting, even for containers, so they can be shared across threads without requiring to do any extra work by Blend2D users.

In addition, Blend2D embraces small data optimization (often described as SSO - small string optimization), which is utilized by TBLString, TBLArray<T>, TBLBitArray and other specialized containers.

Views & Common Types

Sequential Containers

  • TBLArray<T> - growable array of T elements. Can hold both primitive types and Blend2D objects.
  • TBLString - 8-bit null terminated string, usually UTF-8 encoded, but it's not a requirement.

Bit Containers

  • TBLBitArray - a dense bit-array (stores bits starting from 0 to size, sequentially).