$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mln::trait::concrete< I > Struct Template Reference

#include <mln/trait/concrete.hh>

Public Types

typedef ch_value< I, value >::ret ret
typedef I::value value

Related Functions

(Note that these are not member functions.)

#define mln_concrete(I)   typename mln::trait::concrete< I >::ret
#define mln_concrete_(I)   mln::trait::concrete< I >::ret

Detailed Description

template<typename I>
struct mln::trait::concrete< I >

Compute the concrete type of an image type.

Template Parameters
IAn image type.

This macro is used to compute the most appropriate concrete image type to be used to store a copy of an image of type I.

A concrete image type is an image type storing all its site values in a single memory buffer. For instance, mln::image1d, mln::image2d, mln::image3d are considered as concrete types. Image morphers are not concrete types since they can alter, on the fly, the domain and the values.

This macro is usually used while writing generic algorithms to handle all possible cases while image morphers and concrete images are interacting.

Few examples:

Therefore, you can safely write the following code:

template<typename I>
mln_concrete(I) my_function(const Image<I>& ima)
{
mln_ch_value(I,bool) output;
...
return output;
}
int main()
{
image2d<int> ima;
image2d<int> result = my_function(ima);
}

Computing a type with trait::concrete can be done using macros mln_concrete() and mln_concrete_().

Note that, due to C++ syntax ambiguities, mln_concrete() should be used in a templated function whereas mln_concrete_() shoud be used in a non-templated function.

If you are not sure of the concrete type that should be returned by the macro, take a look at mln_var() which can guess it for you.

Definition at line 108 of file concrete.hh.

Friends And Related Function Documentation

template<typename I>
#define mln_concrete (   I)    typename mln::trait::concrete< I >::ret
related

Macros provided for convenience. Should be used in a templated function only.

Definition at line 40 of file concrete.hh.

template<typename I>
#define mln_concrete_ (   I)    mln::trait::concrete< I >::ret
related

Macros provided for convenience. Should be used in a non-templated function only.

Definition at line 46 of file concrete.hh.

Member Typedef Documentation

template<typename I>
typedef ch_value<I, value>::ret mln::trait::concrete< I >::ret

Definition at line 111 of file concrete.hh.

template<typename I>
typedef I::value mln::trait::concrete< I >::value

Definition at line 110 of file concrete.hh.