Clean up clutstore.* and add LRU cache

This commit adds a true LRU cache to `rtengine` which is used in the new
`CLUTStore` class. The code in `clutstore.*` was cleaned up with C++11
features and small optimizations taken from my `clutbench` project.
The `CLUTStore` class was converted to a true singleton.
This commit is contained in:
Flössie
2016-04-16 22:20:18 +02:00
parent e61e488346
commit e495093b18
6 changed files with 476 additions and 472 deletions

View File

@@ -72,7 +72,7 @@ void FilmSimulation::onClutSelected()
if ( getEnabled() && !currentClutFilename.empty() && listener && currentClutFilename != m_oldClutFilename ) {
Glib::ustring clutName, dummy;
splitClutFilename( currentClutFilename, clutName, dummy, dummy );
CLUT::splitClutFilename( currentClutFilename, clutName, dummy, dummy );
listener->panelChanged( EvFilmSimulationFilename, clutName );
m_oldClutFilename = currentClutFilename;
@@ -132,7 +132,7 @@ void FilmSimulation::read( const rtengine::procparams::ProcParams* pp, const Par
if ( !get_inconsistent() && !pp->filmSimulation.enabled ) {
if (options.clutCacheSize == 1) {
clutStore.clearCache();
CLUTStore::getInstance().clearCache();
}
}
@@ -279,7 +279,7 @@ int ClutComboBox::parseDir (const Glib::ustring& path)
for (const auto& entry : entries) {
Glib::ustring name, extension, profileName;
splitClutFilename (entry, name, extension, profileName);
CLUT::splitClutFilename (entry, name, extension, profileName);
extension = extension.casefold ();
if (extension.compare ("tif") != 0 && extension.compare ("png") != 0) {