code cleanup: cmake - add missing headers, remove directories from source listing.
[blender.git] / source / blender / imbuf / intern / cineon / cineonlib.h
1 /*
2  * Cineon image file format library definitions.
3  * Also handles DPX files (almost)
4  *
5  * Copyright 1999,2000,2001 David Hodson <hodsond@acm.org>
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  * Contributor(s): Julien Enche.
22  *
23  */
24
25 /** \file blender/imbuf/intern/cineon/cineonlib.h
26  *  \ingroup imbcineon
27  */
28
29
30 #ifndef __CINEON_LIB_H__
31 #define __CINEON_LIB_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "logImageCore.h"
38
39 #define CINEON_FILE_MAGIC       0x802A5FD7
40 #define CINEON_UNDEFINED_U8     0xFF
41 #define CINEON_UNDEFINED_U16    0xFFFF
42 #define CINEON_UNDEFINED_U32    0xFFFFFFFF
43 #define CINEON_UNDEFINED_R32    0x7F800000
44 #define CINEON_UNDEFINED_CHAR   0
45
46 typedef struct {
47         unsigned int    magic_num;
48         unsigned int    offset;
49         unsigned int    gen_hdr_size;
50         unsigned int    ind_hdr_size;
51         unsigned int    user_data_size;
52         unsigned int    file_size;
53         char            version[8];
54         char            file_name[100];
55         char            creation_date[12];
56         char            creation_time[12];
57         char            reserved[36];
58 } CineonFileHeader;
59
60 typedef struct {
61         unsigned char   descriptor1;
62         unsigned char   descriptor2;
63         unsigned char   bits_per_sample;
64         unsigned char   filler;
65         unsigned int    pixels_per_line;
66         unsigned int    lines_per_image;
67         unsigned int    ref_low_data;
68         float           ref_low_quantity;
69         unsigned int    ref_high_data;
70         float           ref_high_quantity;
71 } CineonElementHeader;
72
73 typedef struct {
74         unsigned char       orientation;
75         unsigned char       elements_per_image;
76         unsigned short      filler;
77         CineonElementHeader element[8];
78         float               white_point_x;
79         float               white_point_y;
80         float               red_primary_x;
81         float               red_primary_y;
82         float               green_primary_x;
83         float               green_primary_y;
84         float               blue_primary_x;
85         float               blue_primary_y;
86         char                label[200];
87         char                reserved[28];
88         unsigned char       interleave;
89         unsigned char       packing;
90         unsigned char       data_sign;
91         unsigned char       sense;
92         unsigned int        line_padding;
93         unsigned int        element_padding;
94         char                reserved2[20];
95 } CineonImageHeader;
96
97 typedef struct {
98         int     x_offset;
99         int     y_offset;
100         char    file_name[100];
101         char    creation_date[12];
102         char    creation_time[12];
103         char    input_device[64];
104         char    model_number[32];
105         char    input_serial_number[32];
106         float   x_input_samples_per_mm;
107         float   y_input_samples_per_mm;
108         float   input_device_gamma;
109         char    reserved[40];
110 } CineonOriginationHeader;
111
112 typedef struct {
113         unsigned char   film_code;
114         unsigned char   film_type;
115         unsigned char   edge_code_perforation_offset;
116         unsigned char   filler;
117         unsigned int    prefix;
118         unsigned int    count;
119         char            format[32];
120         unsigned int    frame_position;
121         float           frame_rate;
122         char            attribute[32];
123         char            slate[200];
124         char            reserved[740];
125 } CineonFilmHeader;
126
127 typedef struct {
128         CineonFileHeader        fileHeader;
129         CineonImageHeader       imageHeader;
130         CineonOriginationHeader originationHeader;
131         CineonFilmHeader        filmHeader;
132 } CineonMainHeader;
133
134 void cineonSetVerbose(int);
135 LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t bufferSize);
136 LogImageFile *cineonCreate(const char *filename, int width, int height, int bitsPerSample, const char *creator);
137
138 #ifdef __cplusplus
139 }
140 #endif
141
142 #endif  /* __CINEON_LIB_H__ */