#ifndef IMG_INFO_H_ #define IMG_INFO_H_ // functions that extrapolate information from read-only images namespace img { template inline ScalarType minValue(const Image &image) { assert(image.isValid()); if(Safe){ if(!image.isValid()) throw ImageException("Invalid image"); } ScalarType* array = image.dataValues(); int length =image.dataValuesSize(); ScalarType min = array[0]; for(int offset=0;offset array[offset]) min = array[offset]; return min; } template inline ScalarType maxValue(const Image &image) { assert(image.isValid()); if(Safe){ if(!image.isValid()) throw ImageException("Invalid image"); } ScalarType* array = image.dataValues(); int length =image.dataValuesSize(); ScalarType max = array[0]; for(int offset=0;offset