2 * Copyright © 2000 SuSE, Inc.
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of SuSE not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. SuSE makes no representations about the
11 * suitability of this software for any purpose. It is provided "as is"
12 * without express or implied warranty.
14 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
16 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
18 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
19 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Author: Keith Packard, SuSE, Inc.
25 #include "pixman-private.h"
28 pixman_transform_point_3d (pixman_transform_t *transform,
29 pixman_vector_t *vector)
31 pixman_vector_t result;
33 pixman_fixed_32_32_t partial;
34 pixman_fixed_48_16_t v;
36 for (j = 0; j < 3; j++)
39 for (i = 0; i < 3; i++)
41 partial = ((pixman_fixed_48_16_t) transform->matrix[j][i] *
42 (pixman_fixed_48_16_t) vector->vector[i]);
46 if (v > pixman_max_fixed_48_16 || v < pixman_min_fixed_48_16)
49 result.vector[j] = (pixman_fixed_48_16_t) v;
52 if (!result.vector[2])