36 #include <Base/Image/Image.hh>
37 #include <Base/Image/ImageIO.hh>
42 #define HOMGPOINT2D_TYPE double
54 double point[]={2.0, 3.0, 1.0}, point2[3]={0.0, 0.0, 0.0};
56 string filename=
"metadata";
57 string mipfilename=filename+
".mip";
58 string pgmfilename=filename+
".pgm";
69 ascii <<
" [ "<<point[0]<<
" "<<point[1]<<
" "<<point[2]<<
" ]";
70 md->
Add(
"#[HomgPoint2D]", ascii.str());
71 md->
Add(
"#[HomgPoint2D]", ascii.str());
76 BIASERR(
"error writing image "<<filename);
79 BIASERR(
"error exporting image "<<filename);
84 BIASERR(
"error reading image "<<filename<<
".mip");
88 cerr <<
"found "<<md->size()<<
" metadatas in "<<mipfilename<<endl;
93 point2[0]=((HOMGPOINT2D_TYPE *)appdata.
data)[0];
94 point2[1]=((HOMGPOINT2D_TYPE *)appdata.
data)[1];
95 point2[2]=((HOMGPOINT2D_TYPE *)appdata.
data)[2];
96 cout <<
" found MD_HomgPoint2D in "<<filename<<
".mip : [ "
97 <<point2[0]<<
" "<<point2[1]<<
" "<<point2[2]<<
" ]"<<endl;
99 BIASERR(
"MD_HomgPoint2D not found in "<<filename<<
".mip");
103 BIASERR(
"error importing image "<<filename);
107 BIASASSERT(md!=NULL);
108 cerr <<
"found "<<md->size()<<
" metadatas in "<<pgmfilename<<endl;
111 if (md->
Find(
"#[HomgPoint2D]", appdata)!=-1){
112 cout <<
" found ascii in "<<filename<<
".pgm : "
115 BIASERR(
"#[HomgPoint2D] not found in "<<filename<<
".pgm");
std::string stag
the tag as given in ascii meta data
static int ImportImage(const std::string &filename, ImageBase &result)
Try to load/import an image from a file using external libs.
std::string sdata
the data as given in ascii meta data
char * data
pointer to block of data
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
this is a chunk of metadata, also see MetaData