Ejemplo n.º 1
0
inline
void pnm_read_image( const String& filename
                     , Image&        img
                   )
{
    read_image( filename
                , img
                , pnm_tag()
              );
}
Ejemplo n.º 2
0
inline
void pnm_read_view( const String& filename
                    , const View&   view
                  )
{
    read_view( filename
               , view
               , pnm_tag()
             );
}
Ejemplo n.º 3
0
inline
void pnm_write_view( const String& filename
                     , const View&   view
                   )
{
    write_view( filename
                , view
                , pnm_tag()
              );
}
Ejemplo n.º 4
0
inline
void pnm_read_and_convert_image( const String filename
                                 , Image&       img
                               )
{
    read_and_convert_image( filename
                            , img
                            , pnm_tag()
                          );
}
Ejemplo n.º 5
0
inline
void pnm_read_and_convert_view( const String& filename
                                , const View&   view
                                , CC            cc
                              )
{
    read_and_convert_view( filename
                           , view
                           , cc
                           , pnm_tag()
                         );
}
Ejemplo n.º 6
0
inline
point2< std::ptrdiff_t > pnm_read_dimensions( const String& filename )
{
    typedef typename get_reader_backend< String
    , pnm_tag
    >::type backend_t;

    backend_t backend = read_image_info( filename
                                         , pnm_tag()
                                       );

    return point2< std::ptrdiff_t >( backend._info._width
                                     , backend._info._height
                                   );
}
Ejemplo n.º 7
0
inline
void read_image( const String&    file_name
               , Image&           img
               , typename enable_if< detail::is_supported_path_spec< String >
                                   >::type* /* ptr */ = 0
               )
{
    namespace fs = boost::filesystem;
    namespace al = boost::algorithm;

    fs::path in_path = fs::system_complete( fs::path( file_name, fs::native ));
    
#ifdef BOOST_GIL_EXTENSION_IO_BMP_READ_ENABLED

    if( al::to_upper( fs::extension( in_path )) == ".BMP" )
    {
        read_image( file_name
                  , img
                  , bmp_tag()
                  );

        return;
    }

#endif // BOOST_GIL_EXTENSION_IO_BMP_READ_ENABLED


#ifdef BOOST_GIL_EXTENSION_IO_JPEG_READ_ENABLED

    if( fs::extension( in_path ) == ".JPG" )
    {
        read_image( file_name
                  , img
                  , jpeg_tag()
                  );

        return ;
    }

#endif // BOOST_GIL_EXTENSION_IO_JPEG_READ_ENABLED

#ifdef BOOST_GIL_EXTENSION_IO_PNG_READ_ENABLED

    if( fs::extension( in_path ) == ".PNG" )
    {
        read_image( file_name
                  , img
                  , png_tag()
                  );

        return ;
    }

#endif // BOOST_GIL_EXTENSION_IO_PNG_READ_ENABLED

#ifdef BOOST_GIL_EXTENSION_IO_PNM_READ_ENABLED

    if( fs::extension( in_path ) == ".PNM" )
    {
        read_image( file_name
                  , img
                  , pnm_tag()
                  );

        return ;
    }

#endif // BOOST_GIL_EXTENSION_IO_PNM_READ_ENABLED

#ifdef BOOST_GIL_EXTENSION_IO_TIFF_READ_ENABLED

    if( fs::extension( in_path ) == ".TIF" )
    {
        read_image( file_name
                  , img
                  , tiff_tag()
                  );

        return ;
    }

#endif // BOOST_GIL_EXTENSION_IO_JPEG_READ_ENABLED
}