Support for external interfaces.
Software using DIPlib might want to control how the image data is allocated. Such software
should derive a class from this one, and assign a pointer to it into each of the images that
it creates, through
dip::Image::SetExternalInterface. The caller will maintain ownership of
See Define an image’s allocator for details on how to use the external interfaces.
dip::DataSegment AllocateData(void*& origin, dip::DataType dataType, dip::UnsignedArray const& sizes, dip::IntegerArray& strides, dip::Tensor const& tensor, dip::sint& tensorStride) pure virtual
Allocates the data for an image. The function is required to set
origin, and return a
dip::DataSegment that owns the
allocated data segment.
origin does not need to be the same pointer as
stored in the returned
dip::DataSegment. For example, the latter can point
to a container object (e.g.
origin can point to data
owned by the container object (e.g.
tensorStride might have been set by the user before
dip::Image::Forge, and should be honored if possible.