Blender V2.27

cineonfile.h

00001 /*
00002  *       Cineon image file format library definitions.
00003  *       Cineon file format structures.
00004  *
00005  *       This header file contains private details.
00006  *       User code should generally use cineonlib.h only.
00007  *
00008  *       Copyright 1999,2000,2001 David Hodson <hodsond@acm.org>
00009  *
00010  *       This program is free software; you can redistribute it and/or modify it
00011  *       under the terms of the GNU General Public License as published by the Free
00012  *       Software Foundation; either version 2 of the License, or (at your option)
00013  *       any later version.
00014  *
00015  *       This program is distributed in the hope that it will be useful, but
00016  *       WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00017  *       or FITNESS FOR A PARTICULAR PURPOSE.    See the GNU General Public License
00018  *       for more details.
00019  *
00020  *       You should have received a copy of the GNU General Public License
00021  *       along with this program; if not, write to the Free Software
00022  *       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00023  *
00024  */
00025 
00026 #ifndef _CINEON_FILE_H_
00027 #define _CINEON_FILE_H_
00028 
00029 #include "logImageCore.h"
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 typedef struct {
00036                 U32             magic_num;                              /* magic number */
00037                 U32             image_offset;                   /* offset to image data in bytes */
00038                 U32             gen_hdr_size;                   /* generic header length in bytes */
00039                 U32             ind_hdr_size;                   /* industry header length in bytes */
00040                 U32             user_data_size;         /* user-defined data length in bytes */
00041                 U32             file_size;                              /* file size in bytes */
00042                 ASCII vers[8];                                  /* which header format version is being used (v4.5) */
00043                 ASCII file_name[100];           /* image file name */
00044                 ASCII create_date[12];  /* file creation date */
00045                 ASCII create_time[12];  /* file creation time */
00046                 ASCII Reserved[36];                     /* reserved field TBD (need to pad) */
00047 } CineonFileInformation;
00048 
00049 typedef struct {
00050                 U8               designator1;
00051                 U8               designator2;
00052                 U8               bits_per_pixel;
00053                 U8               filler;
00054                 U32              pixels_per_line;
00055                 U32              lines_per_image;
00056                 U32              ref_low_data;           /* reference low data code value */
00057                 R32              ref_low_quantity; /* reference low quantity represented */
00058                 U32              ref_high_data;          /* reference high data code value */
00059                 R32              ref_high_quantity;/* reference high quantity represented */
00060 } CineonChannelInformation;
00061 
00062 typedef struct {
00063                 U8               orientation;                                    /* image orientation */
00064                 U8               channels_per_image;
00065                 U16              filler;
00066                 CineonChannelInformation channel[8];
00067                 R32              white_point_x;
00068                 R32              white_point_y;
00069                 R32              red_primary_x;
00070                 R32              red_primary_y;
00071                 R32              green_primary_x;
00072                 R32              green_primary_y;
00073                 R32              blue_primary_x;
00074                 R32              blue_primary_y;
00075                 ASCII    label[200];
00076                 ASCII    reserved[28];
00077 } CineonImageInformation;
00078 
00079 typedef struct {
00080                 U8              interleave;
00081                 U8              packing;
00082                 U8              signage;
00083                 U8              sense;
00084                 U32             line_padding;
00085                 U32             channel_padding;
00086                 ASCII reserved[20];
00087 } CineonFormatInformation;
00088 
00089 typedef struct {
00090                 S32             x_offset;
00091                 S32             y_offset;
00092                 ASCII file_name[100];
00093                 ASCII create_date[12];  /* file creation date */
00094                 ASCII create_time[12];  /* file creation time */
00095                 ASCII input_device[64];
00096                 ASCII model_number[32];
00097                 ASCII serial_number[32];
00098                 R32             x_input_samples_per_mm;
00099                 R32             y_input_samples_per_mm;
00100                 R32             input_device_gamma;
00101                 ASCII reserved[40];
00102 } CineonOriginationInformation;
00103 
00104 typedef struct {
00105         CineonFileInformation fileInfo;
00106         CineonImageInformation imageInfo;
00107         CineonFormatInformation formatInfo;
00108         CineonOriginationInformation originInfo;
00109 } CineonGenericHeader;
00110 
00111 typedef struct {
00112         U8 filmCode;
00113         U8 filmType;
00114         U8 perfOffset;
00115         U8 filler;
00116         U32 keycodePrefix;
00117         U32 keycodeCount;
00118         ASCII format[32];
00119         U32 framePosition; /* in sequence */
00120         R32 frameRate; /* frames per second */
00121         ASCII attribute[32];
00122         ASCII slate[200];
00123         ASCII reserved[740];
00124 } CineonMPISpecificInformation;
00125 
00126 #if 0
00127 /* create CineonFile from data in header */
00128 /* return 0 for OK */
00129 int readCineonGenericHeader(CineonFile* cineon, CineonGenericHeader* header);
00130 
00131 /* create header from data in CineonFile */
00132 int initCineonGenericHeader(
00133         CineonFile* cineon, CineonGenericHeader* header, const char* imagename);
00134 
00135 /* Note: dump routine assumes network byte order */
00136 void dumpCineonGenericHeader(CineonGenericHeader* header);
00137 #endif
00138 
00139 #ifdef __cplusplus
00140 }
00141 #endif
00142 
00143 #endif /* _CINEON_FILE_H_ */