27 #ifndef MLN_ACCU_STAT_HISTO3D_RGB_HH
28 # define MLN_ACCU_STAT_HISTO3D_RGB_HH
72 # include <mln/accu/internal/base.hh>
74 # include <mln/arith/plus.hh>
76 # include <mln/core/macros.hh>
77 # include <mln/core/image/image3d.hh>
78 # include <mln/core/alias/point3d.hh>
79 # include <mln/core/alias/box3d.hh>
81 # include <mln/literal/zero.hh>
83 # include <mln/trace/entering.hh>
84 # include <mln/trace/exiting.hh>
86 # include <mln/trait/value/comp.hh>
88 # include <mln/value/ops.hh>
100 template <
typename V>
111 struct histo3d_rgb :
public Meta_Accumulator<histo3d_rgb>
113 template <
typename V>
116 typedef accu::stat::histo3d_rgb<V> ret;
130 template <
typename V>
131 struct accumulator_< mln::accu::stat::histo3d_rgb<V> >
133 typedef accumulator::has_untake::no has_untake;
134 typedef accumulator::has_set_value::no has_set_value;
135 typedef accumulator::has_stop::no has_stop;
136 typedef accumulator::when_pix::use_v when_pix;
139 template <
typename V>
140 struct set_precise_binary_<op::eq,
141 accu::stat::histo3d_rgb<V>,
142 accu::stat::histo3d_rgb<V> >
166 template <
typename V>
168 public mln::accu::internal::base<image3d<unsigned>, histo3d_rgb<V> >
199 void take(
const argument& t);
236 template <
typename V>
240 # ifndef MLN_INCLUDE_ONLY
242 template <
typename V>
246 trace::entering(
"mln::accu::stat::histo3d_rgb::cstor");
248 typedef mln_trait_value_comp(V,0) comp0;
249 typedef mln_trait_value_comp(V,1) comp1;
250 typedef mln_trait_value_comp(V,2) comp2;
263 trace::exiting(
"mln::accu::stat::histo3d_rgb::cstor");
266 template <
typename V>
273 template <
typename V>
280 ++count_(
point3d(t.blue(), t.red(), t.green()));
284 template <
typename V>
288 count_ += other.count_;
291 template <
typename V>
298 template <
typename V>
305 template <
typename V>
309 bool result = count_.is_valid();
314 template <
typename V>
318 trace::entering(
"mln::accu::stat::histo3d_rgb::operator==");
324 mln_precondition(res1.is_valid());
325 mln_precondition(res2.is_valid());
331 result &= (res1(p1) == res2(p2));
333 trace::exiting(
"mln::accu::stat::histo3d_rgb::operator==");
337 # endif // ! MLN_INCLUDE_ONLY
346 #endif // ! MLN_ACCU_STAT_HISTO3D_RGB_HH