3 CvGrowMat::CvGrowMat(int maxlines
, int maxcols
, int type
)
5 mat
= cvCreateMat(maxlines
, maxcols
, type
);
7 cvGetSubRect(mat
, this, cvRect(0,0,maxcols
,maxlines
));
10 CvGrowMat::~CvGrowMat()
15 void CvGrowMat::resize(int lines
, int cols
)
17 if (lines
<= mat
->rows
&& cols
<= mat
->cols
) {
18 cvGetSubRect(mat
, this, cvRect(0,0,cols
,lines
));
22 int nl
= (lines
> mat
->rows
? lines
*2 : mat
->rows
);
23 int nc
= (cols
> mat
->cols
? cols
*2 : mat
->cols
);
24 CvMat
*nm
= cvCreateMat(nl
, nc
, mat
->type
);
26 if (this->rows
&& this->cols
) {
28 cvGetSubRect(nm
, &sub
, cvRect(0,0,this->cols
, this->rows
));
30 cvGetSubRect(nm
, this, cvRect(0,0,cols
, lines
));
32 cvGetSubRect(nm
, this, cvRect(0,0,mat
->cols
, mat
->rows
));