Blender V2.61 - r43446
|
00001 /* 00002 * imbuf.h (mar-2001 nzc) 00003 * 00004 * This header might have to become external... 00005 * 00006 * 00007 * ***** BEGIN GPL LICENSE BLOCK ***** 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License 00011 * as published by the Free Software Foundation; either version 2 00012 * of the License, or (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software Foundation, 00021 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 * 00023 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00024 * All rights reserved. 00025 * 00026 * The Original Code is: all of this file. 00027 * 00028 * Contributor(s): none yet. 00029 * 00030 * ***** END GPL LICENSE BLOCK ***** 00031 */ 00032 00038 #ifndef IMBUF_H 00039 #define IMBUF_H 00040 00041 #include <stdlib.h> 00042 #include <sys/types.h> 00043 #include <stdio.h> 00044 00045 #ifndef WIN32 00046 # include <unistd.h> 00047 #endif 00048 00049 #include <fcntl.h> 00050 #include <sys/stat.h> 00051 #include <string.h> 00052 #include <math.h> 00053 00054 #ifndef WIN32 00055 # include <sys/mman.h> 00056 # define O_BINARY 0 00057 #endif 00058 00059 #define SWAP_SHORT(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff)) 00060 #define SWAP_LONG(x) (((x) << 24) | (((x) & 0xff00) << 8) | (((x) >> 8) & 0xff00) | (((x) >> 24) & 0xff)) 00061 00062 #define ENDIAN_NOP(x) (x) 00063 00064 #ifdef __BIG_ENDIAN__ 00065 # define LITTLE_SHORT SWAP_SHORT 00066 # define LITTLE_LONG SWAP_LONG 00067 # define BIG_SHORT ENDIAN_NOP 00068 # define BIG_LONG ENDIAN_NOP 00069 #else 00070 # define LITTLE_SHORT ENDIAN_NOP 00071 # define LITTLE_LONG ENDIAN_NOP 00072 # define BIG_SHORT SWAP_SHORT 00073 # define BIG_LONG SWAP_LONG 00074 #endif 00075 00076 typedef unsigned char uchar; 00077 00078 #define TRUE 1 00079 #define FALSE 0 00080 00081 #endif /* IMBUF_H */ 00082