1 /***************************************************************************
2  *                                                                         *
3  *   copyright : (C) 2015 C. Barth Netterfield                             *
4  *                   netterfield@astro.utoronto.ca                         *
5  *                                                                         *
6  *   This program is free software; you can redistribute it and/or modify  *
7  *   it under the terms of the GNU General Public License as published by  *
8  *   the Free Software Foundation; either version 2 of the License, or     *
9  *   (at your option) any later version.                                   *
10  *                                                                         *
11  ***************************************************************************/
12 
13 #ifndef BIS_H
14 #define BIS_H
15 
16 #ifdef __cplusplus
17     extern "C" {
18 #endif
19 
20 #define BIS_OK 0
21 #define BIS_NOOPEN 1
22 #define BIS_UNKNOWN 2
23 
24 extern char *BIS_ERRORSTR[];
25 
26 typedef struct {
27   int fp;
28   char *fileName;
29   int status;
30   int frameSize;
31   int formatType;
32   int imagesPerFrame;
33 } BISfile;
34 
35 
36 typedef struct {
37   unsigned short w;
38   unsigned short h;
39   unsigned short x;
40   unsigned short y;
41   int allocated;
42   unsigned char *img;
43 } BISimage;
44 
45 BISfile *BISopen(char *filename);
46 void BISclose(BISfile *bis);
47 
48 int isBISfile(char *filename);
49 
50 int BISnframes(BISfile *bis);
51 
52 int BISreadimage(BISfile *bis, int frame, int i_img, BISimage *I);
53 
54 void BISInitImage(BISimage *image);
55 void BISFreeImage(BISimage *image);
56 
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif
63