Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

Image functors

In general, a functor is a function wrapped in an object. An image functor refers to an object that is used to make the user-specified functional part of a pattern (see Image processing patterns and variations) do what the user wants it to do.

Image functors are addressed via Image functor keys. Keys are created in the constructor of the image functors at the "real functor" level. The various parts of the key are derived from the actual template parameters via HxClassName.

Image functors are collected in the HxImgFtorTable. HxImgFtorTable contains a map of <HxImgFtorKey, HxImgFunctor*>. In general, functors are inserted in the table via declaration of a static variable that instantiates a leaf node image functor from the tree below for a specific image type. More accurately, the constructor of HxImgFunctor (the base class of the image functor hierarchy) inserts itself in the table under its key, i.e. it inserts the <key,object> combination in the table. The insert function puts a stringified version of the <key,functor> combination in the HxRegistry under ["/imagefunctortable/entries"].

When the user calls an image processing fuction, the HxImageData member functions construct a key by converting their arguments to strings and use this key to retrieve the right image functor from the table. The HxImageData member functions use the template class HxImgFtorTableTem to get statically typed access at the level of "I-nary" functors (see below) in the image functor hierarchy. The downcast is "safe" because the key used to find the "real functor" is derived from the key corresponding to the "I-nary" functor. Naturally, this implies that the image functor and key hierarchies should be kept in close harmony.

Other classes:

HxImgFtorDescription, HxImgFtorRuleBase,

The image functor tree

The tree has four levels:

  1. The root level : HxImgFunctor (for insertion and retrieval from the table).
  2. The "I-nary" level : I1 stands for "taking 1 image parameter", I2 for 2 image parameters, etc.
  3. The "cast" level : the highest template level for casting of polymorphic HxImageData parameters to statically typed image data pointers.
  4. The "real functor" level : the leaf nodes are the actual functors that introduce additional, pattern specific template parameters.

Go to the next section or go to images or return to the index.


Generated on Mon Jan 27 15:49:12 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001