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_IO_PPM_LOAD_HH
00027 # define MLN_IO_PPM_LOAD_HH
00028 
00033 
00034 # include <iostream>
00035 # include <fstream>
00036 # include <string>
00037 
00038 # include <mln/core/image/image2d.hh>
00039 # include <mln/core/image/image3d.hh>
00040 # include <mln/value/rgb8.hh>
00041 
00042 # include <mln/io/pnm/load.hh>
00043 
00044 
00045 namespace mln
00046 {
00047 
00048   namespace io
00049   {
00050 
00051     namespace ppm
00052     {
00053 
00059       template <typename I>
00060       void load(Image<I>& ima,
00061                 const std::string& filename);
00062 
00071       template <typename V>
00072       image2d<V> load(const std::string& filename);
00073 
00074 
00075 # ifndef MLN_INCLUDE_ONLY
00076 
00077       template <typename V>
00078       inline
00079       image2d<V> load(const std::string& filename)
00080       {
00081         trace::entering("mln::io::ppm::load");
00082         image2d<V> ima = io::pnm::load<V>(PPM, filename);
00083         trace::exiting("mln::io::ppm::load");
00084         return ima;
00085       }
00086 
00087       template <typename I>
00088       inline
00089       void load(Image<I>& ima,
00090                 const std::string& filename)
00091       {
00092         trace::entering("mln::io::ppm::load");
00093         io::pnm::load<I>(PPM, ima, filename);
00094         trace::exiting("mln::io::ppm::load");
00095       }
00096 
00097 
00098 # endif // ! MLN_INCLUDE_ONLY
00099 
00100     } 
00101 
00102   } 
00103 
00104 } 
00105 
00106 
00107 #endif // ! MLN_IO_PPM_LOAD_HH