Containers [¶]
Containers and views used by Blend2D.
Blend2D needs certain containers to function, but it cannot use containers from a C++ standard library because it provides both C-API and C-ABI. In addition, the underlying representation of all classes that inherit from BLObjectCore 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 BLString, BLArray, BLBitArray, and other specialized containers.
Views & Common Types
- BLArrayView<T> - read-only view of an array (any array, not just BLArray<T>)
- BLStringView - read-only view of a string, the view doesn't have to be null terminated
- BLRange - start/end range, which can be used with sequential containers
Sequential Containers
- BLArray<T> - growable array of T elements. Can hold both primitive types and Blend2D objects
- BLArrayCore - C API type representing BLArray<T>
- BLString - 8-bit null terminated string, usually UTF-8 encoded, but it's not a requirement
- BLStringCore - C API type representing BLString
Bit Containers
- BLBitArray - a dense bit-array (stores bits starting from 0 to size, sequentially)
- BLBitArrayCore - C API type representing BLBitArray
- BLBitSet - a sparse bit array that can represent sparse/dense bits and range of bits (will be deprecated)
- BLBitSetCore - C API type representing BLBitSet
- BLBitSetSegment - segment used by BLBitSet
- BLBitSetData - data view used by BLBitSet