diff options
author | Lars Knoll <lars@trolltech.com> | 2005-06-15 14:51:12 +0000 |
---|---|---|
committer | Lars Knoll <lars@trolltech.com> | 2005-06-15 14:51:12 +0000 |
commit | c6166ee74137084775c7550b708c5f71f16e7d3f (patch) | |
tree | bf2246f71d672133d4b54d570570273f6a95a603 /render/picture.c | |
parent | bd54b96034e640f202821eac0a2c40e66c1ddfd0 (diff) |
Fix projective transformations in fbcompose.c Bugfix for convolution
filters
Diffstat (limited to 'render/picture.c')
-rw-r--r-- | render/picture.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/render/picture.c b/render/picture.c index 8b615c664..1d2301bb3 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1485,6 +1485,35 @@ AddTraps (PicturePtr pPicture, #define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31)) Bool +PictureTransformPoint3d (PictTransformPtr transform, + PictVectorPtr vector) +{ + PictVector result; + int i, j; + xFixed_32_32 partial; + xFixed_48_16 v; + + for (j = 0; j < 3; j++) + { + v = 0; + for (i = 0; i < 3; i++) + { + partial = ((xFixed_48_16) transform->matrix[j][i] * + (xFixed_48_16) vector->vector[i]); + v += partial >> 16; + } + if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) + return FALSE; + result.vector[j] = (xFixed) v; + } + if (!result.vector[2]) + return FALSE; + *vector = result; + return TRUE; +} + + +Bool PictureTransformPoint (PictTransformPtr transform, PictVectorPtr vector) { |