37 #include <Base/ImageUtils/ImageDraw.hh>
38 #include <Base/Image/ImageIO.hh>
39 #include <Base/Math/Matrix.hh>
40 #include <Base/Math/Vector.hh>
41 #include <Base/Math/Vector2.hh>
42 #include <MathAlgo/BSplineCurve.hh>
49 unsigned int imgCounter=0;
50 unsigned char value[1];
74 sprintf(title,
"ExampleBSplineCurve%01i.mip",imgCounter++);
100 sprintf(title,
"ExampleBSplineCurve%01i.mip",imgCounter++);
115 BSplineCurve bsplineQuadraticOpen,bsplineQuadraticClosed,
116 bsplineCubicOpen,bsplineCubicClosed;
119 std::vector<BIAS::Vector2<double> > cPnt;
123 cPnt.push_back(item);
126 cPnt.push_back(item);
129 cPnt.push_back(item);
132 cPnt.push_back(item);
136 cPnt.push_back(item);
140 cPnt.push_back(item);
144 cPnt.push_back(item);
148 cPnt.push_back(item);
152 cPnt.push_back(item);
156 cPnt.push_back(item);
160 cPnt.push_back(item);
164 cPnt.push_back(item);
167 for(
unsigned int i=0;i<cPnt.size();i++)
168 cPnt[i].DivideIP(10);
209 cPnt.push_back(item);
212 cPnt.push_back(item);
215 cPnt.push_back(item);
218 cPnt.push_back(item);
221 cPnt.push_back(item);
224 cPnt.push_back(item);
227 cPnt.push_back(item);
230 cPnt.push_back(item);
233 cPnt.push_back(item);
236 cPnt.push_back(item);
239 cPnt.push_back(item);
243 cPnt.push_back(item);
254 drawQuadratic(bsplineQuadraticOpen);
257 drawQuadratic(bsplineQuadraticClosed);
260 drawCubic(bsplineCubicOpen);
263 drawCubic(bsplineCubicClosed);
void InitQuadraticUniformBSpline()
computes coefficients for all segments of a quadratic uniform B-spline
void CubicUniformBSpline(Vector2< double > &res, double t)
computes the point on a cubic uniform B-spline curve at time t
static int Line(Image< StorageType > &im, const unsigned int start[2], const unsigned int end[2], const StorageType value[])
lines
this class is intended for drawing of quadratic and cubic regular B-Splines from given control points...
void FillImageWithConstValue(StorageType Value)
fill grey images
void InitCubicUniformBSpline()
computes coefficients for all segments of a cubic uniform B-spline
void SetControlPoints(std::vector< BIAS::Vector2< double > > &cPnt)
set the control points, which control the interpolating curve
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
void QuadraticUniformBSpline(Vector2< double > &res, double t)
computes the point on a quadratic uniform B-spline curve at time t