2
* DPX image file format library definitions.
4
* Copyright 1999 - 2002 David Hodson <hodsond@acm.org>
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)
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
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.
20
* Contributor(s): Julien Enche.
1
24
/** \file blender/imbuf/intern/cineon/dpxlib.h
2
25
* \ingroup imbcineon
5
* DPX image file format library definitions.
7
* Copyright 1999 - 2002 David Hodson <hodsond@acm.org>
9
* This program is free software; you can redistribute it and/or modify it
10
* under the terms of the GNU General Public License as published by the Free
11
* Software Foundation; either version 2 of the License, or (at your option)
14
* This program is distributed in the hope that it will be useful, but
15
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
32
36
#include "logImageCore.h"
34
typedef struct _Log_Image_File_t_ DpxFile;
36
/* int functions return 0 for OK */
38
void dpxSetVerbose(int);
40
DpxFile* dpxOpen(const char* filename);
41
DpxFile* dpxCreate(const char* filename, int xsize, int ysize, int channels);
42
DpxFile* dpxOpenFromMem(unsigned char *buffer, unsigned int size);
43
int dpxIsMemFileCineon(void *buffer);
45
/* get/set scanline of converted bytes */
46
int dpxGetRowBytes(DpxFile* dpx, unsigned short* row, int y);
47
int dpxSetRowBytes(DpxFile* dpx, const unsigned short* row, int y);
49
/* closes file and deletes data */
50
void dpxClose(DpxFile* dpx);
52
/* dumps file to stdout */
53
void dpxDump(const char* filename);
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
46
unsigned int magic_num;
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;
55
char creation_date[24];
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;
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];
91
unsigned int x_offset;
92
unsigned int y_offset;
95
unsigned int x_original_size;
96
unsigned int y_original_size;
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];
104
} DpxOrientationHeader;
107
char film_manufacturer_id[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;
118
char frame_identification[32];
119
char slate_info[100];
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;
139
float integration_times;
140
unsigned char reserved[76];
141
} DpxTelevisionHeader;
145
DpxFileHeader fileHeader;
146
DpxImageHeader imageHeader;
147
DpxOrientationHeader orientationHeader;
148
DpxFilmHeader filmHeader;
149
DpxTelevisionHeader televisionHeader;
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);
55
156
#ifdef __cplusplus
59
#endif /* __DPXLIB_H__ */