 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
52 ifstream* fimg =
new ifstream(p->
file_name());
53 if ( fimg->fail() )
return -1;
63 while ( !fimg->eof() && !strstr(aline,
"COMMENT") ) {
65 value = strchr(aline,
'=');
66 if ( value ) value += 1;
67 if ( strstr(aline,
"HEADER") )
68 sscanf(value,
"%ld", &offset);
69 if ( strstr(aline,
"YPIXEL") )
70 sscanf(value,
"%ld", &x);
71 if ( strstr(aline,
"XPIXEL") )
72 sscanf(value,
"%ld", &y);
73 if ( strstr(aline,
"BYTE PER PIXEL") )
74 sscanf(value,
"%d", &bpp);
75 if ( strstr(aline,
"XRESOLUTION") )
76 sscanf(value,
"%lf", &sampling[0]);
77 if ( strstr(aline,
"YRESOLUTION") )
78 sscanf(value,
"%lf", &sampling[1]);
83 while ( !fimg->eof() && strchr(aline,
'\n') ) {
99 if ( fimg->fail() )
return -3;
123 char* header =
new char[
IPSIZE];
124 memset(header, 0,
IPSIZE);
130 snprintf(header,
IPSIZE,
"DITABIS micron Data File\r\n"
135 "BYTE PER PIXEL = %ld\r\n"
136 "XRESOLUTION = %g\r\n"
137 "YRESOLUTION = %g\r\n"
138 "THUMB-NAIL-ZOOM = 10\r\n"
139 "MAGNIFICATION = 1\r\n"
141 "OFFSET CORRECTION = NO\r\n"
153 if ( fimg.fail() )
return -1;
SysType systype(int show)
Finds the system type - mostly just for byte order.
Vector3< long > size() const
long data_type_size() const
Returns the size of the datatype in bytes.
void swapbytes(unsigned char *v, size_t n)
Swaps bytes.
Header file for reading and writing image plate reader files.
General image parameter class.
unsigned char * data_alloc()
Header file for general utilities.
int writeIP(Bimage *p)
Writing an image plate reader file format.
int readIP(Bimage *p, int readdata)
Reading an image plate reader file format.
void change_type(char letter)
Get the data type indicated by a single letter code.
unsigned char * data_pointer()
void sampling(long nn, Vector3< double > u)