Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygeninternal.h
Go to the documentation of this file.
00001 /* 00002 * Texture compression 00003 * Version: 1.0 00004 * 00005 * Copyright (C) 2004 Daniel Borca All Rights Reserved. 00006 * 00007 * this is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2, or (at your option) 00010 * any later version. 00011 * 00012 * this is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with GNU Make; see the file COPYING. If not, write to 00019 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 00020 */ 00021 00022 00023 #ifndef INTERNAL_H_included 00024 #define INTERNAL_H_included 00025 00026 /*****************************************************************************\ 00027 * DLL stuff 00028 \*****************************************************************************/ 00029 00030 #ifdef __WIN32__ 00031 #define TAPI __declspec(dllexport) 00032 #define TAPIENTRY __stdcall 00033 #else 00034 #define TAPI 00035 #define TAPIENTRY 00036 #endif 00037 00038 00039 /*****************************************************************************\ 00040 * 64bit types on 32bit machine 00041 \*****************************************************************************/ 00042 00043 #if defined(__GNUC__) && !defined(__cplusplus) 00044 00045 typedef unsigned long long qword; 00046 00047 #define Q_MOV32(a, b) a = b 00048 #define Q_OR32(a, b) a |= b 00049 #define Q_SHL(a, c) a <<= c 00050 00051 #else /* !__GNUC__ */ 00052 00053 typedef struct { 00054 dword lo, hi; 00055 } qword; 00056 00057 #define Q_MOV32(a, b) a.lo = b 00058 #define Q_OR32(a, b) a.lo |= b 00059 #define Q_SHL(a, c) \ 00060 do { \ 00061 if ((c) >= 32) { \ 00062 a.hi = a.lo << ((c) - 32); \ 00063 a.lo = 0; \ 00064 } else { \ 00065 a.hi = (a.hi << (c)) | (a.lo >> (32 - (c)));\ 00066 a.lo <<= c; \ 00067 } \ 00068 } while (0) 00069 00070 #endif /* !__GNUC__ */ 00071 00072 00073 /*****************************************************************************\ 00074 * Config 00075 \*****************************************************************************/ 00076 00077 #define RCOMP 0 00078 #define GCOMP 1 00079 #define BCOMP 2 00080 #define ACOMP 3 00081 00082 00083 /*****************************************************************************\ 00084 * Metric 00085 \*****************************************************************************/ 00086 00087 #define F(i) (float)1 /* can be used to obtain an oblong metric: 0.30 / 0.59 / 0.11 */ 00088 #define SAFECDOT 1 /* for paranoids */ 00089 00090 #define MAKEIVEC(NV, NC, IV, B, V0, V1) \ 00091 do { \ 00092 /* compute interpolation vector */\ 00093 float d2 = 0.0F; \ 00094 float rd2; \ 00095 \ 00096 for (i = 0; i < NC; i++) { \ 00097 IV[i] = (V1[i] - V0[i]) * F(i);\ 00098 d2 += IV[i] * IV[i]; \ 00099 } \ 00100 rd2 = (float)NV / d2; \ 00101 B = 0; \ 00102 for (i = 0; i < NC; i++) { \ 00103 IV[i] *= F(i); \ 00104 B -= IV[i] * V0[i]; \ 00105 IV[i] *= rd2; \ 00106 } \ 00107 B = B * rd2 + 0.5F; \ 00108 } while (0) 00109 00110 #define CALCCDOT(TEXEL, NV, NC, IV, B, V)\ 00111 do { \ 00112 float dot = 0.0F; \ 00113 for (i = 0; i < NC; i++) { \ 00114 dot += V[i] * IV[i]; \ 00115 } \ 00116 TEXEL = (int)(dot + B); \ 00117 if (SAFECDOT) { \ 00118 if (TEXEL < 0) { \ 00119 TEXEL = 0; \ 00120 } else if (TEXEL > NV) { \ 00121 TEXEL = NV; \ 00122 } \ 00123 } \ 00124 } while (0) 00125 00126 00127 /*****************************************************************************\ 00128 * Utility functions 00129 \*****************************************************************************/ 00130 00131 void 00132 _mesa_upscale_teximage2d (unsigned int inWidth, unsigned int inHeight, 00133 unsigned int outWidth, unsigned int outHeight, 00134 unsigned int comps, 00135 const byte *src, int srcRowStride, 00136 unsigned char *dest); 00137 00138 #endif Generated on Sat May 26 2012 04:18:08 for ReactOS by
1.7.6.1
|