2 * imbuf.h (mar-2001 nzc)
4 * This header might have to become external...
8 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version. The Blender
14 * Foundation also sells licenses for use in proprietary software under
15 * the Blender License. See http://www.blender.org/BL/ for information
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software Foundation,
25 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
28 * All rights reserved.
30 * The Original Code is: all of this file.
32 * Contributor(s): none yet.
34 * ***** END GPL/BL DUAL LICENSE BLOCK *****
41 #include <sys/types.h>
57 #if !defined(WIN32) && !defined(__BeOS)
61 #define SWAP_SHORT(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff))
62 #define SWAP_LONG(x) (((x) << 24) | (((x) & 0xff00) << 8) | (((x) >> 8) & 0xff00) | (((x) >> 24) & 0xff))
64 #define ENDIAN_NOP(x) (x)
66 #if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || (defined (__APPLE__) && !defined(__LITTLE_ENDIAN__))
67 #define LITTLE_SHORT SWAP_SHORT
68 #define LITTLE_LONG SWAP_LONG
69 #define BIG_SHORT ENDIAN_NOP
70 #define BIG_LONG ENDIAN_NOP
72 #define LITTLE_SHORT ENDIAN_NOP
73 #define LITTLE_LONG ENDIAN_NOP
74 #define BIG_SHORT SWAP_SHORT
75 #define BIG_LONG SWAP_LONG
78 #define malloc(x) MEM_mallocN(x, __FILE__)
79 #define free(x) MEM_freeN(x)
80 #define calloc(x,y) MEM_callocN((x)*(y), __FILE__)
81 #define freelist(x) BLI_freelistN(x)
85 #define calloc(x,y) ib_calloc((x),(y))
87 #define malloc(x) ib_malloc(x)
89 #define free(x) ib_free(x)
91 #define memcpy(x,y,z) ib_memcpy((x),(y),(z))
93 #define abs(x) ib_abs(x)
94 void (*ib_fprin_tf)();
95 #define fprintf ib_fprin_tf
97 #define sprintf ib_sprin_tf
99 #define printf ib_prin_tf
101 #define lseek(x,y,z) ib_lseek((x),(y),(z))
103 #define mmap(u,v,w,x,y,z) ib_mmap((u),(v),(w),(x),(y),(z))
105 #define munmap(x,y) ib_munmap((x),(y))
107 #define open(x,y) ib_open((x),(y))
109 #define close(x) ib_close(x)
111 #define write(x,y,z) ib_write((x),(y),(z))
113 #define read(x,y,z) ib_read((x),(y),(z))
115 #define fchmod(x,y) ib_fchmod((x),(y))
117 #define remove(x) ib_remove(x)
118 size_t (*ib_strlen)();
119 #define strlen(x) ib_strlen(x)
121 #define isdigit(x) ib_isdigit(x)
122 char *(*ib_strcpy)();
123 #define strcpy(x,y) ib_strcpy((x),(y))
125 #define atoi(x) ib_atoi(x)
126 char *(*ib_strcat)();
127 #define strcat(x,y) ib_strcat((x),(y))
129 /* #define stat(x,y) ib_stat((x),(y)) */
140 #define WIDTHB(x) (((x+15)>>4)<<1)
142 extern unsigned short *quadr;
143 extern float dyuvrgb[4][4];
144 extern float rgbdyuv[4][4];
151 unsigned short xorig, yorig;
159 unsigned short w, h; /* in pixels */
165 unsigned short transparentColor;
166 char xAspect, yAspect;
167 short pageWidth, pageHeight;