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