diff --git a/envi/binary.h b/envi/binary.h index 1ee5718..433567d 100644 --- a/envi/binary.h +++ b/envi/binary.h @@ -79,55 +79,38 @@ public: return test_file_size(); } - //DAVE: pass destination pointer as a parameter, make this a boolean function - T * saveZ(unsigned int page){ + //save one band of the file into the memory, and return the pointer + bool saveZ( T * p, unsigned int page){ - T * p; - - if (page > R[2]){ //make sure the bank number is right + if (page >= R[2]){ //make sure the bank number is right std::cout<<"ERROR: page out of range"<R[0]||y<1||y>R[1]){ //make sure the sample and line number is right - cout<<"wrong page"; - getchar(); - return NULL; + 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"<