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:
@@ -1640,31 +1640,13 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
|
||||
if (hListener) {
|
||||
updateLRGBHistograms();
|
||||
updateWaveforms();
|
||||
hListener->histogramChanged(
|
||||
histRed,
|
||||
histGreen,
|
||||
histBlue,
|
||||
histLuma,
|
||||
histToneCurve,
|
||||
histLCurve,
|
||||
histCCurve,
|
||||
/*histCLurve,
|
||||
* histLLCurve,*/
|
||||
histLCAM,
|
||||
histCCAM,
|
||||
histRedRaw,
|
||||
histGreenRaw,
|
||||
histBlueRaw,
|
||||
histChroma,
|
||||
histLRETI,
|
||||
waveformScale,
|
||||
waveformWidth,
|
||||
waveformRed.get(),
|
||||
waveformGreen.get(),
|
||||
waveformBlue.get()
|
||||
);
|
||||
if (hListener->updateHistogram()) {
|
||||
updateLRGBHistograms();
|
||||
}
|
||||
if (hListener->updateWaveform()) {
|
||||
updateWaveforms();
|
||||
}
|
||||
notifyHistogramChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1765,6 +1747,33 @@ void ImProcCoordinator::setScale(int prevscale)
|
||||
}
|
||||
|
||||
|
||||
void ImProcCoordinator::notifyHistogramChanged()
|
||||
{
|
||||
if (hListener) {
|
||||
hListener->histogramChanged(
|
||||
histRed,
|
||||
histGreen,
|
||||
histBlue,
|
||||
histLuma,
|
||||
histToneCurve,
|
||||
histLCurve,
|
||||
histCCurve,
|
||||
histLCAM,
|
||||
histCCAM,
|
||||
histRedRaw,
|
||||
histGreenRaw,
|
||||
histBlueRaw,
|
||||
histChroma,
|
||||
histLRETI,
|
||||
waveformScale,
|
||||
waveformWidth,
|
||||
waveformRed.get(),
|
||||
waveformGreen.get(),
|
||||
waveformBlue.get()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcCoordinator::updateLRGBHistograms()
|
||||
{
|
||||
|
||||
@@ -2305,4 +2314,20 @@ void ImProcCoordinator::setHighQualComputed()
|
||||
highQualityComputed = true;
|
||||
}
|
||||
|
||||
void ImProcCoordinator::updateWaveform()
|
||||
{
|
||||
if (hListener) {
|
||||
updateWaveforms();
|
||||
notifyHistogramChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcCoordinator::updateHistogram()
|
||||
{
|
||||
if (hListener) {
|
||||
updateLRGBHistograms();
|
||||
notifyHistogramChanged();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user