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 #ifndef MLN_DEBUG_PRINTLN_HH
00027 # define MLN_DEBUG_PRINTLN_HH
00028
00034
00035 # include <mln/core/concept/image.hh>
00036 # include <mln/core/concept/window.hh>
00037 # include <mln/geom/bbox.hh>
00038 # include <mln/debug/quiet.hh>
00039 # include <mln/debug/format.hh>
00040
00041
00042 # include <mln/debug/println.spe.hh>
00043
00044
00045 namespace mln
00046 {
00047
00048 namespace debug
00049 {
00050
00052 template <typename I>
00053 void println(const Image<I>& input);
00054
00057 template <typename I>
00058 void println(const std::string& msg, const Image<I>& input);
00059
00060
00061 # ifndef MLN_INCLUDE_ONLY
00062
00063 namespace impl
00064 {
00065
00066
00067 template <typename S, typename I>
00068 inline
00069 void
00070 println(const S&, const Image<I>& input_)
00071 {
00072 const I& input = exact(input_);
00073 mln_piter(I) p(input.domain());
00074 for_all(p)
00075 std::cout << format(input(p)) << ' ';
00076 std::cout << std::endl;
00077 }
00078
00079 }
00080
00081
00082
00083
00084 template <typename I>
00085 inline
00086 void
00087 println(const Image<I>& input)
00088 {
00089 trace::entering("debug::println");
00090
00091 if (!quiet)
00092 impl::println(geom::bbox(exact(input).domain()),
00093 exact(input));
00094 trace::exiting("debug::println");
00095 }
00096
00097 template <typename I>
00098 void println(const std::string& msg, const Image<I>& input)
00099 {
00100 if (!quiet)
00101 {
00102 std::cout << msg << std::endl;
00103 println(input);
00104 }
00105 }
00106
00107 # endif // ! MLN_INCLUDE_ONLY
00108
00109 }
00110
00111 }
00112
00113
00114 #endif // ! MLN_DEBUG_PRINTLN_HH