// build transform matrix
fz_matrix transform = fz_pre_rotate(fz_scale(scaleX, scaleY), rotation);
// build invert matrix
fz_matrix invertctm = fz_invert_matrix(transform
//martrix translation
fz_rect rect, bounds;
bounds = fz_transform_rect(rect,x_offset,y_offxet);
//image translation
fz_rect rect = r;
fz_matrix image_ctm;
// caculate image matrix and fill image
image_ctm = fz_pre_translate(fz_identity, rect.x0 - index*(rect.x1 - rect.x0), rect.y0);
if(count != 0)
{
image_ctm = fz_pre_scale(image_ctm, (rect.x1 - rect.x0)*count, rect.y1 - rect.y0);
}
else
image_ctm = fz_pre_scale(image_ctm, rect.x1 - rect.x0, rect.y1 - rect.y0);
rect = fz_unit_rect;
rect = fz_transform_rect(rect, image_ctm);
Mupdf的矩阵操作
最新推荐文章于 2024-07-09 16:37:57 发布