further aehistograms cleanup
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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
|
||||
|
@@ -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"));
|
||||
|
||||
|
Reference in New Issue
Block a user