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

cineonlib.h « cineon « intern « imbuf « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 040435e44ee4ab96cd9eccf9873fe85bde58fbe4 (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
/*
 * 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.
 *
 * Copyright 1999,2000,2001 David Hodson <hodsond@acm.org>
 */

/** \file
 * \ingroup imbcineon
 *
 * Cineon image file format library definitions.
 * Also handles DPX files (almost)
 */

#ifndef __CINEONLIB_H__
#define __CINEONLIB_H__

#include "logImageCore.h"

#ifdef __cplusplus
extern "C" {
#endif

#define CINEON_FILE_MAGIC 0x802A5FD7
#define CINEON_UNDEFINED_U8 0xFF
#define CINEON_UNDEFINED_U16 0xFFFF
#define CINEON_UNDEFINED_U32 0xFFFFFFFF
#define CINEON_UNDEFINED_R32 0x7F800000
#define CINEON_UNDEFINED_CHAR 0

typedef struct {
  unsigned int magic_num;
  unsigned int offset;
  unsigned int gen_hdr_size;
  unsigned int ind_hdr_size;
  unsigned int user_data_size;
  unsigned int file_size;
  char version[8];
  char file_name[100];
  char creation_date[12];
  char creation_time[12];
  char reserved[36];
} CineonFileHeader;

typedef struct {
  unsigned char descriptor1;
  unsigned char descriptor2;
  unsigned char bits_per_sample;
  unsigned char filler;
  unsigned int pixels_per_line;
  unsigned int lines_per_image;
  unsigned int ref_low_data;
  float ref_low_quantity;
  unsigned int ref_high_data;
  float ref_high_quantity;
} CineonElementHeader;

typedef struct {
  unsigned char orientation;
  unsigned char elements_per_image;
  unsigned short filler;
  CineonElementHeader element[8];
  float white_point_x;
  float white_point_y;
  float red_primary_x;
  float red_primary_y;
  float green_primary_x;
  float green_primary_y;
  float blue_primary_x;
  float blue_primary_y;
  char label[200];
  char reserved[28];
  unsigned char interleave;
  unsigned char packing;
  unsigned char data_sign;
  unsigned char sense;
  unsigned int line_padding;
  unsigned int element_padding;
  char reserved2[20];
} CineonImageHeader;

typedef struct {
  int x_offset;
  int y_offset;
  char file_name[100];
  char creation_date[12];
  char creation_time[12];
  char input_device[64];
  char model_number[32];
  char input_serial_number[32];
  float x_input_samples_per_mm;
  float y_input_samples_per_mm;
  float input_device_gamma;
  char reserved[40];
} CineonOriginationHeader;

typedef struct {
  unsigned char film_code;
  unsigned char film_type;
  unsigned char edge_code_perforation_offset;
  unsigned char filler;
  unsigned int prefix;
  unsigned int count;
  char format[32];
  unsigned int frame_position;
  float frame_rate;
  char attribute[32];
  char slate[200];
  char reserved[740];
} CineonFilmHeader;

typedef struct {
  CineonFileHeader fileHeader;
  CineonImageHeader imageHeader;
  CineonOriginationHeader originationHeader;
  CineonFilmHeader filmHeader;
} CineonMainHeader;

void cineonSetVerbose(int);
LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t bufferSize);
LogImageFile *cineonCreate(
    const char *filename, int width, int height, int bitsPerSample, const char *creator);

#ifdef __cplusplus
}
#endif

#endif /* __CINEONLIB_H__ */