~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/imbuf/intern/cineon/dpxlib.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
1
24
/** \file blender/imbuf/intern/cineon/dpxlib.h
2
25
 *  \ingroup imbcineon
3
26
 */
4
 
/*
5
 
 *       DPX image file format library definitions.
6
 
 *
7
 
 *       Copyright 1999 - 2002 David Hodson <hodsond@acm.org>
8
 
 *
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)
12
 
 *       any later version.
13
 
 *
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
17
 
 *       for more details.
18
 
 *
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.
22
 
 *
23
 
 */
24
 
 
25
 
#ifndef __DPXLIB_H__
26
 
#define __DPXLIB_H__
 
27
 
 
28
 
 
29
#ifndef __DPX_LIB_H__
 
30
#define __DPX_LIB_H__
27
31
 
28
32
#ifdef __cplusplus
29
33
extern "C" {
31
35
 
32
36
#include "logImageCore.h"
33
37
 
34
 
typedef struct _Log_Image_File_t_ DpxFile;
35
 
 
36
 
/* int functions return 0 for OK */
37
 
 
38
 
void dpxSetVerbose(int);
39
 
 
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);
44
 
 
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);
48
 
 
49
 
/* closes file and deletes data */
50
 
void dpxClose(DpxFile* dpx);
51
 
 
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
 
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);
54
155
 
55
156
#ifdef __cplusplus
56
157
}
57
158
#endif
58
159
 
59
 
#endif /* __DPXLIB_H__ */
 
160
#endif