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

Function vtkImageXYZToLABExecute

Imaging/Color/vtkImageXYZToLAB.cxx:21–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19//------------------------------------------------------------------------------
20template <class T>
21void vtkImageXYZToLABExecute(
22 vtkImageXYZToLAB* self, vtkImageData* inData, vtkImageData* outData, int outExt[6], int id, T*)
23{
24 vtkImageIterator<T> inIt(inData, outExt);
25 vtkImageProgressIterator<T> outIt(outData, outExt, self, id);
26 double x, y, z, l, a, b;
27
28 // Loop through output pixels
29 while (!outIt.IsAtEnd())
30 {
31 T* inSI = inIt.BeginSpan();
32 T* outSI = outIt.BeginSpan();
33 T* outSIEnd = outIt.EndSpan();
34 while (outSI != outSIEnd)
35 {
36 x = *(inSI++);
37 y = *(inSI++);
38 z = *(inSI++);
39
40 vtkMath::XYZToLab(x, y, z, &l, &a, &b);
41
42 // assign output.
43 *outSI = static_cast<T>(l);
44 outSI++;
45 *outSI = static_cast<T>(a);
46 outSI++;
47 *outSI = static_cast<T>(b);
48 outSI++;
49 }
50 inIt.NextSpan();
51 outIt.NextSpan();
52 }
53}
54} // anonymous namespace
55
56//------------------------------------------------------------------------------

Callers 1

ThreadedExecuteMethod · 0.85

Calls 3

XYZToLabFunction · 0.85
NextSpanMethod · 0.80
IsAtEndMethod · 0.45

Tested by

no test coverage detected