//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void CategoryMapper::setInterpolateColors(const cvf::Color3ubArray& colorArray) { CVF_ASSERT(colorArray.size()); if (m_categoryValues.size() > 1 && colorArray.size() > 1) { m_colors = *interpolateColorArray(colorArray, static_cast<cvf::uint>(m_categoryValues.size())); recomputeMaxTexCoord(); return; } // Either we are requesting one output color, or we have only one input color m_colors.clear(); m_colors.reserve(m_categoryValues.size()); for (size_t cIdx = 0; cIdx < m_categoryValues.size(); ++cIdx) { m_colors.add(colorArray[0]); } recomputeMaxTexCoord(); }
//-------------------------------------------------------------------------------------------------- /// Sets the colors that will be used in the legend. Will be interpolated when needed. //-------------------------------------------------------------------------------------------------- void ScalarMapperRangeBased::setColors(const Color3ubArray& colorArray) { m_interpolatedUserGradientColors = *interpolateColorArray(colorArray, m_textureSize); }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void ScalarMapperContinuousLog::setColors(const Color3ubArray& colorArray) { m_colors = *interpolateColorArray(colorArray, m_textureSize); }