25 #define PACKIDENTIFIER "\nCCP4 packed image, X: %04d, Y: %04d\n"
32 #define V2IDENTIFIER "\nCCP4 packed image V2, X: %04d, Y: %04d\n"
39 #define PACKBUFSIZ BUFSIZ
45 #define DIFFBUFSIZ 16384L
56 #define WORD short int
72 #define max(x, y) (((x) > (y)) ? (x) : (y))
75 #define min(x, y) (((x) < (y)) ? (x) : (y))
79 #define abs(x) (((x) < 0) ? (-(x)) : (x))
84 static LONG setbits[33] =
85 {0x00000000L, 0x00000001L, 0x00000003L, 0x00000007L,
86 0x0000000FL, 0x0000001FL, 0x0000003FL, 0x0000007FL,
87 0x000000FFL, 0x000001FFL, 0x000003FFL, 0x000007FFL,
88 0x00000FFFL, 0x00001FFFL, 0x00003FFFL, 0x00007FFFL,
89 0x0000FFFFL, 0x0001FFFFL, 0x0003FFFFL, 0x0007FFFFL,
90 0x000FFFFFL, 0x001FFFFFL, 0x003FFFFFL, 0x007FFFFFL,
91 0x00FFFFFFL, 0x01FFFFFFL, 0x03FFFFFFL, 0x07FFFFFFL,
92 0x0FFFFFFFL, 0x1FFFFFFFL, 0x3FFFFFFFL, 0x7FFFFFFFL,
101 #define shift_left(x, n) (((x) & setbits[32 - (n)]) << (n))
108 #define shift_right(x, n) (((x) >> (n)) & setbits[32 - (n)])
120 #if defined (PROTOTYPE)
121 void v2pack_wordimage_c(WORD *img,
int x,
int y,
char *filename);
125 void v2pack_longimage_c(LONG *img,
int x,
int y,
char *filename);
133 void readpack_word_c(WORD *img,
char *filename);
138 void readpack_long_c(LONG *img,
char *filename);
143 void imsiz_c(
char *filename, LONG *x, LONG *y);