X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxtools.c;h=86970a2776f6d4743cb94cbad77d304418207743;hb=b297c77630e356035a75d9c4297ba1d6ed424b16;hp=76525ea502ed72578aa21390bbd6c6c234334aa7;hpb=a5c6cfc6f6b4ffdcee8e63116b0c507b0388cac0;p=swftools.git diff --git a/lib/gfxtools.c b/lib/gfxtools.c index 76525ea..86970a2 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -705,6 +705,21 @@ void gfxmatrix_invert(gfxmatrix_t*m, gfxmatrix_t*dest) dest->tx = -(dest->m00 * m->tx + dest->m10 * m->ty); dest->ty = -(dest->m01 * m->tx + dest->m11 * m->ty); } +void gfxmatrix_unit(gfxmatrix_t*m) +{ + memset(m, 0, sizeof(gfxmatrix_t)); + m->m00 = 1.0; + m->m11 = 1.0; +} +void gfxmatrix_multiply(gfxmatrix_t*m1, gfxmatrix_t*m2, gfxmatrix_t*dest) +{ + dest->m00 = m1->m00*m2->m00 + m1->m10*m2->m01 + m1->tx; + dest->m01 = m1->m01*m2->m00 + m1->m11*m2->m01 + m1->ty; + dest->m10 = m1->m00*m2->m10 + m1->m10*m2->m11 + m1->tx; + dest->m11 = m1->m01*m2->m10 + m1->m11*m2->m11 + m1->ty; + dest->tx = m1->m00*m2->tx + m1->m10*m2->ty + m1->tx; + dest->ty = m1->m01*m2->tx + m1->m11*m2->ty + m1->ty; +} gfxfontlist_t* gfxfontlist_create() {