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