Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dpxlib.h « cineon « intern « imbuf « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bd608b130577c2c8da1f7af7c151e148b22c8bab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
 * DPX image file format library definitions.
 *
 * Copyright 1999 - 2002 David Hodson <hodsond@acm.org>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Contributor(s): Julien Enche.
 *
 */

/** \file blender/imbuf/intern/cineon/dpxlib.h
 *  \ingroup imbcineon
 */


#ifndef __DPX_LIB_H__
#define __DPX_LIB_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "logImageCore.h"

#define DPX_FILE_MAGIC      0x53445058
#define DPX_UNDEFINED_U8    0xFF
#define DPX_UNDEFINED_U16   0xFFFF
#define DPX_UNDEFINED_U32   0xFFFFFFFF
#define DPX_UNDEFINED_R32   0xFFFFFFFF
#define DPX_UNDEFINED_CHAR  0

typedef struct {
	unsigned int	magic_num;
	unsigned int	offset;
	char			version[8];
	unsigned int	file_size;
	unsigned int	ditto_key;
	unsigned int	gen_hdr_size;
	unsigned int	ind_hdr_size;
	unsigned int	user_data_size;
	char			file_name[100];
	char			creation_date[24];
	char			creator[100];
	char			project[200];
	char			copyright[200];
	unsigned int	key;
	char			reserved[104];
} DpxFileHeader;

typedef struct {
	unsigned int	data_sign;
	unsigned int	ref_low_data;
	float			ref_low_quantity;
	unsigned int	ref_high_data;
	float			ref_high_quantity;
	unsigned char	descriptor;
	unsigned char	transfer;
	unsigned char	colorimetric;
	unsigned char	bits_per_sample;
	unsigned short	packing;
	unsigned short	encoding;
	unsigned int	data_offset;
	unsigned int	line_padding;
	unsigned int	element_padding;
	char			description[32];
} DpxElementHeader;

typedef struct {
	unsigned short		orientation;
	unsigned short		elements_per_image;
	unsigned int		pixels_per_line;
	unsigned int		lines_per_element;
	DpxElementHeader	element[8];
	char				reserved[52];
} DpxImageHeader;

typedef struct {
	unsigned int	x_offset;
	unsigned int	y_offset;
	float			x_center;
	float			y_center;
	unsigned int	x_original_size;
	unsigned int	y_original_size;
	char			file_name[100];
	char			creation_time[24];
	char			input_device[32];
	char			input_serial_number[32];
	unsigned short	border_validity[4];
	unsigned int	pixel_aspect_ratio[2];
	char			reserved[28];
} DpxOrientationHeader;

typedef struct {
	char			film_manufacturer_id[2];
	char			film_type[2];
	char			edge_code_perforation_offset[2];
	char			edge_code_prefix[6];
	char			edge_code_count[4];
	char			film_format[32];
	unsigned int	frame_position;
	unsigned int	sequence_length;
	unsigned int	held_count;
	float			frame_rate;
	float			shutter_angle;
	char			frame_identification[32];
	char			slate_info[100];
	char			reserved[56];
} DpxFilmHeader;

typedef struct {
	unsigned int	time_code;
	unsigned int	user_bits;
	unsigned char	interlace;
	unsigned char	field_number;
	unsigned char	video_signal;
	unsigned char	padding;
	float			horizontal_sample_rate;
	float 			vertical_sample_rate;
	float 			frame_rate;
	float 			time_offset;
	float 			gamma;
	float 			black_level;
	float 			black_gain;
	float 			breakpoint;
	float 			white_level;
	float 			integration_times;
	unsigned char  	reserved[76];
} DpxTelevisionHeader;


typedef struct {
	DpxFileHeader			fileHeader;
	DpxImageHeader			imageHeader;
	DpxOrientationHeader	orientationHeader;
	DpxFilmHeader			filmHeader;
	DpxTelevisionHeader		televisionHeader;
} DpxMainHeader;

void dpxSetVerbose(int verbosity);
LogImageFile* dpxOpen(const unsigned char* byteStuff, int fromMemory, size_t bufferSize);
LogImageFile* dpxCreate(const char* filename, int width, int height, int bitsPerSample, int hasAlpha, int isLogarithmic, int referenceWhite, int referenceBlack, float gamma, const char* creator);

#ifdef __cplusplus
}
#endif

#endif