demonstrates loading a .bmp file via MS Windows system calls without any third party library.
- Author
- woetzel
#include <bias_config.h>
#include <Base/Debug/Error.hh>
#include <Base/Image/ImageBase.hh>
#include <Base/Image/ImageIO.hh>
#include <Base/Common/FileHandling.hh>
#include <iostream>
using namespace std;
using namespace BIAS;
string fn = BIAS_TESTS_DATA "r4_small.bmp";
bool darttest=false;
int parseCmdLine(int argc, char** argv){
if (argc>1) {
if (strcmp(argv[1],"-darttest")==0){
if (argc>2){
darttest=true;
fn=argv[2];
} else {
fn=argv[1];
}
}
}
return 0;
}
int main( int argc, char** argv)
{
if (argc>0)
cout<<"started "<<argv[0]<<endl;
parseCmdLine(argc, argv);
cout<<"file "<<fn<<" does not exists/is unreadable due to file system problems!";
return -1;
}
int res = ImageIO::Import_BITMAP_winapi(fn, img );
if (res==0){
cout<<"successfully loaded "
} else {
cout<<"could not load image from "<<fn<<endl
<<"is it a simple BMP file?"<<endl;
}
#ifdef BIAS_HAVE_OPENCV
if (!darttest)
#endif
return 0;
}