Delegate retrieval of moment data to view class

This commit is contained in:
Dan Paulat 2021-10-30 23:20:50 -05:00
parent 5cbe986734
commit 7747e869ba
3 changed files with 32 additions and 12 deletions

View file

@ -96,6 +96,28 @@ void RadarProductView::Initialize()
UpdatePlot();
}
std::tuple<const void*, size_t, size_t> RadarProductView::GetMomentData()
{
const void* data;
size_t dataSize;
size_t componentSize;
if (p->dataMoments8_.size() > 0)
{
data = p->dataMoments8_.data();
dataSize = p->dataMoments8_.size() * sizeof(uint8_t);
componentSize = 1;
}
else
{
data = p->dataMoments16_.data();
dataSize = p->dataMoments16_.size() * sizeof(uint16_t);
componentSize = 2;
}
return std::tie(data, dataSize, componentSize);
}
void RadarProductView::LoadColorTable(
std::shared_ptr<common::ColorTable> colorTable)
{

View file

@ -37,6 +37,8 @@ public:
const std::vector<boost::gil::rgba8_pixel_t>& color_table() const;
void Initialize();
std::tuple<const void*, size_t, size_t> GetMomentData();
void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable);
std::chrono::system_clock::time_point PlotTime();