comparison layer/Colour3DPlotRenderer.h @ 1119:be5b91ec81a0 spectrogram-minor-refactor

Inch toward using the mag cache (currently will crash with debug exception)
author Chris Cannam
date Wed, 20 Jul 2016 08:42:04 +0100
parents 261a00010918
children d930ff725f64
comparison
equal deleted inserted replaced
1118:175d4e15884d 1119:be5b91ec81a0
16 #ifndef COLOUR_3D_PLOT_RENDERER_H 16 #ifndef COLOUR_3D_PLOT_RENDERER_H
17 #define COLOUR_3D_PLOT_RENDERER_H 17 #define COLOUR_3D_PLOT_RENDERER_H
18 18
19 #include "ColourScale.h" 19 #include "ColourScale.h"
20 #include "ScrollableImageCache.h" 20 #include "ScrollableImageCache.h"
21 #include "ScrollableMagRangeCache.h"
21 22
22 #include "base/ColumnOp.h" 23 #include "base/ColumnOp.h"
23 #include "base/MagnitudeRange.h" 24 #include "base/MagnitudeRange.h"
24 25
25 #include <QRect> 26 #include <QRect>
181 // at view height (not model height) and is cleared and repainted 182 // at view height (not model height) and is cleared and repainted
182 // on each fragment render. The only reason it's stored as a data 183 // on each fragment render. The only reason it's stored as a data
183 // member is to avoid reallocation. 184 // member is to avoid reallocation.
184 QImage m_drawBuffer; 185 QImage m_drawBuffer;
185 186
186 // Image cache is our persistent record of the visible area. It is 187 // The image cache is our persistent record of the visible
187 // always the same size as the view (i.e. the paint size reported 188 // area. It is always the same size as the view (i.e. the paint
188 // by the LayerGeometryProvider) and is scrolled and partially 189 // size reported by the LayerGeometryProvider) and is scrolled and
189 // repainted internally as appropriate. A render request is 190 // partially repainted internally as appropriate. A render request
190 // carried out by repainting to cache (via the draw buffer) any 191 // is carried out by repainting to cache (via the draw buffer) any
191 // area that is being requested but is not valid in the cache, and 192 // area that is being requested but is not valid in the cache, and
192 // then repainting from cache to the requested painter. 193 // then repainting from cache to the requested painter.
193 ScrollableImageCache m_cache; 194 ScrollableImageCache m_cache;
194 195
196 // The mag range cache is our record of the column magnitude
197 // ranges for each of the columns in the cache. It always has the
198 // same start frame and width as the image cache, and the column
199 // indices match up across both. Our cache update mechanism
200 // guarantees that every valid column in the image cache has a
201 // valid range in the magnitude cache, but not necessarily vice
202 // versa (as the image cache is limited to contiguous ranges).
203 ScrollableMagRangeCache m_magCache;
204
195 RenderResult render(const LayerGeometryProvider *v, 205 RenderResult render(const LayerGeometryProvider *v,
196 QPainter &paint, QRect rect, bool timeConstrained); 206 QPainter &paint, QRect rect, bool timeConstrained);
197 207
198 void renderDirectTranslucent(const LayerGeometryProvider *v, 208 void renderDirectTranslucent(const LayerGeometryProvider *v,
199 QPainter &paint, QRect rect); 209 QPainter &paint, QRect rect);