-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReformHelper.cpp
36 lines (27 loc) · 1.35 KB
/
ReformHelper.cpp
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
// get interpolated value and store in appropriate format
#ifndef REFORMHELPER_CPP_V_C_MOHAN
#define REFORMHELPER_CPP_V_C_MOHAN
//--------------------------------------------------------------------------------------------------
template <typename finc>
void PutClampedInterpolatedValue( finc * dstp, const finc * srcp, int pitch, int plane,
int h, int w, int sx, int sy,int qx, int qy, int span,float * lbuf, finc min, finc max);
template <typename finc>
void PutNearestPointvalue( finc * dstp, const finc * srcp, int pitch, int kb,
int h, int w, int sx, int sy, finc min, finc max);
//---------------------------------------------------------------------------------------------------
template <typename finc>
void PutClampedInterpolatedValue( finc * dstp, const finc * srcp, int pitch, int plane,
int h, int w, int sx, int sy,int qx, int qy, int span,float * lbuf, finc min, finc max)
{
dstp[(h ) * pitch + w ]
= clamp( LaQuantile (srcp + sy * pitch + sx, pitch, span, qx, qy, lbuf), min, max);
}
//------------------------------------------------------------------------------------------------------
template <typename finc>
void PutNearestPointvalue( finc * dstp, const finc * srcp, int pitch, int kb,
int h, int w, int sx, int sy)
{
dstp[h * pitch + w * kb ]
= srcp [ sy * pitch + sx * kb];
}
#endif