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

Method MapValue

Common/Core/vtkLookupTable.cxx:767–792  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Given a scalar value v, return an RGBA color value from lookup table.

Source from the content-addressed store, hash-verified

765//------------------------------------------------------------------------------
766// Given a scalar value v, return an RGBA color value from lookup table.
767const unsigned char* vtkLookupTable::MapValue(double v)
768{
769 vtkIdType index = this->GetIndex(v);
770 if (index < 0)
771 {
772 return this->GetNanColorAsUnsignedChars();
773 }
774 else if (index == 0)
775 {
776 if (this->UseBelowRangeColor && v < this->TableRange[0])
777 {
778 this->GetColorAsUnsignedChars(this->GetBelowRangeColor(), this->RGBABytes);
779 return this->RGBABytes;
780 }
781 }
782 else if (index == this->NumberOfColors - 1)
783 {
784 if (this->UseAboveRangeColor && v > this->TableRange[1])
785 {
786 this->GetColorAsUnsignedChars(this->GetAboveRangeColor(), this->RGBABytes);
787 return this->RGBABytes;
788 }
789 }
790
791 return this->Table->GetPointer(0) + 4 * index;
792}
793VTK_ABI_NAMESPACE_END
794
795namespace

Callers 15

GetColorMethod · 0.95
GetOpacityMethod · 0.95
GetColorsMethod · 0.45
WriteScalarMethod · 0.45
InsertSurfaceVertexMethod · 0.45
DrawPointMethod · 0.45
SetColorsMethod · 0.45
ProcessColorArrayMethod · 0.45
TestCategoricalColorsFunction · 0.45
TestGetColorAndMapValueFunction · 0.45

Calls 4

GetIndexMethod · 0.95
GetPointerMethod · 0.45

Tested by 6

TestCategoricalColorsFunction · 0.36
TestGetColorAndMapValueFunction · 0.36
TestLookupTableFunction · 0.36
TestFunction · 0.36