Advertisement
adilima

DPX File Structure

Feb 20th, 2012
3,553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.64 KB | None | 0 0
  1. /*-------------------------------*/
  2. typedef struct _DPXHeader
  3. {
  4.     uint32_t magic;
  5.     uint32_t image_offset;
  6.     uint8_t version[8];
  7.     uint32_t file_size;
  8.     uint32_t ditto_key;
  9.     uint32_t generic_hdr_size;
  10.     uint32_t industry_hdr_size;
  11.     uint32_t user_data_size;
  12.     uint8_t file_name[100];
  13.     uint8_t creation_date[24];
  14.     uint8_t creator[100];
  15.     uint8_t project[200];
  16.     uint8_t copyright[200];
  17.     uint32_t encrypt_key;
  18.     uint8_t reserved[104];
  19. } DPXHeader;
  20.  
  21. typedef struct DPXImageElement {
  22.     uint32_t data_sign;
  23.     uint32_t ref_low_data;
  24.     float ref_low_quality;
  25.     uint32_t ref_high_data;
  26.     float ref_high_quality;
  27.     uint8_t descriptor;
  28.     uint8_t transfer;
  29.     uint8_t colorimetric;
  30.     uint8_t bit_size;
  31.     uint16_t packing;
  32.     uint16_t encoding;
  33.     uint32_t data_offset;
  34.     uint32_t eol_padding;
  35.     uint32_t eo_image_padding;
  36.     uint8_t description[32];
  37. } DPXImageElement;
  38.  
  39. typedef struct _ImageHeader {
  40.     uint16_t orientation;
  41.     uint16_t number_of_elements;
  42.     uint32_t img_width;     /* pixels_per_line */
  43.     uint32_t img_height;    /* lines_per_element */
  44.     DPXImageElement img_element[8];
  45.     uint8_t reserved[52];
  46. } DPXImageHeader;
  47.  
  48. typedef struct _ImageOrientation {
  49.     uint32_t x_offset;
  50.     uint32_t y_offset;
  51.     float x_center;
  52.     float y_center;
  53.     uint32_t x_original_size;
  54.     uint32_t y_original_size;
  55.     uint8_t file_name[100];
  56.     uint8_t creation_time[24];
  57.     uint8_t input_dev[32];
  58.     uint8_t input_serial[32];
  59.     uint16_t border[4];
  60.     uint32_t pixel_aspect_x;
  61.     uint32_t pixel_aspect_y;
  62.     uint8_t reserved[28];
  63. } DPXImageOrientation;
  64.  
  65. typedef struct _FilmHeader {
  66.     uint8_t manufacturer_id[2];
  67.     uint8_t film_type[2];
  68.     uint8_t offset[2];
  69.     uint8_t prefix[6];
  70.     uint8_t count[4];
  71.     uint8_t format[32];
  72.     uint32_t frame_position;
  73.     uint32_t sequence_len;
  74.     uint32_t held_count;
  75.     float framerate;
  76.     float shutter_angle;
  77.     uint8_t frame_id[32];
  78.     uint8_t slate_info[100];
  79.     uint8_t reserved[56];
  80. } DPXFilmHeader;
  81.  
  82. typedef union _SMPTETimecode {
  83.     struct {
  84.         uint8_t hours;
  85.         uint8_t minutes;
  86.         uint8_t seconds;
  87.         uint8_t frames;
  88.     };
  89.     uint32_t value;
  90. } SMPTETimecode;
  91.  
  92. typedef struct _TVHeader {
  93.     SMPTETimecode timecode;
  94.     uint32_t user_bits;
  95.     uint8_t interlace;
  96.     uint8_t field_num;
  97.     uint8_t video_signal;
  98.     uint8_t unused;
  99.     float horz_sample_rate;
  100.     float vert_sample_rate;
  101.     float framerate;
  102.     float time_offset;
  103.     float gamma;
  104.     float black_level;
  105.     float black_gain;
  106.     float break_point;
  107.     float white_level;
  108.     float integration_times;
  109.     uint8_t reserved[76];
  110. } DPXTVHeader;
  111.  
  112. typedef struct _DPXUserData {
  113.     uint8_t user_id[32];
  114.     /**
  115.      * This can contains any number of data you need
  116.      * the size if defined at DPXHeader::user_data_size above
  117.      */
  118.     void* pvData;
  119. } DPXUserData;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement