further aehistograms cleanup

This commit is contained in:
Ingo Weyrich
2020-02-13 16:34:45 +01:00
parent 06be849a31
commit 67ca8e2c19
3 changed files with 0 additions and 51 deletions

View File

@@ -2253,44 +2253,6 @@ bool Thumbnail::writeEmbProfile (const Glib::ustring& fname)
return false;
}
bool Thumbnail::readAEHistogram (const Glib::ustring& fname)
{
FILE* f = g_fopen(fname.c_str(), "rb");
if (!f) {
aeHistogram.reset();
} else {
aeHistogram(65536 >> aeHistCompression);
const size_t histoBytes = (65536 >> aeHistCompression) * sizeof(aeHistogram[0]);
const size_t bytesRead = fread(&aeHistogram[0], 1, histoBytes, f);
fclose (f);
if (bytesRead != histoBytes) {
aeHistogram.reset();
return false;
}
return true;
}
return false;
}
bool Thumbnail::writeAEHistogram (const Glib::ustring& fname)
{
if (aeHistogram) {
FILE* f = g_fopen (fname.c_str (), "wb");
if (f) {
fwrite (&aeHistogram[0], 1, (65536 >> aeHistCompression)*sizeof (aeHistogram[0]), f);
fclose (f);
return true;
}
}
return false;
}
unsigned char* Thumbnail::getImage8Data()
{
if (thumbImg && thumbImg->getType() == rtengine::sImage8) {

View File

@@ -113,10 +113,6 @@ public:
bool readEmbProfile (const Glib::ustring& fname);
bool writeEmbProfile (const Glib::ustring& fname);
bool readAEHistogram (const Glib::ustring& fname);
bool writeAEHistogram (const Glib::ustring& fname);
bool isAeValid() { return aeValid; };
unsigned char* getImage8Data(); // accessor to the 8bit image if it is one, which should be the case for the "Inspector" mode.
// Hombre: ... let's hope that proper template can make this cleaner

View File

@@ -887,11 +887,6 @@ void Thumbnail::_loadThumbnail(bool firstTrial)
}
if ( cfs.thumbImgType == CacheImageData::FULL_THUMBNAIL ) {
if(!tpp->isAeValid()) {
// load aehistogram
tpp->readAEHistogram (getCacheFileName ("aehistograms", ""));
}
// load embedded profile
tpp->readEmbProfile (getCacheFileName ("embprofiles", ".icc"));
@@ -937,10 +932,6 @@ void Thumbnail::_saveThumbnail ()
// save thumbnail image
tpp->writeImage (getCacheFileName ("images", ""));
if(!tpp->isAeValid()) {
// save aehistogram
tpp->writeAEHistogram (getCacheFileName ("aehistograms", ""));
}
// save embedded profile
tpp->writeEmbProfile (getCacheFileName ("embprofiles", ".icc"));