ngscopeclient v0.2.2
Loading...
Searching...
No Matches
PAMEdgeDetectorFilter.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopeprotocols *
4* *
5* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
35#ifndef PAMEdgeDetectorFilter_h
36#define PAMEdgeDetectorFilter_h
37
38#include <cinttypes>
39#include "../scopehal/ActionProvider.h"
40
42{
43public:
44 uint32_t len;
45 uint32_t order;
46 uint32_t inputPerThread;
47};
48
50{
51public:
52 int64_t halfui;
53 int64_t timescale;
54 int64_t triggerPhase;
55 uint32_t numIndexes;
56 uint32_t numSamples;
57 uint32_t inputPerThread;
58 uint32_t outputPerThread;
59 uint32_t order;
60};
61
63 : public Filter
64 , public ActionProvider
65{
66public:
67 PAMEdgeDetectorFilter(const std::string& color);
68
69 virtual void Refresh(vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue) override;
70 virtual uint32_t GetExecutionCapabilitiesMask() override;
71
72 static std::string GetProtocolName();
73
74 virtual std::vector<std::string> EnumActions() override;
75 virtual bool PerformAction(const std::string& id) override;
76
77 PROTOCOL_DECODER_INITPROC(PAMEdgeDetectorFilter)
78
79protected:
80 void AutoLevel(UniformAnalogWaveform* din);
81
82 FilterParameter& m_order;
83 FilterParameter& m_baud;
84
85 AcceleratorBuffer<uint32_t> m_edgeIndexes;
86
88
89 AcceleratorBuffer<uint32_t> m_edgeIndexesScratch;
90 AcceleratorBuffer<uint8_t> m_edgeStatesScratch;
91
92 AcceleratorBuffer<float> m_thresholds;
94
96 std::shared_ptr<ComputePipeline> m_firstPassComputePipeline;
97
99 std::shared_ptr<ComputePipeline> m_secondPassComputePipeline;
100
102 std::shared_ptr<ComputePipeline> m_initialMergeComputePipeline;
103
105 std::shared_ptr<ComputePipeline> m_finalMergeComputePipeline;
106};
107
108#endif
Definition AcceleratorBuffer.h:204
Abstract base for objects (usually filters) which provide a series of actions a user can perform.
Definition ActionProvider.h:48
A parameter to a filter.
Definition FilterParameter.h:86
Abstract base class for all filter graph blocks which are not physical instrument channels.
Definition Filter.h:105
Definition PAMEdgeDetectorFilter.h:42
Definition PAMEdgeDetectorFilter.h:65
std::shared_ptr< ComputePipeline > m_finalMergeComputePipeline
Compute pipeline for final merge pass.
Definition PAMEdgeDetectorFilter.h:105
virtual std::vector< std::string > EnumActions() override
Return a list of all actions which may be performed on the object.
Definition PAMEdgeDetectorFilter.cpp:492
virtual bool PerformAction(const std::string &id) override
Perform a specific action.
Definition PAMEdgeDetectorFilter.cpp:499
std::shared_ptr< ComputePipeline > m_initialMergeComputePipeline
Compute pipeline for first-pass merge.
Definition PAMEdgeDetectorFilter.h:102
virtual uint32_t GetExecutionCapabilitiesMask() override
Returns a bitmask of ExecutionCapabilities fields.
Definition PAMEdgeDetectorFilter.cpp:96
std::shared_ptr< ComputePipeline > m_firstPassComputePipeline
Compute pipeline for first edge detection pass.
Definition PAMEdgeDetectorFilter.h:96
std::shared_ptr< ComputePipeline > m_secondPassComputePipeline
Compute pipeline for second (merge) edge detection pass.
Definition PAMEdgeDetectorFilter.h:99
Definition PAMEdgeDetectorFilter.h:50
A waveform sampled at uniform intervals.
Definition Waveform.h:404