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

Method GetColor

Rendering/Core/vtkColorTransferFunction.cxx:727–748  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Returns the RGB color evaluated at the specified location

Source from the content-addressed store, hash-verified

725//------------------------------------------------------------------------------
726// Returns the RGB color evaluated at the specified location
727void vtkColorTransferFunction::GetColor(double x, double rgb[3])
728{
729 if (this->IndexedLookup)
730 {
731 int numNodes = this->GetSize();
732 vtkVariant xv(x);
733 vtkIdType idx = this->GetAnnotatedValueIndexInternal(xv);
734 if (idx < 0 || numNodes == 0)
735 {
736 this->GetNanColor(rgb);
737 }
738 else
739 {
740 double nodeVal[6];
741 this->GetNodeValue(idx % numNodes, nodeVal);
742 for (int i = 0; i < 3; ++i)
743 rgb[i] = nodeVal[i + 1];
744 }
745 return;
746 }
747 this->GetTable(x, x, 1, rgb);
748}
749
750//------------------------------------------------------------------------------
751// Returns the red color evaluated at the specified location

Callers 6

MapValueMethod · 0.95
GetRedValueMethod · 0.95
GetGreenValueMethod · 0.95
GetBlueValueMethod · 0.95
AdjustRangeMethod · 0.95

Calls 4

GetSizeMethod · 0.95
GetNodeValueMethod · 0.95
GetTableMethod · 0.95

Tested by

no test coverage detected