aimstil
5.0.5
|
Base class for dynamic type images. More...
#include <til/DynImage.h>
Public Member Functions | |
virtual | ~DynImage () |
Base class for dynamic type images.
Note that this class is templated over an image container type. I.e., this class only brings the "dynamic typing" functionality to an existing, static-typed image container class. Note: we have to template over something at this level, because otherwise we would have to know all possible images. This means that we would have to store that somewhere. Not good for extensability, and for performance. I would love to template over a general TImage, that would accept TImage's with any number of templateing arguments, and then use traits to decide how to construct an image of a specific type. Unfortunately C++ forbid this kind of templation: we have to know how many template arguments a template parameter accepts. Note on the overall strategy taken here for dynamic images: this is a sort of "top-down" approach. The DynImage never intend to mimic the behavior of a standard image so that algorithms could use it as a fully compliant image parameter and use it transparently. As a matter of fact, DynImage cannot be passed to any normal image function because it does not implement any image feature, like indexing, iterators, or even like returning the value of one of its element! Instead, the top-down approach consists in deciding at the earliest level possible which image we are dealing with, and calling the appropriate function. This is done with high-level wrappers like 'Dyn', that transform a normal image processing functor into a dynamic image processing functor, basically by simply adding switches. The reason for this is efficiency. The earliest we know what type we are dealing with, the faster. Just imagine if we have to check for the image type everytime we access one of its element! This would be the case if we had an iterator for dynamic images The bad side of the top down approach is that things get complicated when using more than one dynamic images. There is an unavoidable combinatoric explosion.
Definition at line 51 of file DynImage.h.
|
inlinevirtual |
Definition at line 54 of file DynImage.h.