X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fanalogsnapshot.h;fp=pv%2Fdata%2Fanalogsnapshot.h;h=8eec2797f1a4aa77b5945ccf31f2eef926600dce;hp=a45391849220332b892faa9ed3eaa79df30a4df6;hb=fda5b6e0e0ebbe55f3d173051b8800293f87cd09;hpb=785fd8d138e5866ade499c02ea405b8852fee113 diff --git a/pv/data/analogsnapshot.h b/pv/data/analogsnapshot.h index a4539184..8eec2797 100644 --- a/pv/data/analogsnapshot.h +++ b/pv/data/analogsnapshot.h @@ -31,15 +31,44 @@ namespace data { class AnalogSnapshot : public Snapshot { +private: + struct EnvelopeSample + { + float min; + float max; + }; + + struct Envelope + { + uint64_t length; + uint64_t data_length; + EnvelopeSample *samples; + }; + +private: + static const unsigned int ScaleStepCount = 10; + static const int EnvelopeScalePower; + static const int EnvelopeScaleFactor; + static const float LogEnvelopeScaleFactor; + static const uint64_t EnvelopeDataUnit; + public: AnalogSnapshot(const sr_datafeed_analog &analog); + virtual ~AnalogSnapshot(); + void append_payload(const sr_datafeed_analog &analog); const float* get_samples(int64_t start_sample, int64_t end_sample) const; -}; +private: + void reallocate_envelope(Envelope &l); + + void append_payload_to_envelope_levels(); + +private: + struct Envelope _envelope_levels[ScaleStepCount]; } // namespace data } // namespace pv