dfmanager cleanup (#6211)
* Turn `DFManager` into a singleton * PIMPL `DFManager` * Cleanup namespace usage in `dfmanager.cc` * Constify `DFManager` interface * Fix bad `reinterpret_cast` between `std::string` and `Glib::ustring` Co-authored-by: Flössie <floessie.mail@gmail.com> Co-authored-by: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "median.h"
|
||||
#include "mytime.h"
|
||||
#include "pdaflinesfilter.h"
|
||||
#include "pixelsmap.h"
|
||||
#include "procparams.h"
|
||||
#include "rawimage.h"
|
||||
#include "rawimagesource_i.h"
|
||||
@@ -41,6 +42,7 @@
|
||||
#include "rt_math.h"
|
||||
#include "rtengine.h"
|
||||
#include "rtlensfun.h"
|
||||
|
||||
#include "../rtgui/options.h"
|
||||
|
||||
#define BENCHMARK
|
||||
@@ -1307,14 +1309,14 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
|
||||
|
||||
|
||||
Glib::ustring newDF = raw.dark_frame;
|
||||
RawImage *rid = nullptr;
|
||||
const RawImage* rid = nullptr;
|
||||
|
||||
if (!raw.df_autoselect) {
|
||||
if (!raw.dark_frame.empty()) {
|
||||
rid = dfm.searchDarkFrame(raw.dark_frame);
|
||||
rid = DFManager::getInstance().searchDarkFrame(raw.dark_frame);
|
||||
}
|
||||
} else {
|
||||
rid = dfm.searchDarkFrame(idata->getMake(), idata->getModel(), idata->getISOSpeed(), idata->getShutterSpeed(), idata->getDateTimeAsTS());
|
||||
rid = DFManager::getInstance().searchDarkFrame(idata->getMake(), idata->getModel(), idata->getISOSpeed(), idata->getShutterSpeed(), idata->getDateTimeAsTS());
|
||||
}
|
||||
|
||||
if (rid && settings->verbose) {
|
||||
@@ -1387,7 +1389,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
|
||||
|
||||
|
||||
// Always correct camera badpixels from .badpixels file
|
||||
std::vector<badPix> *bp = dfm.getBadPixels(ri->get_maker(), ri->get_model(), idata->getSerialNumber());
|
||||
const std::vector<badPix> *bp = DFManager::getInstance().getBadPixels(ri->get_maker(), ri->get_model(), idata->getSerialNumber());
|
||||
|
||||
if (bp) {
|
||||
if (!bitmapBads) {
|
||||
@@ -1405,9 +1407,9 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
|
||||
bp = nullptr;
|
||||
|
||||
if (raw.df_autoselect) {
|
||||
bp = dfm.getHotPixels(idata->getMake(), idata->getModel(), idata->getISOSpeed(), idata->getShutterSpeed(), idata->getDateTimeAsTS());
|
||||
bp = DFManager::getInstance().getHotPixels(idata->getMake(), idata->getModel(), idata->getISOSpeed(), idata->getShutterSpeed(), idata->getDateTimeAsTS());
|
||||
} else if (!raw.dark_frame.empty()) {
|
||||
bp = dfm.getHotPixels(raw.dark_frame);
|
||||
bp = DFManager::getInstance().getHotPixels(raw.dark_frame);
|
||||
}
|
||||
|
||||
if (bp) {
|
||||
@@ -2453,7 +2455,7 @@ void RawImageSource::HLRecovery_Global(const ToneCurveParams &hrp)
|
||||
/* Copy original pixel data and
|
||||
* subtract dark frame (if present) from current image and apply flat field correction (if present)
|
||||
*/
|
||||
void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, RawImage *riDark, RawImage *riFlatFile, array2D<float> &rawData)
|
||||
void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, const RawImage *riDark, RawImage *riFlatFile, array2D<float> &rawData)
|
||||
{
|
||||
const auto tmpfilters = ri->get_filters();
|
||||
ri->set_filters(ri->prefilters); // we need 4 blacks for bayer processing
|
||||
|
Reference in New Issue
Block a user