#include <extdef.h>
#include <cassert>
-#include <cstring>
-#include <cstdlib>
#include <cmath>
+#include <cstdlib>
+#include <cstring>
#include "logic.hpp"
#include "logicsegment.hpp"
using std::recursive_mutex;
using std::max;
using std::min;
-using std::pair;
using std::shared_ptr;
using std::vector;
const int LogicSegment::MipMapScalePower = 4;
const int LogicSegment::MipMapScaleFactor = 1 << MipMapScalePower;
const float LogicSegment::LogMipMapScaleFactor = logf(MipMapScaleFactor);
-const uint64_t LogicSegment::MipMapDataUnit = 64*1024; // bytes
-
-LogicSegment::LogicSegment(pv::data::Logic& owner, shared_ptr<sigrok::Logic> data,
- uint64_t samplerate) :
- Segment(samplerate, data->unit_size()),
- owner_(owner),
- last_append_sample_(0)
-{
- lock_guard<recursive_mutex> lock(mutex_);
- memset(mip_map_, 0, sizeof(mip_map_));
- append_payload(data);
-}
+const uint64_t LogicSegment::MipMapDataUnit = 64 * 1024; // bytes
LogicSegment::LogicSegment(pv::data::Logic& owner, unsigned int unit_size,
uint64_t samplerate) :
lock_guard<recursive_mutex> lock(mutex_);
- return get_raw_samples(start_sample, (end_sample-start_sample));
+ return get_raw_samples(start_sample, (end_sample - start_sample));
}
SegmentLogicDataIterator* LogicSegment::begin_sample_iteration(uint64_t start)
// Compute higher level mipmaps
for (unsigned int level = 1; level < ScaleStepCount; level++) {
MipMapLevel &m = mip_map_[level];
- const MipMapLevel &ml = mip_map_[level-1];
+ const MipMapLevel &ml = mip_map_[level - 1];
// Expand the data buffer to fit the new samples
prev_length = m.length;