MCPcopy Create free account
hub / github.com/brenocq/implot3d / AddColormap

Function AddColormap

implot3d.cpp:3154–3163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3152//------------------------------------------------------------------------------
3153
3154ImPlot3DColormap AddColormap(const char* name, const ImVec4* colormap, int size, bool qual) {
3155 ImPlot3DContext& gp = *GImPlot3D;
3156 IM_ASSERT_USER_ERROR(size > 1, "The colormap size must be greater than 1!");
3157 IM_ASSERT_USER_ERROR(gp.ColormapData.GetIndex(name) == -1, "The colormap name has already been used!");
3158 ImVector<ImU32> buffer;
3159 buffer.resize(size);
3160 for (int i = 0; i < size; i++)
3161 buffer[i] = ImGui::ColorConvertFloat4ToU32(colormap[i]);
3162 return gp.ColormapData.Append(name, buffer.Data, size, qual);
3163}
3164
3165ImPlot3DColormap AddColormap(const char* name, const ImU32* colormap, int size, bool qual) {
3166 ImPlot3DContext& gp = *GImPlot3D;

Callers 1

ShowStyleEditorFunction · 0.85

Calls 2

GetIndexMethod · 0.80
AppendMethod · 0.80

Tested by

no test coverage detected