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

Method GetIndexedColor

Rendering/Core/vtkColorTransferFunction.cxx:1861–1877  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1859
1860//------------------------------------------------------------------------------
1861void vtkColorTransferFunction::GetIndexedColor(vtkIdType idx, double rgba[4])
1862{
1863 vtkIdType n = this->GetSize();
1864 if (n > 0 && idx >= 0)
1865 {
1866 double nodeValue[6];
1867 this->GetNodeValue(idx % n, nodeValue);
1868 for (int j = 0; j < 3; ++j)
1869 {
1870 rgba[j] = nodeValue[j + 1];
1871 }
1872 rgba[3] = 1.0; // NodeColor is RGB-only.
1873 return;
1874 }
1875 this->GetNanColor(rgba);
1876 rgba[3] = this->GetNanOpacity();
1877}
1878
1879//------------------------------------------------------------------------------
1880void vtkColorTransferFunction::FillFromDataPointer(int nb, double* ptr)

Calls 2

GetSizeMethod · 0.95
GetNodeValueMethod · 0.95

Tested by 1