Improve performance of histogram/waveform updates

Only perform calculations for the currently shown scope.
Cache the waveform so it can be reused when the scope is resized.
Increase speed of waveform rendering.
This commit is contained in:
Lawrence Lee
2020-07-26 13:27:17 -07:00
parent 99b7a557c9
commit 6df69b3786
7 changed files with 228 additions and 69 deletions

View File

@@ -54,7 +54,7 @@ class Crop;
* but using this class' LUT and other precomputed parameters. The main preview area is displaying a non framed Crop object,
* while detail windows are framed Crop objects.
*/
class ImProcCoordinator final : public StagedImageProcessor
class ImProcCoordinator final : public StagedImageProcessor, public HistogramObservable
{
friend class Crop;
@@ -199,6 +199,7 @@ protected:
MyMutex minit; // to gain mutually exclusive access to ... to what exactly?
void notifyHistogramChanged();
void reallocAll();
void updateLRGBHistograms();
void updateWaveforms();
@@ -454,7 +455,11 @@ public:
}
void setHistogramListener (HistogramListener *h) override
{
if (hListener) {
hListener->setObservable(nullptr);
}
hListener = h;
h->setObservable(this);
}
void setAutoCamListener (AutoCamListener* acl) override
{
@@ -555,6 +560,8 @@ public:
} denoiseInfoStore;
void updateHistogram() override;
void updateWaveform() override;
};
}