void QccRegularMeshInitialize(QccRegularMesh *mesh);
int QccRegularMeshAlloc(QccRegularMesh
*mesh);
void QccRegularMeshFree(QccRegularMesh *mesh);
int QccRegularMeshGenerate(QccRegularMesh
*mesh, const QccPoint *range_upper, const QccPoint *range_lower);
int
QccRegularMeshNumTriangles(const QccRegularMesh *mesh);
int QccRegularMeshToTriangles(const QccRegularMesh *mesh, QccTriangle *triangles);
typedef struct
{
int num_rows;
int num_cols;
QccPoint **vertices;
} QccRegularMesh;
The fields of QccRegularMesh are as follows:
num_rows: 0
num_cols: 0
vertices: NULL
QccRegularMeshAlloc() allocates mesh. The num_rows and num_cols fields of mesh must be defined prior to calling QccRegularMeshAlloc().
QccRegularMeshFree() frees the vertices array previously allocated by QccRegularMeshAlloc().
QccRegularMeshGenerate() fills in the vertices array of mesh with equally spaced points in the rectangular box specified by range_upper and range_lower. range_upper gives the upper-left corner of the box, while range_lower gives the lower-right corner of the box. The points have a horizontal spacing of delta_x and a vertical spacing of delta_y, where delta_x = (range_upper->x - range_lower->x) / (mesh->num_cols - 1) and delta_y = (range_upper->y - range_lower->y) / (mesh->num_rows - 1). The mesh must be allocated via a call to QccRegularMeshAllocate() prior to calling QccRegularMeshGenerate(), and both the num_rows and num_cols fields of mesh must be greater than 1.
QccRegularMeshNumTriangles() calculates the number of triangles that will be produced from mesh by QccRegularMeshToTriangles().
QccRegularMeshToTriangles() creates a list of triangles from mesh by dividing each rectangle between four adjacent vertices in mesh along the diagonal to produce two triangles. The resulting triangles are returned in the array triangles which must be allocated prior to calling QccRegularMeshToTriangles().
Y. Altunbasak, A. M. Tekalp, and G. Bozdagi, "Two-Dimensional Object-based Coding Using a Content-based Mesh and Affine Motion Parameterization," in Proceedings of the International Conference on Image Processing, Washington, DC, October 1995, vol. 2, pp. 394-397.