5 * Copyright (C) 2004 Daniel Borca All Rights Reserved.
7 * this is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * this is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Make; see the file COPYING. If not, write to
19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef INTERNAL_H_included
24 #define INTERNAL_H_included
26 /*****************************************************************************\
28 \*****************************************************************************/
31 #define TAPI __declspec(dllexport)
32 #define TAPIENTRY __stdcall
39 /*****************************************************************************\
40 * 64bit types on 32bit machine
41 \*****************************************************************************/
43 #if defined(__GNUC__) && !defined(__cplusplus)
45 typedef unsigned long long qword
;
47 #define Q_MOV32(a, b) a = b
48 #define Q_OR32(a, b) a |= b
49 #define Q_SHL(a, c) a <<= c
57 #define Q_MOV32(a, b) a.lo = b
58 #define Q_OR32(a, b) a.lo |= b
62 a.hi = a.lo << ((c) - 32); \
65 a.hi = (a.hi << (c)) | (a.lo >> (32 - (c)));\
70 #endif /* !__GNUC__ */
73 /*****************************************************************************\
75 \*****************************************************************************/
83 /*****************************************************************************\
85 \*****************************************************************************/
87 #define F(i) (float)1 /* can be used to obtain an oblong metric: 0.30 / 0.59 / 0.11 */
88 #define SAFECDOT 1 /* for paranoids */
90 #define MAKEIVEC(NV, NC, IV, B, V0, V1) \
92 /* compute interpolation vector */\
96 for (i = 0; i < NC; i++) { \
97 IV[i] = (V1[i] - V0[i]) * F(i);\
98 d2 += IV[i] * IV[i]; \
100 rd2 = (float)NV / d2; \
102 for (i = 0; i < NC; i++) { \
104 B -= IV[i] * V0[i]; \
107 B = B * rd2 + 0.5F; \
110 #define CALCCDOT(TEXEL, NV, NC, IV, B, V)\
113 for (i = 0; i < NC; i++) { \
114 dot += V[i] * IV[i]; \
116 TEXEL = (int)(dot + B); \
120 } else if (TEXEL > NV) { \
127 /*****************************************************************************\
129 \*****************************************************************************/
132 _mesa_upscale_teximage2d (unsigned int inWidth
, unsigned int inHeight
,
133 unsigned int outWidth
, unsigned int outHeight
,
135 const byte
*src
, int srcRowStride
,
136 unsigned char *dest
);