diff --git a/envi/bil.h b/envi/bil.h index c9cf38f..6b0ef9b 100644 --- a/envi/bil.h +++ b/envi/bil.h @@ -54,7 +54,7 @@ public: return true; } - bool getBand( T * p, double wavelength){ + bool band( T * p, double wavelength){ unsigned int XY = R[0] * R[1]; //calculate the number of pixels in a band unsigned int S = XY * sizeof(T); //calculate the number of bytes of a band @@ -147,7 +147,7 @@ public: } //save one pixel of the BIP file into the memory, and return the pointer - bool getSpectrum(T * p, unsigned x, unsigned y){ + bool spectrum(T * p, unsigned x, unsigned y){ if ( x >= R[0] || y >= R[1]){ //make sure the sample and line number is right std::cout<<"ERROR: sample or line out of range"<= R[0] || y >= R[1]){ //make sure the sample and line number is right std::cout<<"ERROR: sample or line out of range"< n; - if(n.bil::open(temp, R[0], R[1], R[2], offset, w)==false){ //open infile + if(n.open(temp, R[0], R[1], R[2], offset, w)==false){ //open infile std::cout<<"ERROR: unable to open input file"<::getSlice; using binary::R; - //open a file, given the file and its header's names + //open a file, given the file name and dimensions bool open(std::string filename, unsigned int X, unsigned int Y, unsigned int B, unsigned int header_offset, std::vector wavelengths){ - /*if (header.load(headername)==false){ - std::cout<<"ERROR: unable to load header file: "<= R[2]){ //make sure the bank number is right @@ -59,7 +54,8 @@ public: return true; } - bool getBand( T * p, double wavelength){ + //retrieve one band (specified by the wavelength) + bool band( T * p, double wavelength){ unsigned int XY = R[0] * R[1]; //calculate the number of pixels in a band @@ -104,7 +100,7 @@ public: } //save one pixel of the file into the memory, and return the pointer - bool getSpectrum(T * p, unsigned x, unsigned y){ + bool spectrum(T * p, unsigned x, unsigned y){ unsigned int i; @@ -168,11 +164,11 @@ public: //else get the low band else{ control += 1; - getBand(a, ai); + band(a, ai); bi = wls[control]; } //get the high band - getBand(b, bi); + band(b, bi); //correct every band for(unsigned cii = 0; cii < B; cii++){ @@ -188,7 +184,7 @@ public: ai = bi; bi = wls[control]; - getBand(b, bi); + band(b, bi); } //if the last BL point on the last band of the file? @@ -227,7 +223,7 @@ public: } // normalize the BSQ file - bool normalize(std::string outname, double band) + bool normalize(std::string outname, double w) { unsigned int B = R[2]; //calculate the number of bands unsigned int XY = R[0] * R[1]; //calculate the number of pixels in a band @@ -242,7 +238,7 @@ public: b = (T*)malloc( S ); //memory allocation c = (T*)malloc( S ); - getBand(b, band); //get the certain band into memory + band(b, w); //get the certain band into memory for(unsigned j = 0; j < B; j++) { @@ -271,7 +267,7 @@ public: bil(temp); rts::bil n; - if(n.bil::open(temp, R[0], R[1], R[2], offset, w)==false){ //open infile + if(n.open(temp, R[0], R[1], R[2], offset, w)==false){ //open infile std::cout<<"ERROR: unable to open input file"<