fixed 4 uses of un-inirialized vars + some compiler warnings.
[blender.git] / source / blender / imbuf / intern / cineon / cineonfile.h
1 /** \file blender/imbuf/intern/cineon/cineonfile.h
2  *  \ingroup imbcineon
3  */
4 /*
5  *       Cineon image file format library definitions.
6  *       Cineon file format structures.
7  *
8  *       This header file contains private details.
9  *       User code should generally use cineonlib.h only.
10  *
11  *       Copyright 1999,2000,2001 David Hodson <hodsond@acm.org>
12  *
13  *       This program is free software; you can redistribute it and/or modify it
14  *       under the terms of the GNU General Public License as published by the Free
15  *       Software Foundation; either version 2 of the License, or (at your option)
16  *       any later version.
17  *
18  *       This program is distributed in the hope that it will be useful, but
19  *       WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  *       or FITNESS FOR A PARTICULAR PURPOSE.    See the GNU General Public License
21  *       for more details.
22  *
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
25  *       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  */
28
29 #ifndef _CINEON_FILE_H_
30 #define _CINEON_FILE_H_
31
32 #include "logImageCore.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 typedef struct {
39                 U32             magic_num;                              /* magic number */
40                 U32             image_offset;                   /* offset to image data in bytes */
41                 U32             gen_hdr_size;                   /* generic header length in bytes */
42                 U32             ind_hdr_size;                   /* industry header length in bytes */
43                 U32             user_data_size;         /* user-defined data length in bytes */
44                 U32             file_size;                              /* file size in bytes */
45                 ASCII vers[8];                                  /* which header format version is being used (v4.5) */
46                 ASCII file_name[100];           /* image file name */
47                 ASCII create_date[12];  /* file creation date */
48                 ASCII create_time[12];  /* file creation time */
49                 ASCII Reserved[36];                     /* reserved field TBD (need to pad) */
50 } CineonFileInformation;
51
52 typedef struct {
53                 U8               designator1;
54                 U8               designator2;
55                 U8               bits_per_pixel;
56                 U8               filler;
57                 U32              pixels_per_line;
58                 U32              lines_per_image;
59                 U32              ref_low_data;           /* reference low data code value */
60                 R32              ref_low_quantity; /* reference low quantity represented */
61                 U32              ref_high_data;          /* reference high data code value */
62                 R32              ref_high_quantity;/* reference high quantity represented */
63 } CineonChannelInformation;
64
65 typedef struct {
66                 U8               orientation;                                    /* image orientation */
67                 U8               channels_per_image;
68                 U16              filler;
69                 CineonChannelInformation channel[8];
70                 R32              white_point_x;
71                 R32              white_point_y;
72                 R32              red_primary_x;
73                 R32              red_primary_y;
74                 R32              green_primary_x;
75                 R32              green_primary_y;
76                 R32              blue_primary_x;
77                 R32              blue_primary_y;
78                 ASCII    label[200];
79                 ASCII    reserved[28];
80 } CineonImageInformation;
81
82 typedef struct {
83                 U8              interleave;
84                 U8              packing;
85                 U8              signage;
86                 U8              sense;
87                 U32             line_padding;
88                 U32             channel_padding;
89                 ASCII reserved[20];
90 } CineonFormatInformation;
91
92 typedef struct {
93                 S32             x_offset;
94                 S32             y_offset;
95                 ASCII file_name[100];
96                 ASCII create_date[12];  /* file creation date */
97                 ASCII create_time[12];  /* file creation time */
98                 ASCII input_device[64];
99                 ASCII model_number[32];
100                 ASCII serial_number[32];
101                 R32             x_input_samples_per_mm;
102                 R32             y_input_samples_per_mm;
103                 R32             input_device_gamma;
104                 ASCII reserved[40];
105 } CineonOriginationInformation;
106
107 typedef struct {
108         CineonFileInformation fileInfo;
109         CineonImageInformation imageInfo;
110         CineonFormatInformation formatInfo;
111         CineonOriginationInformation originInfo;
112 } CineonGenericHeader;
113
114 typedef struct {
115         U8 filmCode;
116         U8 filmType;
117         U8 perfOffset;
118         U8 filler;
119         U32 keycodePrefix;
120         U32 keycodeCount;
121         ASCII format[32];
122         U32 framePosition; /* in sequence */
123         R32 frameRate; /* frames per second */
124         ASCII attribute[32];
125         ASCII slate[200];
126         ASCII reserved[740];
127 } CineonMPISpecificInformation;
128
129 #if 0
130 /* create CineonFile from data in header */
131 /* return 0 for OK */
132 int readCineonGenericHeader(CineonFile* cineon, CineonGenericHeader* header);
133
134 /* create header from data in CineonFile */
135 int initCineonGenericHeader(
136         CineonFile* cineon, CineonGenericHeader* header, const char* imagename);
137
138 /* Note: dump routine assumes network byte order */
139 void dumpCineonGenericHeader(CineonGenericHeader* header);
140 #endif
141
142 #ifdef __cplusplus
143 }
144 #endif
145
146 #endif /* _CINEON_FILE_H_ */