-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDHistogram.cpp
More file actions
65 lines (46 loc) · 1.87 KB
/
DHistogram.cpp
File metadata and controls
65 lines (46 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*****************************************************************************
******************************* DHistogram.cpp *******************************
*****************************************************************************/
/*****************************************************************************
****************************** I N C L U D E *******************************
*****************************************************************************/
#include "DHistogram.h"
#include <memory.h>
/*****************************************************************************
********************** Class DHistogram Implementation ***********************
*****************************************************************************/
/*****************************************************************************
*
* DHistogram::DHistogram
*
*****************************************************************************/
DHistogram::DHistogram()
{
Clear();
return;
} // End of function DHistogram::DHistogram
/*****************************************************************************
*
* DHistogram::Clear
*
*****************************************************************************/
void DHistogram::Clear()
{
m_nMaxBin = 0;
memset(m_nBins, 0, m_nBinCount * sizeof(m_nBins[0]));
return;
} // End of function DHistogram::Clear
/*****************************************************************************
*
* DHistogram::IncValue
*
*****************************************************************************/
void DHistogram::IncValue(unsigned char nValue)
{
m_nBins[nValue]++;
if (m_nBins[nValue] > m_nBins[m_nMaxBin])
{
m_nMaxBin = nValue;
} // end if
return;
} // End of function DHistogram::IncValue