⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ictransform.c

📁 按照官方的说法:Cairo is a vector graphics library with cross-device output support. 翻译过来
💻 C
字号:
/* * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission.  SuSE makes no representations about the * suitability of this software for any purpose.  It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author:  Keith Packard, SuSE, Inc. */#include "icint.h"#define MAX_FIXED_48_16	    ((xFixed_48_16) 0x7fffffff)#define MIN_FIXED_48_16	    (-((xFixed_48_16) 1 << 31))intpixman_transform_point (pixman_transform_t	*transform,		  pixman_vector_t	*vector){    pixman_vector_t	    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 0;	result.vector[j] = (xFixed) v;    }    if (!result.vector[2])	return 0;    for (j = 0; j < 2; j++)    {	partial = (xFixed_48_16) result.vector[j] << 16;	v = partial / result.vector[2];	if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16)	    return 0;	vector->vector[j] = (xFixed) v;    }    vector->vector[2] = xFixed1;    return 1;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -