The image concept in IPLT has two rather different faces within C++. There is the high-level ImageHandle, which is also reflected into Python, and which serves as the unified image representation for the "casual" user; as such, it offers the benefits of automatic memory management, encapsulation of the data type and domain, boundary checked safe access, and so on.

A developer that wants to provide a fast algorithm, however, will not want to live with the downside of such a convencience, namely the comparatively slow per-value access. Here is where the second, low-level, image representation comes into play, namely the templated ImageStates. For each valid combination of data type (REAL or COMPLEX) and domain (SPATIAL, FREQUENCY or HALF_FREQUENCY), there is one particular ImageState implementation, derived from a base class ImageStateBase?. A polymorphic pointer, wrapped in a boost::shared_ptr<>, is stored within each ImageHandle, and serves as the actual image implementation. Upon a data type or domain change, for instance after an FFT, this internal pointer may point to an instance of a different state, thus allowing the same ImageHandle to completely and transparently switch its internal image representation. This is known as a State Pattern.

All the developer needs to do is write an algorithm that uses image states, not image handles. In order to facilitate exactly this possibility, a sophisticated set of ImageState algorithms is available, which allow automagical integration of templated, ImageState specific code into the IPLT framework.