Parent Directory
|
Revision Log
Added routines to decode YCoCg and alpha exponent encoded images. They can be found in the Filters/Colors menu.
1 /* 2 DDS GIMP plugin 3 4 Copyright (C) 2004-2008 Shawn Kirst <skirst@insightbb.com>, 5 with parts (C) 2003 Arne Reuter <homepage@arnereuter.de> where specified. 6 7 This program is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public 9 License as published by the Free Software Foundation; either 10 version 2 of the License, or (at your option) any later version. 11 12 This program 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 GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; see the file COPYING. If not, write to 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 Boston, MA 02111-1307, USA. 21 */ 22 23 #ifndef ENDIAN_H 24 #define ENDIAN_H 25 26 #define GETL64(buf) \ 27 (((unsigned long long)(buf)[0] ) | \ 28 ((unsigned long long)(buf)[1] << 8) | \ 29 ((unsigned long long)(buf)[2] << 16) | \ 30 ((unsigned long long)(buf)[3] << 24) | \ 31 ((unsigned long long)(buf)[4] << 32) | \ 32 ((unsigned long long)(buf)[5] << 40) | \ 33 ((unsigned long long)(buf)[6] << 48) | \ 34 ((unsigned long long)(buf)[7] << 56)) 35 36 #define GETL32(buf) \ 37 (((unsigned int)(buf)[0] ) | \ 38 ((unsigned int)(buf)[1] << 8) | \ 39 ((unsigned int)(buf)[2] << 16) | \ 40 ((unsigned int)(buf)[3] << 24)) 41 42 #define GETL16(buf) \ 43 (((unsigned short)(buf)[0] ) | \ 44 ((unsigned short)(buf)[1] << 8)) 45 46 #define PUTL16(buf, s) \ 47 (buf)[0] = ((s) ) & 0xff; \ 48 (buf)[1] = ((s) >> 8) & 0xff; 49 50 #define PUTL32(buf, l) \ 51 (buf)[0] = ((l) ) & 0xff; \ 52 (buf)[1] = ((l) >> 8) & 0xff; \ 53 (buf)[2] = ((l) >> 16) & 0xff; \ 54 (buf)[3] = ((l) >> 24) & 0xff; 55 56 #define PUTL64(buf, ll) \ 57 (buf)[0] = ((ll) ) & 0xff; \ 58 (buf)[1] = ((ll) >> 8) & 0xff; \ 59 (buf)[2] = ((ll) >> 16) & 0xff; \ 60 (buf)[3] = ((ll) >> 24) & 0xff; \ 61 (buf)[4] = ((ll) >> 32) & 0xff; \ 62 (buf)[5] = ((ll) >> 40) & 0xff; \ 63 (buf)[6] = ((ll) >> 48) & 0xff; \ 64 (buf)[7] = ((ll) >> 56) & 0xff; 65 66 #endif
| ViewVC Help | |
| Powered by ViewVC 1.0.4 |