16 #if defined(AJA_LINUX) || defined(AJA_MAC)
17 # include <arpa/inet.h>
23 # define INVALID_HANDLE_VALUE -1
26 #if defined(AJA_WINDOWS)
110 memcpy ((
void*)&m_hdr,(
void*) &rhs.m_hdr,
sizeof(
DPX_header_t));
130 DPX_SET_U32(&m_hdr,file_info.resv.s2.tcFrame, frame);
136 return DPX_GET_U32(&m_hdr,file_info.resv.s2.tcFrame);
142 return DPX_GET_U32(&m_hdr,file_info.resv.s2.filenum);
148 DPX_SET_U32(&m_hdr,file_info.resv.s2.filenum,filenum);
162 assert(rid && sid && tid);
172 #if defined(AJA_WINDOWS)
177 t = ::localtime(&time_now);
179 strftime (tstr, 32,
"%Y:%m:%d:%T%z", t);
181 int len = (int)(std::min)(strlen(tstr)+1, (size_t)24);
205 DPX_SET_U32(&m_hdr, file_info.offset, (uint32_t)offs);
216 DPX_SET_U32(&m_hdr, file_info.file_size, (uint32_t)size);
230 int len = (int)(std::min)(str.size()+1, (size_t)8);
245 int len = (int)(std::min)(str.size()+1, (size_t)100);
246 DPX_SET_TEXT(&m_hdr,file_info.file_name,str.c_str(), len);
260 int len = (int)(std::min) (str.size()+1, (size_t)100);
261 DPX_SET_TEXT(&m_hdr,file_info.creator,str.c_str(), len);
275 int len = (int)(std::min) (str.size()+1, (size_t)24);
276 DPX_SET_TEXT (&m_hdr,file_info.create_time,str.c_str(), len);
291 int len = (int)(std::min) (str.size()+1, (size_t)200);
306 int len = (int)(std::min) (str.size()+1, (size_t)200);
307 DPX_SET_TEXT(&m_hdr,file_info.copyright,str.c_str(),len);
314 DPX_SET_U16(&m_hdr,image_info.orientation, orientation);
324 DPX_SET_U16(&m_hdr,image_info.element_number, element_number);
329 return DPX_GET_U16(&m_hdr,image_info.element_number);
334 DPX_SET_U32(&m_hdr,image_info.pixels_per_line, pixels);
339 return (
size_t)
DPX_GET_U32(&m_hdr,image_info.pixels_per_line);
344 DPX_SET_U32(&m_hdr,image_info.lines_per_image_ele, lines);
348 return (
size_t)
DPX_GET_U32(&m_hdr,image_info.lines_per_image_ele);
357 int len = (int)(std::min) (str.size()+1, (size_t)32);
358 DPX_SET_TEXT (&m_hdr, image_info.image_element[i].description, str.c_str(), len);
365 DPX_GET_TEXT (&m_hdr, image_info.image_element[i].description,buf, 32);
373 DPX_SET_U32(&m_hdr, image_info.image_element[i].data_sign, sign);
379 return DPX_GET_U32(&m_hdr, image_info.image_element[i].data_sign);
385 DPX_SET_U32(&m_hdr, image_info.image_element[i].ref_low_data, data);
391 return DPX_GET_U32(&m_hdr, image_info.image_element[i].ref_low_data);
397 DPX_SET_U32(&m_hdr, image_info.image_element[i].ref_high_data, data);
403 return DPX_GET_U32(&m_hdr, image_info.image_element[i].ref_high_data);
409 DPX_SET_R32(&m_hdr, image_info.image_element[i].ref_low_quantity, data);
415 return DPX_GET_R32(&m_hdr, image_info.image_element[i].ref_low_quantity);
421 DPX_SET_R32(&m_hdr, image_info.image_element[i].ref_high_quantity, data);
427 return DPX_GET_R32(&m_hdr, image_info.image_element[i].ref_high_quantity);
433 DPX_SET_U8(&m_hdr, image_info.image_element[i].descriptor, desc);
439 return DPX_GET_U8(&m_hdr, image_info.image_element[i].descriptor);
445 DPX_SET_U8(&m_hdr, image_info.image_element[i].transfer, trans);
451 return DPX_GET_U8(&m_hdr, image_info.image_element[i].transfer);
457 DPX_SET_U8(&m_hdr, image_info.image_element[i].colorimetric, c);
463 return DPX_GET_U8(&m_hdr, image_info.image_element[i].colorimetric);
469 DPX_SET_U8(&m_hdr, image_info.image_element[i].bit_size, bits);
475 return DPX_GET_U8(&m_hdr, image_info.image_element[i].bit_size);
481 DPX_SET_U16(&m_hdr, image_info.image_element[i].packing, pack);
487 return DPX_GET_U16(&m_hdr, image_info.image_element[i].packing);
493 DPX_SET_U16(&m_hdr, image_info.image_element[i].encoding, enc);
499 return DPX_GET_U16(&m_hdr, image_info.image_element[i].encoding);
505 DPX_SET_U32(&m_hdr, image_info.image_element[i].data_offset, offs);
511 return DPX_GET_U32(&m_hdr, image_info.image_element[i].data_offset);
517 DPX_SET_U32(&m_hdr, image_info.image_element[i].eol_padding, padding);
523 return DPX_GET_U32(&m_hdr, image_info.image_element[i].eol_padding);
529 DPX_SET_U32(&m_hdr, image_info.image_element[i].eo_image_padding, padding);
535 return DPX_GET_U32(&m_hdr, image_info.image_element[i].eo_image_padding);
551 int len = (int)(std::min) (str.size()+1, (size_t)100);
552 DPX_SET_TEXT(&m_hdr,image_source.file_name,str.c_str(),len);
568 int len = (int)(std::min) (str.size()+1, (size_t)24);
569 DPX_SET_TEXT(&m_hdr,image_source.creation_time,str.c_str(),len);
585 int len = (int)(std::min)(str.size()+1, (size_t)32);
586 DPX_SET_TEXT(&m_hdr,image_source.input_dev,str.c_str(),len);
602 int len = (int)(std::min) (str.size()+1, (size_t)32);
603 DPX_SET_TEXT(&m_hdr,image_source.input_serial,str.c_str(),len);
619 int len = (int)(std::min)(str.size()+1, (size_t)2);
620 DPX_SET_TEXT (&m_hdr,film_header.film_mfg_id,str.c_str(),len);
636 int len = (int)(std::min)(str.size()+1, (size_t)2);
637 DPX_SET_TEXT (&m_hdr,film_header.film_type,str.c_str(),len);
654 int len = (int)(std::min)(str.size()+1, (size_t)2);
655 DPX_SET_TEXT (&m_hdr,film_header.offset,str.c_str(),len);
671 int len = (int)(std::min)(str.size()+1, (size_t)6);
672 DPX_SET_TEXT (&m_hdr,film_header.prefix,str.c_str(),len);
689 int len = (int)(std::min)(str.size()+1, (size_t)4);
690 DPX_SET_TEXT (&m_hdr,film_header.count,str.c_str(),len);
706 int len = (int)(std::min)(str.size()+1, (size_t)32);
707 DPX_SET_TEXT (&m_hdr,film_header.format,str.c_str(),len);
713 return (
size_t)
DPX_GET_U32(&m_hdr,film_header.frame_position);
719 DPX_SET_U32(&m_hdr,film_header.frame_position,(uint32_t)pos);
725 return (
size_t)
DPX_GET_U32(&m_hdr,film_header.sequence_len);
731 DPX_SET_U32(&m_hdr,film_header.sequence_len,(uint32_t)len);
737 return(
size_t)
DPX_GET_U32(&m_hdr,film_header.held_count);
743 DPX_SET_U32(&m_hdr,film_header.held_count,(uint32_t)count);
761 return DPX_GET_R32(&m_hdr,film_header.shutter_angle);
767 DPX_SET_R32(&m_hdr,film_header.shutter_angle,angle);
783 int len = (int)(std::min) (str.size()+1, (size_t)32);
784 DPX_SET_TEXT(&m_hdr,film_header.slate_info,str.c_str(),len);
800 int len = (int)(std::min) (str.size()+1, (size_t)200);
801 DPX_SET_TEXT(&m_hdr,film_header.slate_info,str.c_str(),len);
813 DPX_SET_U32(&m_hdr,tv_header.tim_code,(uint32_t)tc);
819 return (
size_t)
DPX_GET_U32(&m_hdr,tv_header.tim_code);
825 DPX_SET_U32(&m_hdr,tv_header.userBits,(uint32_t)ub);
842 return (
DPX_GET_U8(&m_hdr,tv_header.interlace));
847 DPX_SET_U8(&m_hdr,tv_header.interlace,interlace);