| 405 | //------------------------------------------------------------------------------ |
| 406 | template <class T> |
| 407 | void vtkImageHistogramExecuteInt(vtkImageHistogram* self, vtkImageData* inData, |
| 408 | vtkImageStencilData* stencil, T* inPtr, int extent[6], vtkIdType* outPtr, int component, |
| 409 | int threadId) |
| 410 | { |
| 411 | vtkImageStencilIterator<T> inIter(inData, stencil, extent, ((threadId == 0) ? self : nullptr)); |
| 412 | |
| 413 | // set up components |
| 414 | int nc = inData->GetNumberOfScalarComponents(); |
| 415 | int c = component; |
| 416 | if (c < 0) |
| 417 | { |
| 418 | nc = 1; |
| 419 | c = 0; |
| 420 | } |
| 421 | |
| 422 | // iterate over all spans in the stencil |
| 423 | while (!inIter.IsAtEnd()) |
| 424 | { |
| 425 | if (inIter.IsInStencil()) |
| 426 | { |
| 427 | inPtr = inIter.BeginSpan(); |
| 428 | T* inPtrEnd = inIter.EndSpan(); |
| 429 | |
| 430 | // iterate over all voxels in the span |
| 431 | if (inPtr != inPtrEnd) |
| 432 | { |
| 433 | int n = static_cast<int>((inPtrEnd - inPtr) / nc); |
| 434 | inPtr += c; |
| 435 | do |
| 436 | { |
| 437 | outPtr[*inPtr]++; |
| 438 | inPtr += nc; |
| 439 | } while (--n); |
| 440 | } |
| 441 | } |
| 442 | inIter.NextSpan(); |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | // no-op version for float |
| 447 | void vtkImageHistogramExecuteInt( |
no test coverage detected