MCPcopy Create free account
hub / github.com/beefytech/Beef / Init

Method Init

BeefySysLib/img/ImgEffects.cpp:79–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void ImageCurve::Init()
80{
81 CubicFuncSpline* curSpline = NULL;
82
83 for (int i = 0; i < (int) mPoints.size(); i++)
84 {
85 ImageCurvePoint* pt = &mPoints[i];
86 if (pt->mIsCorner)
87 {
88 if (curSpline != NULL)
89 {
90 curSpline->AddPt(pt->mX, pt->mY);
91 curSpline = NULL;
92 }
93 }
94 else
95 {
96 if (curSpline == NULL)
97 {
98 curSpline = new CubicFuncSpline();
99 pt->mIsSplineOwner = true;
100 }
101
102 pt->mSpline = curSpline;
103 curSpline->AddPt(pt->mX, pt->mY);
104 }
105 }
106
107 /*{
108 std::fstream stream("c:\\temp\\curve.csv", std::ios::out);
109 for (int i = 0; i < (int) 255; i++)
110 {
111 float aVal = GetVal(i);
112 stream << aVal << std::endl;
113 }
114 BF_ASSERT(stream.is_open());
115 stream.flush();
116 }
117
118 _asm nop;*/
119}
120
121float ImageCurve::GetVal(float x)
122{

Callers 1

FlattenIntoMethod · 0.45

Calls 4

CreateContourDataTableFunction · 0.85
sizeMethod · 0.45
AddPtMethod · 0.45
GetValMethod · 0.45

Tested by

no test coverage detected