Skip to content
Snippets Groups Projects
Commit 62b02e58 authored by Andreas Schenk's avatar Andreas Schenk
Browse files

added more file formats to img io tests

parent 0ac6e36e
Branches
No related tags found
No related merge requests found
......@@ -22,6 +22,8 @@
#include <ost/img/alg/randomize.hh>
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <ost/io/img/map_io_df3_handler.hh>
#include <ost/io/img/map_io_dat_handler.hh>
#include <ost/io/img/map_io_dx_handler.hh>
#include <ost/io/img/map_io_spi_handler.hh>
#include <ost/io/img/map_io_mrc_handler.hh>
......@@ -49,6 +51,9 @@ BOOST_AUTO_TEST_CASE(test_io_img)
testimage+=0.01; //if all values are > 0.0 we can use close_at_tolerance
const String fname("temp_img.tmp");
std::map<String,ImageFormatBase*> float_formats;
float_formats["DX"]=new DX;
float_formats["Situs"]=new Situs;
float_formats["DAT (float)"]=new DAT(false,OST_FLOAT_FORMAT);
float_formats["CCP4 (float)"]=new MRC;
float_formats["MRC (float)"]=new MRC(false,MRC_OLD_FORMAT);
float_formats["SPIDER"]= new Spider;
......@@ -68,12 +73,13 @@ BOOST_AUTO_TEST_CASE(test_io_img)
}
}
if(failed){
BOOST_ERROR("Image IO failed for plugin " << it->first << "at point " << ost::img::Point(eit)<< ". The values are: " << testimage.GetReal(eit)<< ","<< loadedimage.GetReal(eit) );
BOOST_ERROR("Image IO failed for plugin " << it->first << " at point " << ost::img::Point(eit)<< ". The values are: " << testimage.GetReal(eit)<< ","<< loadedimage.GetReal(eit) );
}
delete it->second;
}
//int 16 formats
std::map<String,ImageFormatBase*> int_formats;
int_formats["DAT (16 bit)"]=new DAT(true,OST_BIT16_FORMAT);
int_formats["TIF (16 bit)"]=new TIF;
int_formats["JPK (16 bit)"]=new JPK;
for(std::map<String,ImageFormatBase*>::iterator it=int_formats.begin();it!=int_formats.end();++it){
......@@ -97,7 +103,9 @@ BOOST_AUTO_TEST_CASE(test_io_img)
//byte formats
std::map<String,ImageFormatBase*> byte_formats;
byte_formats["DAT (byte)"]=new DAT(true,OST_BIT8_FORMAT);
byte_formats["PNG"]=new PNG;
byte_formats["DF3"]=new DF3;
byte_formats["JPK (byte)"]= new JPK(false,OST_BIT8_FORMAT);
byte_formats["TIF (byte)"]= new TIF(false,OST_BIT8_FORMAT);
for(std::map<String,ImageFormatBase*>::iterator it=byte_formats.begin();it!=byte_formats.end();++it){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment