| 239 | // Draw a data. Only implentented for 2D extents. |
| 240 | template <class T> |
| 241 | void 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. |
no test coverage detected