MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / get_envelope_section

Method get_envelope_section

DSView/pv/data/dsosnapshot.cpp:302–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void DsoSnapshot::get_envelope_section(EnvelopeSection &s,
303 uint64_t start, uint64_t end, float min_length, int probe_index)
304{
305 assert(end <= get_sample_count());
306 assert(start <= end);
307 assert(min_length > 0);
308
309 if (!_envelope_done) {
310 s.length = 0;
311 return;
312 }
313
314 const unsigned int min_level = max((int)floorf(logf(min_length) /
315 LogEnvelopeScaleFactor) - 1, 0);
316 const unsigned int scale_power = (min_level + 1) *
317 EnvelopeScalePower;
318 start >>= scale_power;
319 end >>= scale_power;
320
321 s.start = start << scale_power;
322 s.scale = 1 << scale_power;
323 if (_envelope_levels[probe_index][min_level].length == 0)
324 s.length = 0;
325 else
326 s.length = end - start;
327
328 s.samples = _envelope_levels[probe_index][min_level].samples + start;
329}
330
331void DsoSnapshot::reallocate_envelope(Envelope &e)
332{

Callers 2

paint_envelopeMethod · 0.45
paint_envelopeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected