Exemple #1
0
inline
void tiff_read_and_convert_image( const String& filename
                                , Image& img
                                , CC     cc
                                )
{
    read_and_convert_image( filename
                          , img
                          , cc
                          , tiff_tag()
                          );
}
Exemple #2
0
inline
void tiff_read_and_convert_view( const String& filename
                                 , const View&   view
                                 , CC            cc
                               )
{
    read_and_convert_view( filename
                           , view
                           , cc
                           , tiff_tag()
                         );
}
Exemple #3
0
inline point_t tiff_read_dimensions(String const& filename)
{
    using backend_t = typename get_reader_backend<String, tiff_tag>::type;
    backend_t backend = read_image_info(filename, tiff_tag());
    return { backend._info._width, backend._info._height };
}
Exemple #4
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
}