MCPcopy Create free account
hub / github.com/Kitware/VTK / vtkImageCanvasSource2DFillBox

Function vtkImageCanvasSource2DFillBox

Imaging/Sources/vtkImageCanvasSource2D.cxx:241–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239// Draw a data. Only implentented for 2D extents.
240template <class T>
241void vtkImageCanvasSource2DFillBox(
242 vtkImageData* image, double* drawColor, T* ptr, int min0, int max0, int min1, int max1)
243{
244 T *ptr0, *ptr1, *ptrV;
245 int idx0, idx1, idxV;
246 vtkIdType inc0, inc1, inc2;
247 int maxV;
248 double* pf;
249
250 image->GetIncrements(inc0, inc1, inc2);
251 maxV = image->GetNumberOfScalarComponents() - 1;
252
253 ptr1 = ptr;
254 for (idx1 = min1; idx1 <= max1; ++idx1)
255 {
256 ptr0 = ptr1;
257 for (idx0 = min0; idx0 <= max0; ++idx0)
258 {
259 ptrV = ptr0;
260 pf = drawColor;
261
262 // Assign color to pixel.
263 for (idxV = 0; idxV <= maxV; ++idxV)
264 {
265 *ptrV = static_cast<T>(*pf++);
266 ptrV++;
267 }
268
269 ptr0 += inc0;
270 }
271 ptr1 += inc1;
272 }
273}
274
275//------------------------------------------------------------------------------
276// Draw a data. Only implentented for 2D extents.

Callers 1

FillBoxMethod · 0.85

Calls 2

GetIncrementsMethod · 0.80

Tested by

no test coverage detected