95 geox geo reference x of upper left point (
float >0)
96 geoy geo reference y of upper left point (
float >0)
97 resx horizontal resolution (pixel distance) in meters (
float >0)
98 resy vertical resolution (pixel distance) in meters (
float >0)
99 hstep factor by which pixel values have to be multiplied to obtain real height in meters (
float >0)
102 An int16 file contains a sequence of sizex*sizey height values, advancing from west to east and from north to south. Each pixel consists of a 16 bit integer where the lower byte comes first in sequence (i.e., pixel value is byte[i]+byte[i+1]*256).
103 There is no file header, pixels start immediately at the beginning.
105 Points are defined as follows for pixel position (i,j) in file (starting with (0/0):
106 geo position x = geox + i*resx
107 geo position y = geoy + j*resy
108 height = ( byte[ 2*i + 2*j*sizex] + byte[ 2*i + 2*j*sizex + 1] * 256 ) * hstep
110 where / denotes integer division
112 class r_Conv_int16 : public r_Convertor
116 static const r_Double NULL_DB;
117 static const r_Double ZERO_DB;
118 static const r_Double ZERO_int16;
124 r_Double startx, endx, resx;
125 r_Double starty, endy, resy;
126 r_ULong flipy, flipx;
129 r_Conv_int16(
const char* source,
const r_Minterval& lengthordomain,
const r_Type* tp)
throw(r_Error);
131 r_Conv_int16(
const char* source,
const r_Minterval& lengthordomain,
int tp)
throw(r_Error);
133 r_convDesc& convertFrom(
const char* options = NULL) throw (r_Error);
135 r_convDesc& convertTo(const
char* options = NULL) throw (r_Error);
137 const
char* get_name() const throw();
139 r_Data_Format get_data_format() const throw();
141 r_Convertor* clone() const throw(r_Error);
144 static const r_Dimension srcIntervDim;
147 static const r_Dimension destIntervDim;
150 static
bool decodeOptions( const
char* options,
151 r_GeoBBox& collBBox) throw();
154 static
string encodeOptions(const r_GeoBBox& collBBox) throw();
157 virtual ~r_Conv_int16(
void );
160 static
void initGeoBBox( r_GeoBBox& cBBox );
166 void checkLimits() throw(r_Error);
169 void readFromSrcStream() throw(r_Error);
170 void readToSrcStream() throw(r_Error);
171 void writeFromDestStream() throw(r_Error);
172 void writeToDestStream(ofstream& oFile) throw(r_Error);
178 static const r_ULong paramMin;
179 static const
char* paramSep;
180 static const
char* paramEq;
181 static const
char* paramFlipX;
182 static const
char* paramFlipY;
183 static const
char* paramStartX;
184 static const
char* paramEndX;
185 static const
char* paramResX;
186 static const
char* paramStartY;
187 static const
char* paramEndY;
188 static const
char* paramResY;
198 typedef vector<int16Row> int16RowVec;