compositor: implement inverse matrix transformation
authorPekka Paalanen <ppaalanen@gmail.com>
Mon, 16 Jan 2012 12:27:00 +0000 (14:27 +0200)
committerPekka Paalanen <ppaalanen@gmail.com>
Fri, 27 Jan 2012 08:44:22 +0000 (10:44 +0200)
commit75b47ec45d8076732b3f30c1b3ebc3d35e6ed7fe
tree9b142a2aba86b5f889d57bec1ad7230f10e79094
parent061b7471f1cca72c98ebec53d0e89e8166ed30f3
compositor: implement inverse matrix transformation

Implement 4x4 matrix inversion based on LU-decomposition with partial
pivoting.

Instead of simply computing the inverse matrix explicitly, introduce the
type struct weston_inverse_matrix for storing the LU-decomposition and
the permutation from pivoting. Using doubles, this struct has greater
precision than struct weston_matrix.

If you need only few (less than 5, presumably) multiplications with the
inverse matrix, is it cheaper to use weston_inverse_matrix, and not
compute the inverse matrix explicitly into a weston_matrix.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
src/compositor.c
src/compositor.h
src/matrix.c
src/matrix.h