Skip to content

Commit cc8ca57

Browse files
committed
Add BP Seismic color map
1 parent 739d265 commit cc8ca57

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/Core/Datatypes/ColorMap.cc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ class Darkhue : public ColorMapStrategy
8585
public:
8686
virtual Core::Datatypes::ColorRGB getColorMapVal(double v) const override;
8787
};
88+
89+
class BPSeismic : public ColorMapStrategy
90+
{
91+
public:
92+
virtual Core::Datatypes::ColorRGB getColorMapVal(double v) const override;
93+
};
8894
}
8995

9096
ColorMapHandle StandardColorMapFactory::create(const std::string& name, const size_t &res,
@@ -110,6 +116,9 @@ ColorMapHandle StandardColorMapFactory::create(const std::string& name, const si
110116
else if (name == "Darkhue") {
111117
color.reset(new detail::Darkhue);
112118
}
119+
else if (name == "BP Seismic") {
120+
color.reset(new detail::BPSeismic);
121+
}
113122
else
114123
THROW_INVALID_ARGUMENT("Color map name not implemented/recognized.");
115124

@@ -291,6 +300,18 @@ ColorRGB detail::OrangeBlackLime::getColorMapVal(double f) const
291300
return col;
292301
}
293302

303+
// This color scheme sets a transition of color that goes
304+
// Blue -> White -> Red
305+
ColorRGB detail::BPSeismic::getColorMapVal(double f) const
306+
{
307+
ColorRGB col;
308+
if (f < 0.5)
309+
col = ColorRGB(f*2, f*2, 1);
310+
else
311+
col = ColorRGB(1, (1-f)*2, (1-f)*2);
312+
return col;
313+
}
314+
294315
ColorRGB detail::Darkhue::getColorMapVal(double f) const
295316
{
296317
ColorRGB col;

src/Interface/Modules/Visualization/CreateStandardColorMap.ui

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@
9090
<string>Orange,Black,Lime</string>
9191
</property>
9292
</item>
93+
<item>
94+
<property name="text">
95+
<string>BP Seismic</string>
96+
</property>
97+
</item>
9398
</widget>
9499
</item>
95100
<item>

0 commit comments

Comments
 (0)