69,335
社区成员
发帖
与我相关
我的任务
分享
typedef struct
{
size_t *p;
size_t buf[2];
}xxMatStep;
typedef struct
{
int rows;
int cols;
xxMatStep step1;
}XxMat;
static void xxMatStep_Construct_Without_Param( xxMatStep *step1 )
{
step1->p = step1->buf;
step1->p[0] = step1->p[1];
}
static void xxMat_Construct_Without_Param( xxMat *mat )
{
mat->rows = 0;
mat->cols = 0;
xxMatStep_Construct_Without_Param( &mat->step1 );
}
static XxMat xxMat2( int rows, int cols, int step )
{
XxMat m;
xxMat_Construct_Without_Param(&m);
m.rows = rows;
m.cols = cols;
m.step1.p[0] = step;
m.step1.p[1] = 1;
return m;
}
XxMat cur_mat = xxMat2( 1280, 720, 1280 );
static void xxMat_DownSample( XxMat *src, XxMat *dst )
{
int sstep = src->step1.p[0];
int dstep = dst->step1.p[0];
//...
}