il_dpx.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Sources
  4. // Copyright (C) 2000-2009 by Denton Woods
  5. // Last modified: 02/26/2009
  6. //
  7. // Filename: src-IL/include/il_dpx.h
  8. //
  9. // Description: Reads from a Digital Picture Exchange (.dpx) file.
  10. // Specifications for this format were found at
  11. // http://www.cineon.com/ff_draft.php and
  12. // http://www.fileformat.info/format/dpx/.
  13. //
  14. //-----------------------------------------------------------------------------
  15. #ifndef DPX_H
  16. #define DPX_H
  17. #include "il_internal.h"
  18. #ifdef _WIN32
  19. #pragma pack(push, packed_struct, 1)
  20. #endif
  21. typedef struct R32
  22. {
  23. ILubyte r, g, b, a;
  24. } IL_PACKSTRUCT R32;
  25. #ifdef _WIN32
  26. #pragma pack(pop, packed_struct)
  27. #endif
  28. typedef struct DPX_FILE_INFO
  29. {
  30. ILuint MagicNum; /* magic number 0x53445058 (SDPX) or 0x58504453 (XPDS) */
  31. ILuint Offset; /* offset to image data in bytes */
  32. ILbyte Vers[8]; /* which header format version is being used (v1.0)*/
  33. ILuint FileSize; /* file size in bytes */
  34. ILuint DittoKey; /* read time short cut - 0 = same, 1 = new */
  35. ILuint GenHdrSize; /* generic header length in bytes */
  36. ILuint IndHdrSize; /* industry header length in bytes */
  37. ILuint UserDataSize; /* user-defined data length in bytes */
  38. ILbyte FileName[100]; /* image file name */
  39. ILbyte CreateTime[24]; /* file creation date "yyyy:mm:dd:hh:mm:ss:LTZ" */
  40. ILbyte Creator[100]; /* file creator's name */
  41. ILbyte Project[200]; /* project name */
  42. ILbyte Copyright[200]; /* right to use or copyright info */
  43. ILuint Key; /* encryption ( FFFFFFFF = unencrypted ) */
  44. ILbyte Reserved[104]; /* reserved field TBD (need to pad) */
  45. } DPX_FILE_INFO;
  46. typedef struct DPX_IMAGE_ELEMENT
  47. {
  48. ILuint DataSign; /* data sign (0 = unsigned, 1 = signed ) */
  49. /* "Core set images are unsigned" */
  50. ILuint RefLowData; /* reference low data code value */
  51. R32 RefLowQuantity; /* reference low quantity represented */
  52. ILuint RefHighData; /* reference high data code value */
  53. R32 RefHighQuantity;/* reference high quantity represented */
  54. ILubyte Descriptor; /* descriptor for image element */
  55. ILubyte Transfer; /* transfer characteristics for element */
  56. ILubyte Colorimetric; /* colormetric specification for element */
  57. ILubyte BitSize; /* bit size for element */
  58. ILushort Packing; /* packing for element */
  59. ILushort Encoding; /* encoding for element */
  60. ILuint DataOffset; /* offset to data of element */
  61. ILuint EolPadding; /* end of line padding used in element */
  62. ILuint EoImagePadding; /* end of image padding used in element */
  63. ILbyte Description[32];/* description of element */
  64. } DPX_IMAGE_ELEMENT; /* NOTE THERE ARE EIGHT OF THESE */
  65. typedef struct DPX_IMAGE_INFO
  66. {
  67. ILushort Orientation; /* image orientation */
  68. ILushort NumElements; /* number of image elements */
  69. ILuint Width; /* or x value */
  70. ILuint Height; /* or y value, per element */
  71. DPX_IMAGE_ELEMENT ImageElement[8];
  72. ILubyte reserved[52]; /* reserved for future use (padding) */
  73. } DPX_IMAGE_INFO;
  74. typedef struct DPX_IMAGE_ORIENT
  75. {
  76. ILuint XOffset; /* X offset */
  77. ILuint YOffset; /* Y offset */
  78. R32 XCenter; /* X center */
  79. R32 YCenter; /* Y center */
  80. ILuint XOrigSize; /* X original size */
  81. ILuint YOrigSize; /* Y original size */
  82. ILbyte FileName[100]; /* source image file name */
  83. ILbyte CreationTime[24]; /* source image creation date and time */
  84. ILbyte InputDev[32]; /* input device name */
  85. ILbyte InputSerial[32]; /* input device serial number */
  86. ILushort Border[4]; /* border validity (XL, XR, YT, YB) */
  87. ILuint PixelAspect[2]; /* pixel aspect ratio (H:V) */
  88. ILubyte Reserved[28]; /* reserved for future use (padding) */
  89. } DPX_IMAGE_ORIENT;
  90. typedef struct DPX_MOTION_PICTURE_HEAD
  91. {
  92. ILbyte film_mfg_id[2]; /* film manufacturer ID code (2 digits from film edge code) */
  93. ILbyte film_type[2]; /* file type (2 digits from film edge code) */
  94. ILbyte offset[2]; /* offset in perfs (2 digits from film edge code)*/
  95. ILbyte prefix[6]; /* prefix (6 digits from film edge code) */
  96. ILbyte count[4]; /* count (4 digits from film edge code)*/
  97. ILbyte format[32]; /* format (i.e. academy) */
  98. ILuint frame_position; /* frame position in sequence */
  99. ILuint sequence_len; /* sequence length in frames */
  100. ILuint held_count; /* held count (1 = default) */
  101. R32 frame_rate; /* frame rate of original in frames/sec */
  102. R32 shutter_angle; /* shutter angle of camera in degrees */
  103. ILbyte frame_id[32]; /* frame identification (i.e. keyframe) */
  104. ILbyte slate_info[100]; /* slate information */
  105. ILubyte reserved[56]; /* reserved for future use (padding) */
  106. } DPX_MOTION_PICTURE_HEAD;
  107. typedef struct DPX_TELEVISION_HEAD
  108. {
  109. ILuint tim_code; /* SMPTE time code */
  110. ILuint userBits; /* SMPTE user bits */
  111. ILubyte interlace; /* interlace ( 0 = noninterlaced, 1 = 2:1 interlace*/
  112. ILubyte field_num; /* field number */
  113. ILubyte video_signal; /* video signal standard (table 4)*/
  114. ILubyte unused; /* used for byte alignment only */
  115. R32 hor_sample_rate; /* horizontal sampling rate in Hz */
  116. R32 ver_sample_rate; /* vertical sampling rate in Hz */
  117. R32 frame_rate; /* temporal sampling rate or frame rate in Hz */
  118. R32 time_offset; /* time offset from sync to first pixel */
  119. R32 gamma; /* gamma value */
  120. R32 black_level; /* black level code value */
  121. R32 black_gain; /* black gain */
  122. R32 break_point; /* breakpoint */
  123. R32 white_level; /* reference white level code value */
  124. R32 integration_times; /* integration time(s) */
  125. ILubyte reserved[76]; /* reserved for future use (padding) */
  126. } DPX_TELEVISION_HEAD;
  127. // For checking and reading
  128. ILboolean iIsValidDpx(void);
  129. //ILboolean iCheckDpx(DPXHEAD *Header);
  130. ILboolean iLoadDpxInternal(void);
  131. #endif//PCX_H