code cleanup: cmake - add missing headers, remove directories from source listing.
[blender.git] / source / blender / imbuf / intern / cineon / dpxlib.h
1 /*
2  * DPX image file format library definitions.
3  *
4  * Copyright 1999 - 2002 David Hodson <hodsond@acm.org>
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation; either version 2 of the License, or (at your option)
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * Contributor(s): Julien Enche.
21  *
22  */
23
24 /** \file blender/imbuf/intern/cineon/dpxlib.h
25  *  \ingroup imbcineon
26  */
27
28
29 #ifndef __DPX_LIB_H__
30 #define __DPX_LIB_H__
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #include "logImageCore.h"
37
38 #define DPX_FILE_MAGIC      0x53445058
39 #define DPX_UNDEFINED_U8    0xFF
40 #define DPX_UNDEFINED_U16   0xFFFF
41 #define DPX_UNDEFINED_U32   0xFFFFFFFF
42 #define DPX_UNDEFINED_R32   0xFFFFFFFF
43 #define DPX_UNDEFINED_CHAR  0
44
45 typedef struct {
46         unsigned int    magic_num;
47         unsigned int    offset;
48         char            version[8];
49         unsigned int    file_size;
50         unsigned int    ditto_key;
51         unsigned int    gen_hdr_size;
52         unsigned int    ind_hdr_size;
53         unsigned int    user_data_size;
54         char            file_name[100];
55         char            creation_date[24];
56         char            creator[100];
57         char            project[200];
58         char            copyright[200];
59         unsigned int    key;
60         char            reserved[104];
61 } DpxFileHeader;
62
63 typedef struct {
64         unsigned int    data_sign;
65         unsigned int    ref_low_data;
66         float           ref_low_quantity;
67         unsigned int    ref_high_data;
68         float           ref_high_quantity;
69         unsigned char   descriptor;
70         unsigned char   transfer;
71         unsigned char   colorimetric;
72         unsigned char   bits_per_sample;
73         unsigned short  packing;
74         unsigned short  encoding;
75         unsigned int    data_offset;
76         unsigned int    line_padding;
77         unsigned int    element_padding;
78         char            description[32];
79 } DpxElementHeader;
80
81 typedef struct {
82         unsigned short      orientation;
83         unsigned short      elements_per_image;
84         unsigned int        pixels_per_line;
85         unsigned int        lines_per_element;
86         DpxElementHeader    element[8];
87         char                reserved[52];
88 } DpxImageHeader;
89
90 typedef struct {
91         unsigned int    x_offset;
92         unsigned int    y_offset;
93         float           x_center;
94         float           y_center;
95         unsigned int    x_original_size;
96         unsigned int    y_original_size;
97         char            file_name[100];
98         char            creation_time[24];
99         char            input_device[32];
100         char            input_serial_number[32];
101         unsigned short  border_validity[4];
102         unsigned int    pixel_aspect_ratio[2];
103         char            reserved[28];
104 } DpxOrientationHeader;
105
106 typedef struct {
107         char            film_manufacturer_id[2];
108         char            film_type[2];
109         char            edge_code_perforation_offset[2];
110         char            edge_code_prefix[6];
111         char            edge_code_count[4];
112         char            film_format[32];
113         unsigned int    frame_position;
114         unsigned int    sequence_length;
115         unsigned int    held_count;
116         float           frame_rate;
117         float           shutter_angle;
118         char            frame_identification[32];
119         char            slate_info[100];
120         char            reserved[56];
121 } DpxFilmHeader;
122
123 typedef struct {
124         unsigned int    time_code;
125         unsigned int    user_bits;
126         unsigned char   interlace;
127         unsigned char   field_number;
128         unsigned char   video_signal;
129         unsigned char   padding;
130         float           horizontal_sample_rate;
131         float           vertical_sample_rate;
132         float           frame_rate;
133         float           time_offset;
134         float           gamma;
135         float           black_level;
136         float           black_gain;
137         float           breakpoint;
138         float           white_level;
139         float           integration_times;
140         unsigned char   reserved[76];
141 } DpxTelevisionHeader;
142
143
144 typedef struct {
145         DpxFileHeader           fileHeader;
146         DpxImageHeader          imageHeader;
147         DpxOrientationHeader    orientationHeader;
148         DpxFilmHeader           filmHeader;
149         DpxTelevisionHeader     televisionHeader;
150 } DpxMainHeader;
151
152 void dpxSetVerbose(int verbosity);
153 LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t bufferSize);
154 LogImageFile *dpxCreate(const char *filename, int width, int height, int bitsPerSample, int hasAlpha, int isLogarithmic, int referenceWhite, int referenceBlack, float gamma, const char *creator);
155
156 #ifdef __cplusplus
157 }
158 #endif
159
160 #endif