From 6cd87ad975d4be08a77b418ce44c905da2180656 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Sun, 9 Aug 2020 16:49:28 -0700 Subject: [PATCH] Use array2D for waveform and vectorscopes --- rtengine/improccoordinator.cc | 68 +++++++++-------- rtengine/improccoordinator.h | 8 +- rtengine/rtengine.h | 16 ++-- rtgui/editorpanel.cc | 14 ++-- rtgui/editorpanel.h | 17 +++-- rtgui/histogrampanel.cc | 139 +++++++++++++++++++--------------- rtgui/histogrampanel.h | 36 ++++----- 7 files changed, 160 insertions(+), 138 deletions(-) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 82527d530..3609617be 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -23,6 +23,7 @@ #include "improccoordinator.h" +#include "array2D.h" #include "cieimage.h" #include "color.h" #include "colortemp.h" @@ -47,6 +48,9 @@ namespace { + +constexpr int VECTORSCOPE_SIZE = 128; + using rtengine::Coord2D; Coord2D translateCoord(const rtengine::ImProcFunctions& ipf, int fw, int fh, int x, int y) { @@ -129,7 +133,11 @@ ImProcCoordinator::ImProcCoordinator() : histLRETI(256), - waveformWidth(0), + vectorscope(VECTORSCOPE_SIZE, VECTORSCOPE_SIZE), + waveformRed(0, 0), + waveformGreen(0, 0), + waveformBlue(0, 0), + waveformLuma(0, 0), CAMBrightCurveJ(), CAMBrightCurveQ(), @@ -1771,11 +1779,10 @@ void ImProcCoordinator::notifyHistogramChanged() vectorscopeScale, vectorscope, waveformScale, - waveformWidth, - waveformRed.get(), - waveformGreen.get(), - waveformBlue.get(), - waveformLuma.get() + waveformRed, + waveformGreen, + waveformBlue, + waveformLuma ); } } @@ -1850,8 +1857,8 @@ void ImProcCoordinator::updateVectorscope() int x1, y1, x2, y2; params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); - constexpr int size = HistogramListener::vectorscope_size; - memset(vectorscope, 0, size * size * sizeof(vectorscope[0][0])); + constexpr int size = VECTORSCOPE_SIZE; + memset((int*)vectorscope, 0, size * size * sizeof(vectorscope[0][0])); const int lab_img_size = (hListener->vectorscopeType() == 1) ? (x2 - x1) * (y2 - y1) : 0; float L[lab_img_size], a[lab_img_size], b[lab_img_size]; @@ -1901,43 +1908,44 @@ void ImProcCoordinator::updateVectorscope() void ImProcCoordinator::updateWaveforms() { if (!workimg) { - waveformWidth = 0; + // Resize to zero. + waveformRed(0, 0); + waveformGreen(0, 0); + waveformBlue(0, 0); + waveformLuma(0, 0); return; } int x1, y1, x2, y2; params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); + int waveform_width = waveformRed.getWidth(); - if (waveformWidth != x2 - x1) { + if (waveform_width != x2 - x1) { // Resize waveform arrays. - waveformWidth = x2 - x1; - waveformRed.reset(new int[waveformWidth][256]); - waveformGreen.reset(new int[waveformWidth][256]); - waveformBlue.reset(new int[waveformWidth][256]); - waveformLuma.reset(new int[waveformWidth][256]); + waveform_width = x2 - x1; + waveformRed(waveform_width, 256); + waveformGreen(waveform_width, 256); + waveformBlue(waveform_width, 256); + waveformLuma(waveform_width, 256); } - int (*red)[256] = waveformRed.get(); - int (*green)[256] = waveformGreen.get(); - int (*blue)[256] = waveformBlue.get(); - int (*luma)[256] = waveformLuma.get(); - // Start with zero. - const int waveformSize = 256 * waveformWidth; - memset(waveformRed.get(), 0, waveformSize * sizeof(red[0][0])); - memset(waveformGreen.get(), 0, waveformSize * sizeof(green[0][0])); - memset(waveformBlue.get(), 0, waveformSize * sizeof(blue[0][0])); - memset(waveformLuma.get(), 0, waveformSize * sizeof(luma[0][0])); + const int waveformSize = 256 * waveform_width; + memset((int*)waveformRed, 0, waveformSize * sizeof(waveformRed[0][0])); + memset((int*)waveformGreen, 0, waveformSize * sizeof(waveformGreen[0][0])); + memset((int*)waveformBlue, 0, waveformSize * sizeof(waveformBlue[0][0])); + memset((int*)waveformLuma, 0, waveformSize * sizeof(waveformLuma[0][0])); constexpr float luma_factor = 255.f / 32768.f; for (int i = y1; i < y2; i++) { int ofs = (i * pW + x1) * 3; + float* L_row = nprevl->L[i] + x1; - for (int j = 0; j < waveformWidth; j++) { - red[j][workimg->data[ofs++]]++; - green[j][workimg->data[ofs++]]++; - blue[j][workimg->data[ofs++]]++; - luma[j][(int)(nprevl->L[i][j + x1] * luma_factor)]++; + for (int j = 0; j < waveform_width; j++) { + waveformRed[workimg->data[ofs++]][j]++; + waveformGreen[workimg->data[ofs++]][j]++; + waveformBlue[workimg->data[ofs++]][j]++; + waveformLuma[LIM(L_row[j] * luma_factor, 0, 255)][j]++; } } diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 5eeef3e9e..8a112b270 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -127,14 +127,10 @@ protected: LUTu histLuma, histToneCurve, histToneCurveBW, histLCurve, histCCurve; LUTu histLLCurve, histLCAM, histCCAM, histClad, bcabhist, histChroma, histLRETI; int vectorscopeScale; - int vectorscope[HistogramListener::vectorscope_size][HistogramListener::vectorscope_size]; + array2D vectorscope; /// Waveform's intensity. Same as height of reference image. int waveformScale; - int waveformWidth; - std::unique_ptr waveformRed, waveformRedRaw; - std::unique_ptr waveformGreen, waveformGreenRaw; - std::unique_ptr waveformBlue, waveformBlueRaw; - std::unique_ptr waveformLuma; + array2D waveformRed, waveformGreen, waveformBlue, waveformLuma; LUTf CAMBrightCurveJ, CAMBrightCurveQ; diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index aa5e6aed7..9c4092f2b 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -42,6 +42,9 @@ * */ +template +class array2D; + template class LUT; @@ -308,8 +311,6 @@ class HistogramObservable; class HistogramListener { public: - static constexpr int vectorscope_size = 128; - virtual ~HistogramListener() = default; /** This member function is called when the histogram of the final image has changed. * @param histRed is the array of size 256 containing the histogram of the red channel @@ -333,13 +334,12 @@ public: const LUTu& histChroma, const LUTu& histLRETI, int vectorscopeScale, - const int vectorscope[vectorscope_size][vectorscope_size], + const array2D& vectorscope, int waveformScale, - int waveformWidth, - const int waveformRed[][256], - const int waveformGreen[][256], - const int waveformBlue[][256], - const int waveformLuma[][256] + const array2D& waveformRed, + const array2D& waveformGreen, + const array2D& waveformBlue, + const array2D& waveformLuma ) = 0; /** Tells which observable is notifying the listener. */ virtual void setObservable(HistogramObservable* observable) = 0; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 2d3099727..7f5c99997 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -21,6 +21,7 @@ #include +#include "../rtengine/array2D.h" #include "../rtengine/imagesource.h" #include "../rtengine/iccstore.h" #include "batchqueue.h" @@ -2248,17 +2249,16 @@ void EditorPanel::histogramChanged( const LUTu& histChroma, const LUTu& histLRETI, int vectorscopeScale, - const int vectorscope[HistogramListener::vectorscope_size][HistogramListener::vectorscope_size], + const array2D& vectorscope, int waveformScale, - int waveformWidth, - const int waveformRed[][256], - const int waveformGreen[][256], - const int waveformBlue[][256], - const int waveformLuma[][256] + const array2D& waveformRed, + const array2D& waveformGreen, + const array2D& waveformBlue, + const array2D& waveformLuma ) { if (histogramPanel) { - histogramPanel->histogramChanged(histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw, vectorscopeScale, vectorscope, waveformScale, waveformWidth, waveformRed, waveformGreen, waveformBlue, waveformLuma); + histogramPanel->histogramChanged(histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw, vectorscopeScale, vectorscope, waveformScale, waveformRed, waveformGreen, waveformBlue, waveformLuma); } tpc->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index ed34c1931..2916dc822 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -32,6 +32,12 @@ #include "../rtengine/noncopyable.h" #include "../rtengine/rtengine.h" +namespace rtengine +{ +template +class array2D; +} + class BatchQueueEntry; class EditorPanel; class FilePanel; @@ -129,13 +135,12 @@ public: const LUTu& histChroma, const LUTu& histLRETI, int vectorscopeScale, - const int vectorscope[HistogramListener::vectorscope_size][HistogramListener::vectorscope_size], + const array2D& vectorscope, int waveformScale, - int waveformWidth, - const int waveformRed[][256], - const int waveformGreen[][256], - const int waveformBlue[][256], - const int waveformLuma[][256] + const array2D& waveformRed, + const array2D& waveformGreen, + const array2D& waveformBlue, + const array2D& waveformLuma ) override; void setObservable(rtengine::HistogramObservable* observable) override; bool updateHistogram(void) override; diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 06a0b912c..416a114fd 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -22,6 +22,7 @@ #include "options.h" #include #include +#include "../rtengine/array2D.h" #include "../rtengine/LUT.h" #include "rtimage.h" #include "../rtengine/color.h" @@ -885,7 +886,10 @@ void HistogramRGBAreaVert::get_preferred_width_for_height_vfunc (int height, int // // HistogramArea HistogramArea::HistogramArea (DrawModeListener *fml) : - waveform_width(0), wave_buffer_dirty(true), + vect(0, 0), + vect_buffer_dirty(true), vect_buffer_size(0), + rwave(0, 0), gwave(0, 0),bwave(0, 0), lwave(0, 0), + wave_buffer_dirty(true), valid(false), drawMode(options.histogramDrawMode), myDrawModeListener(fml), scopeType(options.histogramScopeType), oldwidth(-1), oldheight(-1), @@ -902,9 +906,6 @@ HistogramArea::HistogramArea (DrawModeListener *fml) : lhist(256); chist(256); - const int vect_size = VECTORSCOPE_SIZE * Cairo::ImageSurface::format_stride_for_width(Cairo::FORMAT_ARGB32, VECTORSCOPE_SIZE); - vect_buffer.reset(new unsigned char[vect_size]); - get_style_context()->add_class("drawingarea"); set_name("HistogramArea"); @@ -983,13 +984,12 @@ void HistogramArea::update( const LUTu& histGreenRaw, const LUTu& histBlueRaw, int vectorscopeScale, - const int vectorscope[VECTORSCOPE_SIZE][VECTORSCOPE_SIZE], + const array2D& vectorscope, int waveformScale, - int waveformWidth, - const int waveformRed[][256], - const int waveformGreen[][256], - const int waveformBlue[][256], - const int waveformLuma[][256] + const array2D& waveformRed, + const array2D& waveformGreen, + const array2D& waveformBlue, + const array2D& waveformLuma ) { if (histRed) { @@ -1003,27 +1003,26 @@ void HistogramArea::update( ghistRaw = histGreenRaw; bhistRaw = histBlueRaw; } else if (scopeType == 1) { + const int wave_width = waveformRed.getWidth(); + const int wave_height = waveformRed.getHeight(); waveform_scale = waveformScale; - if (waveform_width != waveformWidth) { - waveform_width = waveformWidth; - rwave.reset(new int[waveformWidth][256]); - gwave.reset(new int[waveformWidth][256]); - bwave.reset(new int[waveformWidth][256]); - lwave.reset(new int[waveformWidth][256]); + if (wave_width != rwave.getWidth() || wave_height != rwave.getHeight()) { + rwave(wave_width, wave_height); + gwave(wave_width, wave_height); + bwave(wave_width, wave_height); + lwave(wave_width, wave_height); } - int (* const rw)[256] = rwave.get(); - int (* const gw)[256] = gwave.get(); - int (* const bw)[256] = bwave.get(); - int (* const lw)[256] = lwave.get(); - memcpy(rw, waveformRed, 256 * waveformWidth * sizeof(rw[0][0])); - memcpy(gw, waveformGreen, 256 * waveformWidth * sizeof(gw[0][0])); - memcpy(bw, waveformBlue, 256 * waveformWidth * sizeof(bw[0][0])); - memcpy(lw, waveformLuma, 256 * waveformWidth * sizeof(lw[0][0])); + memcpy((int*)rwave, (const int*)waveformRed, wave_height * wave_width * sizeof(rwave[0][0])); + memcpy((int*)gwave, (const int*)waveformGreen, wave_height * wave_width * sizeof(gwave[0][0])); + memcpy((int*)bwave, (const int*)waveformBlue, wave_height * wave_width * sizeof(bwave[0][0])); + memcpy((int*)lwave, (const int*)waveformLuma, wave_height * wave_width * sizeof(lwave[0][0])); wave_buffer_dirty = true; } else if (scopeType >= 2) { vectorscope_scale = vectorscopeScale; - memcpy(vect, vectorscope, VECTORSCOPE_SIZE * VECTORSCOPE_SIZE * - sizeof(vect[0][0])); + if (vect.getWidth() != vectorscope.getWidth() || vect.getHeight() != vectorscope.getHeight()) { + vect(vectorscope.getWidth(), vectorscope.getHeight()); + } + memcpy((int*)vect, (const int*)vectorscope, vect.getHeight() * vect.getWidth() * sizeof(vect[0][0])); vect_buffer_dirty = true; } valid = true; @@ -1245,7 +1244,7 @@ void HistogramArea::updateBackBuffer () drawMarks(cr, bhchanged, realhistheight, w, ui, oi); } - } else if (scopeType == 1 && waveform_width > 0) { + } else if (scopeType == 1 && rwave.getWidth() > 0) { drawWaveform(cr, w, h); } else if (scopeType >= 2) { drawVectorscope(cr, w, h); @@ -1333,29 +1332,42 @@ void HistogramArea::drawMarks(Cairo::RefPtr &cr, void HistogramArea::drawVectorscope(Cairo::RefPtr &cr, int w, int h) { + const int vect_width = vect.getWidth(); + const int vect_height = vect.getHeight(); // Arbitrary scale factor multiplied by vectorscope area and divided by // current scale. - const float scale = trace_brightness * 8.f * VECTORSCOPE_SIZE * VECTORSCOPE_SIZE / vectorscope_scale; + const float scale = trace_brightness * 8.f * vect_width * vect_height / vectorscope_scale; // See Cairo documentation on stride. - const int cairo_stride = Cairo::ImageSurface::format_stride_for_width(Cairo::FORMAT_ARGB32, VECTORSCOPE_SIZE); + const int cairo_stride = Cairo::ImageSurface::format_stride_for_width(Cairo::FORMAT_ARGB32, vect_width); if (vect_buffer_dirty && vectorscope_scale > 0) { + if (vect_buffer_size != cairo_stride * vect_height) { + vect_buffer_size = cairo_stride * vect_height; + vect_buffer.reset(new unsigned char[vect_buffer_size]); + } + // TODO: Optimize. - for (int u = 0; u < VECTORSCOPE_SIZE; u++) { - for (int v = 0; v < VECTORSCOPE_SIZE; v++) { - const unsigned char value = min(scale * vect[u][v], 0xff); - *(uint32_t*)&(vect_buffer[(VECTORSCOPE_SIZE - 1 - u) * cairo_stride + v * 4]) = - value | (value << 8) | (value << 16) | (value << 24); + for (int y = 0; y < vect_height; y++) { + int* vect_row = vect[y]; + uint32_t* buffer_row = + (uint32_t*)&(vect_buffer[(vect_height - 1 - y) * cairo_stride]); + for (int x = 0; x < vect_width; x++) { + const unsigned char value = min(scale * vect_row[x], 0xff); + buffer_row[x] = value | (value << 8) | (value << 16) | (value << 24); } } vect_buffer_dirty = false; } - const float scope_size = min(w, h) - 2 * padding; - const float o_x = (w - scope_size) / 2; - const float o_y = (h - scope_size) / 2; + const bool fit_width = + vect_width * (h - 2 * padding) > vect_height * (w - 2 * padding); + const float scope_scale = fit_width ? + (w - 2 * padding) / vect_width : (h - 2 * padding) / vect_height; + const float scope_size = scope_scale * max(vect_width, vect_height); + const float o_x = (w - scope_scale * vect_width) / 2; + const float o_y = (h - scope_scale * vect_height) / 2; const double s = RTScalable::getScale(); auto orig_matrix = cr->get_matrix(); const double line_spacing = 4.0 * s; @@ -1421,9 +1433,9 @@ void HistogramArea::drawVectorscope(Cairo::RefPtr &cr, int w, in // Vectorscope trace. if (vectorscope_scale > 0) { Cairo::RefPtr surface = Cairo::ImageSurface::create( - vect_buffer.get(), Cairo::FORMAT_ARGB32, VECTORSCOPE_SIZE, VECTORSCOPE_SIZE, cairo_stride); + vect_buffer.get(), Cairo::FORMAT_ARGB32, vect_width, vect_height, cairo_stride); cr->translate(o_x, o_y); - cr->scale(scope_size / VECTORSCOPE_SIZE, scope_size / VECTORSCOPE_SIZE); + cr->scale(scope_scale, scope_scale); cr->set_source(surface, 0, 0); cr->set_operator(Cairo::OPERATOR_OVER); cr->paint(); @@ -1455,41 +1467,48 @@ void HistogramArea::drawWaveform(Cairo::RefPtr &cr, int w, int h { // Arbitrary scale factor divided by current scale. const float scale = trace_brightness * 32.f * 255.f / waveform_scale; + const int wave_width = rwave.getWidth(); + const int wave_height = rwave.getHeight(); // See Cairo documentation on stride. - const int cairo_stride = Cairo::ImageSurface::format_stride_for_width(Cairo::FORMAT_ARGB32, waveform_width); + const int cairo_stride = Cairo::ImageSurface::format_stride_for_width(Cairo::FORMAT_ARGB32, rwave.getWidth()); if (wave_buffer_dirty) { - wave_buffer.reset(new unsigned char[256 * cairo_stride]); - wave_buffer_luma.reset(new unsigned char[256 * cairo_stride]); + wave_buffer.reset(new unsigned char[wave_height * cairo_stride]); + wave_buffer_luma.reset(new unsigned char[wave_height * cairo_stride]); // Clear waveform. - memset(wave_buffer.get(), 0, 256 * cairo_stride); - memset(wave_buffer_luma.get(), 0, 256 * cairo_stride); + memset(wave_buffer.get(), 0, wave_height * cairo_stride); + memset(wave_buffer_luma.get(), 0, wave_height * cairo_stride); // TODO: Optimize. - for (int col = 0; col < waveform_width; col++) { - for (int val = 0; val < 256; val++) { - const unsigned char r = needRed ? min(scale * rwave[col][val], 0xff) : 0; - const unsigned char g = needGreen ? min(scale * gwave[col][val], 0xff) : 0; - const unsigned char b = needBlue ? min(scale * bwave[col][val], 0xff) : 0; + for (int val = 0; val < wave_height; val++) { + int* r_row = rwave[val]; + int* g_row = gwave[val]; + int* b_row = bwave[val]; + uint32_t* buffer_row = (uint32_t*)&(wave_buffer[(255 - val) * cairo_stride]); + for (int col = 0; col < wave_width; col++) { + const unsigned char r = needRed ? min(scale * r_row[col], 0xff) : 0; + const unsigned char g = needGreen ? min(scale * g_row[col], 0xff) : 0; + const unsigned char b = needBlue ? min(scale * b_row[col], 0xff) : 0; const unsigned char value = (r > g && r > b) ? r : ((g > b) ? g : b); if (value <= 0) { - *(uint32_t*)&(wave_buffer[(255 - val) * cairo_stride + col * 4]) = 0; + buffer_row[col] = 0; } else { // Speedup with one memory access instead of four. - *(uint32_t*)&(wave_buffer[(255 - val) * cairo_stride + col * 4]) = - b | (g << 8) | (r << 16) | (value << 24); + buffer_row[col] = b | (g << 8) | (r << 16) | (value << 24); } } } if (needLuma) { - for (int col = 0; col < waveform_width; col++) { - for (int val = 0; val < 256; val++) { - const unsigned char l = min(scale * lwave[col][val], 0xff); - *(uint32_t*)&(wave_buffer_luma[(255 - val) * cairo_stride + col * 4]) = - l | (l << 8) | (l << 16) | (l << 24); + for (int val = 0; val < wave_height; val++) { + int* l_row = lwave[val]; + uint32_t* buffer_row = + (uint32_t*)&(wave_buffer_luma[(255 - val) * cairo_stride]); + for (int col = 0; col < wave_width; col++) { + const unsigned char l = min(scale * l_row[col], 0xff); + buffer_row[col] = l | (l << 8) | (l << 16) | (l << 24); } } } @@ -1500,17 +1519,17 @@ void HistogramArea::drawWaveform(Cairo::RefPtr &cr, int w, int h Cairo::RefPtr surface; auto orig_matrix = cr->get_matrix(); cr->translate(0, padding); - cr->scale(static_cast(w) / waveform_width, (h - 2 * padding) / 256.0); + cr->scale(static_cast(w) / wave_width, (h - 2 * padding) / wave_height); if (needLuma) { surface = Cairo::ImageSurface::create( - wave_buffer_luma.get(), Cairo::FORMAT_ARGB32, waveform_width, 256, cairo_stride); + wave_buffer_luma.get(), Cairo::FORMAT_ARGB32, wave_width, wave_height, cairo_stride); cr->set_source(surface, 0, 0); cr->set_operator(Cairo::OPERATOR_OVER); cr->paint(); surface->finish(); } surface = Cairo::ImageSurface::create( - wave_buffer.get(), Cairo::FORMAT_ARGB32, waveform_width, 256, cairo_stride); + wave_buffer.get(), Cairo::FORMAT_ARGB32, wave_width, wave_height, cairo_stride); cr->set_source(surface, 0, 0); cr->set_operator(Cairo::OPERATOR_OVER); cr->paint(); diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index fb38ee757..bda65df0c 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -27,16 +27,12 @@ #include "guiutils.h" #include "pointermotionlistener.h" +#include "../rtengine/array2D.h" #include "../rtengine/LUT.h" #include "../rtengine/noncopyable.h" class HistogramArea; -namespace -{ -constexpr int VECTORSCOPE_SIZE = 128; -} - struct HistogramAreaIdleHelper { HistogramArea* harea; bool destroyed; @@ -162,12 +158,12 @@ protected: LUTu rhist, ghist, bhist, lhist, chist; LUTu rhistRaw, ghistRaw, bhistRaw, lhistRaw; //lhistRaw is unused? int vectorscope_scale; - int vect[VECTORSCOPE_SIZE][VECTORSCOPE_SIZE]; + array2D vect; std::unique_ptr vect_buffer; bool vect_buffer_dirty; + int vect_buffer_size; int waveform_scale; - int waveform_width; - std::unique_ptr rwave, gwave, bwave, lwave; + array2D rwave, gwave, bwave, lwave; std::unique_ptr wave_buffer; std::unique_ptr wave_buffer_luma; bool wave_buffer_dirty; @@ -210,13 +206,12 @@ public: const LUTu& histGreenRaw, const LUTu& histBlueRaw, int vectorscopeScale, - const int vectorscope[VECTORSCOPE_SIZE][VECTORSCOPE_SIZE], + const array2D& vectorscope, int waveformScale, - int waveformWidth, - const int waveformRed[][256], - const int waveformGreen[][256], - const int waveformBlue[][256], - const int waveformLuma[][256] + const array2D& waveformRed, + const array2D& waveformGreen, + const array2D& waveformBlue, + const array2D& waveformLuma ); void updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode, int type, bool pointer); void on_realize() override; @@ -314,16 +309,15 @@ public: const LUTu& histGreenRaw, const LUTu& histBlueRaw, int vectorscopeScale, - const int vectorscope[VECTORSCOPE_SIZE][VECTORSCOPE_SIZE], + const array2D& vectorscope, int waveformScale, - int waveformWidth, - const int waveformRed[][256], - const int waveformGreen[][256], - const int waveformBlue[][256], - const int waveformLuma[][256] + const array2D& waveformRed, + const array2D& waveformGreen, + const array2D& waveformBlue, + const array2D& waveformLuma ) { - histogramArea->update(histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw, vectorscopeScale, vectorscope, waveformScale, waveformWidth, waveformRed, waveformGreen, waveformBlue, waveformLuma); + histogramArea->update(histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw, vectorscopeScale, vectorscope, waveformScale, waveformRed, waveformGreen, waveformBlue, waveformLuma); } // pointermotionlistener interface void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false) override;