// OFPyramid.cpp: implementation of the COFPyramid class. // ////////////////////////////////////////////////////////////////////// #include #include "OFPyramid.h" #include "OpticalFlow.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// COFPyramid::COFPyramid() { Depth = 0; Pyramid = new COpticalFlow *[1](); Pyramid[0] = new COpticalFlow(); printf("COFPyramid class (new optical flow pyramid): succesfull...\n"); } COFPyramid::~COFPyramid() { for (int i = 0; i < Depth; i++){ Pyramid[i]->~COpticalFlow(); } } int COFPyramid::GetDepth() { return Depth; } COFPyramid::COFPyramid(int x, int y, int d) { int sx, sy; Depth = d; if (d < 0) Depth = 0; Pyramid = new COpticalFlow *[Depth](); //Pyramid[0] = new CPMImage(FileName); sx = x; sy = y; for (int i = 0; i < Depth; i++){ Pyramid[i] = new COpticalFlow(sx, sy); sx = sx >> 1; sy = sy >> 1; if (sx < 1) sx = 1; if (sy < 1) sy = 1; } printf("COFPyramid class (new optical flow pyramid, depth = %d): succesfull...\n", Depth); }