-
Notifications
You must be signed in to change notification settings - Fork 0
/
GW_IntegralDataChunk.inl
executable file
·89 lines (80 loc) · 2.86 KB
/
GW_IntegralDataChunk.inl
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*------------------------------------------------------------------------------*/
/**
* \file GW_IntegralDataChunk.inl
* \brief Inlined methods for \c GW_IntegralDataChunk
* \author Gabriel Peyré
* \date 11-12-2002
*/
/*------------------------------------------------------------------------------*/
#include "GW_IntegralDataChunk.h"
GW_BEGIN_NAMESPACE
/*------------------------------------------------------------------------------*/
// Name : GW_IntegralDataChunk::GetIntegral
/**
* \return [GW_Float] The value of the integral.
* \author Gabriel Peyré
* \date 11-12-2002
*
* Return the value of the integral of the scale function.
*/
/*------------------------------------------------------------------------------*/
GW_INLINE
GW_Float GW_IntegralDataChunk::GetIntegral(GW_U32 nLevel)
{
GW_ASSERT( nLevel<IntegralValues_.size() );
return IntegralValues_[nLevel];
}
/*------------------------------------------------------------------------------*/
// Name : GW_IntegralDataChunk::SetIntegral
/**
* \param rVal [GW_Float] The integral value.
* \author Gabriel Peyré
* \date 11-12-2002
*
* Set the value of the integral. This should be set by the wavelet transform
* only once, using a recursing scheme (compute the integral on the finest level using
* aproximation).
*/
/*------------------------------------------------------------------------------*/
GW_INLINE
void GW_IntegralDataChunk::SetIntegral(GW_Float rVal, GW_I32 nLevel)
{
GW_ASSERT( nLevel>=0 );
GW_I32 nLastLevel = (GW_I32) IntegralValues_.size()-1;
if( nLevel>nLastLevel )
{
/* the map isn't large enough */
for( GW_I32 i=nLastLevel; i<nLevel; i++ )
IntegralValues_.push_back(0);
}
IntegralValues_[nLevel] = rVal;
}
/*------------------------------------------------------------------------------*/
// Name : GW_IntegralDataChunk::AddIntegral
/**
* \param rVal [GW_Float] The integral value.
* \author Gabriel Peyré
* \date 11-12-2002
*
* Add some value to the integral already computed.
*/
/*------------------------------------------------------------------------------*/
GW_INLINE
void GW_IntegralDataChunk::AddIntegral(GW_Float rVal, GW_I32 nLevel)
{
GW_ASSERT( nLevel>=0 );
GW_I32 nLastLevel = (GW_I32) IntegralValues_.size()-1;
if( nLevel>nLastLevel )
{
/* the map isn't large enough */
for( GW_I32 i=nLastLevel; i<nLevel; i++ )
IntegralValues_.push_back(0);
}
IntegralValues_[nLevel] += rVal;
}
GW_END_NAMESPACE
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Gabriel Peyré
///////////////////////////////////////////////////////////////////////////////
// END OF FILE //
///////////////////////////////////////////////////////////////////////////////