bool BMP::readImage(const std::string &pathname) { std::ifstream imageFile(pathname.c_str(),std::ios::binary); /*Read Header Info*/ imageFile>>_signatureImage[0]>>_signatureImage[1]; imageFile.read((char*)&_sizeImage,sizeof(_sizeImage)); imageFile.read((char*)&_reservedImage[0],sizeof(_reservedImage[0])); imageFile.read((char*)&_reservedImage[1],sizeof(_reservedImage[0])); imageFile.read((char*)&_offsetImage,sizeof(_offsetImage)); imageFile.read((char*)&_sizeHeaderImage,sizeof(_sizeHeaderImage)); imageFile.read((char*)&_widthImage,sizeof(_widthImage)); imageFile.read((char*)&_heightImage,sizeof(_heightImage)); imageFile.read((char*)&_numberPlanesImage,sizeof(short int)); imageFile.read((char*)&_bitsPerPixelImage,sizeof(_bitsPerPixelImage)); imageFile.read((char*)&_compressionImage,sizeof(_compressionImage)); imageFile.read((char*)&_sizepixelImage,sizeof(_sizepixelImage)); imageFile.read((char*)&_horizontalResolutionImage,sizeof(_horizontalResolutionImage)); imageFile.read((char*)&_verticalResolutionImage,sizeof(_verticalResolutionImage)); imageFile.read((char*)&_numberColorsImage,sizeof(_numberColorsImage)); imageFile.read((char*)&_numberImportantColorImage,sizeof(_numberImportantColorImage)); imageFile.close(); switch(_bitsPerPixelImage) { case 8: return read8bits(); break; case 24: return read24bits(); break; default: std::cout<<"Format not working with this application"<<std::endl; break; } return false; }
long ADE7758::getInterruptStatus(void){ return read24bits(STATUS); }
long ADE7758::getVRMS(char phase) { return read24bits(AVRMS+phase); }