ngscopeclient
0.1-dev+51fbda87c
lib
scopehal
ConstellationWaveform.h
Go to the documentation of this file.
1
/***********************************************************************************************************************
2
* *
3
* libscopehal *
4
* *
5
* Copyright (c) 2012-2024 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
37
#ifndef ConstellationWaveform_h
38
#define ConstellationWaveform_h
39
40
#include "../scopehal/DensityFunctionWaveform.h"
41
46
class
ConstellationWaveform
:
public
DensityFunctionWaveform
47
{
48
public
:
49
50
ConstellationWaveform
(
size_t
width,
size_t
height);
51
virtual
~ConstellationWaveform
();
52
53
//not copyable or assignable
54
ConstellationWaveform
(
const
ConstellationWaveform
&) =
delete
;
55
ConstellationWaveform
& operator=(
const
ConstellationWaveform
&) =
delete
;
56
58
int64_t*
GetAccumData
()
59
{
return
m_accumdata
; }
60
61
void
Normalize
();
62
64
size_t
GetTotalSymbols
()
65
{
return
m_totalSymbols
; }
66
72
void
IntegrateSymbols
(
size_t
symbols)
73
{
m_totalSymbols
+= symbols; }
74
86
float
m_saturationLevel
;
87
88
virtual
void
FreeGpuMemory
()
override
89
{}
90
91
virtual
bool
HasGpuBuffer
()
override
92
{
return
false
; }
93
94
protected
:
95
101
int64_t*
m_accumdata
;
102
104
size_t
m_totalSymbols
;
105
};
106
107
#endif
ConstellationWaveform
A constellation diagram.
Definition:
ConstellationWaveform.h:47
ConstellationWaveform::Normalize
void Normalize()
Normalizes the waveform so that the output buffer has values in the range [0, 1].
Definition:
ConstellationWaveform.cpp:68
ConstellationWaveform::HasGpuBuffer
virtual bool HasGpuBuffer() override
Returns true if we have at least one buffer resident on the GPU.
Definition:
ConstellationWaveform.h:91
ConstellationWaveform::m_totalSymbols
size_t m_totalSymbols
The number of symbols which have been integrated so far.
Definition:
ConstellationWaveform.h:104
ConstellationWaveform::m_accumdata
int64_t * m_accumdata
Raw accumulator buffer, not normalized.
Definition:
ConstellationWaveform.h:101
ConstellationWaveform::GetAccumData
int64_t * GetAccumData()
Returns the raw accumulator sample data.
Definition:
ConstellationWaveform.h:58
ConstellationWaveform::IntegrateSymbols
void IntegrateSymbols(size_t symbols)
Marks the waveform as having integrated another batch of symbols.
Definition:
ConstellationWaveform.h:72
ConstellationWaveform::GetTotalSymbols
size_t GetTotalSymbols()
Returns the number of integrated symbols in the constellation.
Definition:
ConstellationWaveform.h:64
ConstellationWaveform::FreeGpuMemory
virtual void FreeGpuMemory() override
Free GPU-side memory if we are short on VRAM or do not anticipate using this waveform for a while.
Definition:
ConstellationWaveform.h:88
ConstellationWaveform::m_saturationLevel
float m_saturationLevel
Value to pre-normalize the waveform to before clipping to the range [0, 1]. Must be non-negative.
Definition:
ConstellationWaveform.h:86
DensityFunctionWaveform
Base class for waveforms such as eye patterns, spectrograms, and waterfalls which are conceptually a ...
Definition:
DensityFunctionWaveform.h:51
Generated by
1.9.4