00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef MLN_CORE_IMAGE_CH_PITER_HH
00028 # define MLN_CORE_IMAGE_CH_PITER_HH
00029
00036 # include <mln/core/internal/image_identity.hh>
00037
00038
00039
00040 namespace mln
00041 {
00042
00043
00044 template <typename I, typename Fwd> class ch_piter_image;
00045
00046
00047 namespace internal
00048 {
00049
00051 template <typename I, typename Fwd>
00052 struct data< ch_piter_image<I,Fwd> >
00053 {
00054 data(I& ima);
00055 I ima_;
00056 };
00057
00058 }
00059
00060
00061 namespace trait
00062 {
00063
00064 template <typename I, typename Fwd>
00065 struct image_< ch_piter_image<I,Fwd> > : image_< I >
00066 {
00067
00068 typedef trait::image::category::identity_morpher category;
00069 };
00070
00071 }
00072
00073
00074
00075
00076
00077 template <typename I, typename Fwd>
00078 class ch_piter_image : public internal::image_identity< I,
00079 mln_domain(I),
00080 ch_piter_image<I,Fwd> >
00081 {
00082 public:
00083
00085 typedef ch_piter_image< tag::image_<I>, Fwd > skeleton;
00086
00087 typedef Fwd fwd_piter;
00088 typedef Fwd bkd_piter;
00089 typedef fwd_piter piter;
00090
00091 ch_piter_image();
00092 ch_piter_image(I& ima);
00093
00094
00095 void init_(I& ima);
00096 };
00097
00098
00099
00100 template <typename Fwd, typename I>
00101 ch_piter_image<I,Fwd>
00102 ch_piter(Image<I>& ima);
00103
00104
00105
00106 # ifndef MLN_INCLUDE_ONLY
00107
00108
00109
00110
00111 namespace internal
00112 {
00113
00114 template <typename I, typename Fwd>
00115 inline
00116 data< ch_piter_image<I,Fwd> >::data(I& ima)
00117 : ima_(ima)
00118 {
00119 }
00120
00121 }
00122
00123
00124
00125
00126 template <typename I, typename Fwd>
00127 inline
00128 ch_piter_image<I,Fwd>::ch_piter_image()
00129 {
00130 }
00131
00132 template <typename I, typename Fwd>
00133 inline
00134 ch_piter_image<I,Fwd>::ch_piter_image(I& ima)
00135 {
00136 mln_precondition(ima.is_valid());
00137 init_(ima);
00138 }
00139
00140 template <typename I, typename Fwd>
00141 inline
00142 void
00143 ch_piter_image<I,Fwd>::init_(I& ima)
00144 {
00145 mln_precondition(ima.is_valid());
00146 this->data_ = new internal::data< ch_piter_image<I,Fwd> >(ima);
00147 }
00148
00149
00150
00151
00152 template <typename Fwd, typename I>
00153 inline
00154 ch_piter_image<I,Fwd>
00155 ch_piter(Image<I>& ima)
00156 {
00157 ch_piter_image<I,Fwd> tmp(exact(ima));
00158 return tmp;
00159 }
00160
00161 # endif // ! MLN_INCLUDE_ONLY
00162
00163 }
00164
00165
00166 #endif // ! MLN_CORE_IMAGE_CH_PITER_HH