AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
dpx_hdr.h File Reference

Declaration of DpxHdr class adapted from STwo's dpx file I/O. More...

#include "public.h"
#include "ajabase/common/types.h"
#include "ajabase/system/system.h"
#include <string>
Include dependency graph for dpx_hdr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dpx_file_info_struct
 
struct  dpx_image_element_struct
 
struct  dpx_image_info_struct
 
struct  dpx_image_source_struct
 
struct  dpx_motion_picture_film_header_struct
 
struct  dpx_television_header_struct
 
struct  dpx_header_struct
 
class  DpxHdr
 

Macros

#define DPX_C_MAGIC   0x53445058
 
#define DPX_C_MAGIC_BE   0x58504453
 
#define DPX_C_VERSION   "V1.0"
 
#define DPX_C_UNDEFINED_FLOAT   0xffffffff
 
#define SWAP16(e, v)   ((e) ? htons(v) : (v))
 
#define SWAP32(e, v)   ((e) ? htonl(v) : (v))
 
#define SWAPR32(e, v)   ((e) ? htonf(v) : (v))
 
#define UNSWAP16(e, v)   ((e) ? ntohs(v) : (v))
 
#define UNSWAP32(e, v)   ((e) ? ntohl(v) : (v))
 
#define UNSWAPR32(e, v)   ((e) ? ntohf(v) : (v))
 
#define DPX_VALID(p)
 
#define DPX_IS_BE(p)   ((p) && ((p)->file_info.magic_num == DPX_C_MAGIC_BE))
 
#define DPX_C_IMAGE_ELEM_DESC_RGB   50
 
#define DPX_C_IMAGE_ELEM_DESC_RGBA   51
 
#define DPX_C_IMAGE_ELEM_DESC_ARGB   52
 
#define DPX_C_IMAGE_ELEM_DESC_422   100
 
#define DPX_C_IMAGE_ELEM_DESC_444   102
 
#define FLD_OFFET(TYPE, field)   ((uint32_t)(&(((TYPE *)0)->field)))
 
#define DPX_GET_U32(hdr, fld)
 
#define DPX_SET_U32(hdr, fld, val)
 
#define DPX_GET_R32(hdr, fld)
 
#define DPX_SET_R32(hdr, fld, val)
 
#define DPX_GET_U16(hdr, fld)
 
#define DPX_SET_U16(hdr, fld, val)
 
#define DPX_GET_U8(hdr, fld)   DPX_VALID(hdr) ? (hdr)->fld : (uint8_t)(-1)
 
#define DPX_SET_U8(hdr, fld, val)
 
#define DPX_SET_TEXT(hdr, fld, buf, len)
 
#define DPX_GET_TEXT(hdr, fld, buf, len)
 

Typedefs

typedef struct dpx_file_info_struct DPX_file_info_t
 
typedef struct dpx_image_element_struct DPX_image_element_t
 
typedef struct dpx_image_info_struct DPX_image_info_t
 
typedef struct dpx_image_source_struct DPX_image_source_t
 
typedef struct dpx_motion_picture_film_header_struct DPX_film_t
 
typedef struct dpx_television_header_struct DPX_television_t
 
typedef struct dpx_header_struct DPX_header_t
 

Functions

uint32_t AJA_EXPORT dpx_get_u32 (const uint32_t *ptr, bool BE)
 
void AJA_EXPORT dpx_set_u32 (uint32_t *ptr, bool BE, uint32_t val)
 
uint16_t AJA_EXPORT dpx_get_u16 (const uint16_t *ptr, bool BE)
 
void AJA_EXPORT dpx_set_u16 (uint16_t *ptr, bool BE, uint16_t val)
 
float AJA_EXPORT dpx_get_r32 (const float *ptr, bool BE)
 
void AJA_EXPORT dpx_set_r32 (float *ptr, bool BE, float val)
 

Detailed Description

Declaration of DpxHdr class adapted from STwo's dpx file I/O.

Definition in file dpx_hdr.h.

Macro Definition Documentation

◆ DPX_C_IMAGE_ELEM_DESC_422

#define DPX_C_IMAGE_ELEM_DESC_422   100

Definition at line 40 of file dpx_hdr.h.

◆ DPX_C_IMAGE_ELEM_DESC_444

#define DPX_C_IMAGE_ELEM_DESC_444   102

Definition at line 41 of file dpx_hdr.h.

◆ DPX_C_IMAGE_ELEM_DESC_ARGB

#define DPX_C_IMAGE_ELEM_DESC_ARGB   52

Definition at line 39 of file dpx_hdr.h.

◆ DPX_C_IMAGE_ELEM_DESC_RGB

#define DPX_C_IMAGE_ELEM_DESC_RGB   50

Definition at line 37 of file dpx_hdr.h.

◆ DPX_C_IMAGE_ELEM_DESC_RGBA

#define DPX_C_IMAGE_ELEM_DESC_RGBA   51

Definition at line 38 of file dpx_hdr.h.

◆ DPX_C_MAGIC

#define DPX_C_MAGIC   0x53445058

little-endian magic number

Definition at line 18 of file dpx_hdr.h.

◆ DPX_C_MAGIC_BE

#define DPX_C_MAGIC_BE   0x58504453

big-endian magic number

Definition at line 19 of file dpx_hdr.h.

◆ DPX_C_UNDEFINED_FLOAT

#define DPX_C_UNDEFINED_FLOAT   0xffffffff

DPX undefined float

Definition at line 21 of file dpx_hdr.h.

◆ DPX_C_VERSION

#define DPX_C_VERSION   "V1.0"

Definition at line 20 of file dpx_hdr.h.

◆ DPX_GET_R32

#define DPX_GET_R32 (   hdr,
  fld 
)
Value:
DPX_VALID(hdr) ? \
dpx_get_r32(&(hdr)->fld,DPX_IS_BE(hdr)) : \
(float)(0xffffffff)

Definition at line 207 of file dpx_hdr.h.

◆ DPX_GET_TEXT

#define DPX_GET_TEXT (   hdr,
  fld,
  buf,
  len 
)
Value:
DPX_VALID(hdr) ? \
memcpy((void*)buf,(const void*)&((hdr)->fld),len) : \
memset((void*)buf,0xff,len)

Definition at line 243 of file dpx_hdr.h.

◆ DPX_GET_U16

#define DPX_GET_U16 (   hdr,
  fld 
)
Value:
DPX_VALID(hdr) ? \
dpx_get_u16(&(hdr)->fld,DPX_IS_BE(hdr)) : \
(uint16_t)(-1)

Definition at line 218 of file dpx_hdr.h.

◆ DPX_GET_U32

#define DPX_GET_U32 (   hdr,
  fld 
)
Value:
DPX_VALID(hdr) ? \
dpx_get_u32(&(hdr)->fld,DPX_IS_BE(hdr)) : \
(uint32_t)(-1)

Definition at line 195 of file dpx_hdr.h.

◆ DPX_GET_U8

#define DPX_GET_U8 (   hdr,
  fld 
)    DPX_VALID(hdr) ? (hdr)->fld : (uint8_t)(-1)

Definition at line 230 of file dpx_hdr.h.

◆ DPX_IS_BE

#define DPX_IS_BE (   p)    ((p) && ((p)->file_info.magic_num == DPX_C_MAGIC_BE))

Definition at line 34 of file dpx_hdr.h.

◆ DPX_SET_R32

#define DPX_SET_R32 (   hdr,
  fld,
  val 
)
Value:
do { \
if ( DPX_VALID(hdr)) \
dpx_set_r32(&(hdr)->fld,DPX_IS_BE(hdr),val); \
} while(0)

Definition at line 212 of file dpx_hdr.h.

◆ DPX_SET_TEXT

#define DPX_SET_TEXT (   hdr,
  fld,
  buf,
  len 
)
Value:
if ( DPX_VALID(hdr)) \
memcpy((void*)&((hdr)->fld),(const void*)buf,len)

Definition at line 238 of file dpx_hdr.h.

◆ DPX_SET_U16

#define DPX_SET_U16 (   hdr,
  fld,
  val 
)
Value:
do { \
if ( DPX_VALID(hdr)) \
dpx_set_u16(&(hdr)->fld,DPX_IS_BE(hdr),val); \
} while(0)

Definition at line 223 of file dpx_hdr.h.

◆ DPX_SET_U32

#define DPX_SET_U32 (   hdr,
  fld,
  val 
)
Value:
do { \
if ( DPX_VALID(hdr)) \
dpx_set_u32(&(hdr)->fld,DPX_IS_BE(hdr),val); \
} while(0)

Definition at line 200 of file dpx_hdr.h.

◆ DPX_SET_U8

#define DPX_SET_U8 (   hdr,
  fld,
  val 
)
Value:
if ( DPX_VALID(hdr)) \
(hdr)->fld = val

Definition at line 234 of file dpx_hdr.h.

◆ DPX_VALID

#define DPX_VALID (   p)
Value:
((p) && (((p)->file_info.magic_num==DPX_C_MAGIC) || \
((p)->file_info.magic_num==DPX_C_MAGIC_BE)))

Definition at line 30 of file dpx_hdr.h.

◆ FLD_OFFET

#define FLD_OFFET (   TYPE,
  field 
)    ((uint32_t)(&(((TYPE *)0)->field)))

Definition at line 192 of file dpx_hdr.h.

◆ SWAP16

#define SWAP16 (   e,
 
)    ((e) ? htons(v) : (v))

Definition at line 23 of file dpx_hdr.h.

◆ SWAP32

#define SWAP32 (   e,
 
)    ((e) ? htonl(v) : (v))

Definition at line 24 of file dpx_hdr.h.

◆ SWAPR32

#define SWAPR32 (   e,
 
)    ((e) ? htonf(v) : (v))

Definition at line 25 of file dpx_hdr.h.

◆ UNSWAP16

#define UNSWAP16 (   e,
 
)    ((e) ? ntohs(v) : (v))

Definition at line 26 of file dpx_hdr.h.

◆ UNSWAP32

#define UNSWAP32 (   e,
 
)    ((e) ? ntohl(v) : (v))

Definition at line 27 of file dpx_hdr.h.

◆ UNSWAPR32

#define UNSWAPR32 (   e,
 
)    ((e) ? ntohf(v) : (v))

Definition at line 28 of file dpx_hdr.h.

Typedef Documentation

◆ DPX_file_info_t

◆ DPX_film_t

◆ DPX_header_t

◆ DPX_image_element_t

◆ DPX_image_info_t

◆ DPX_image_source_t

◆ DPX_television_t

Function Documentation

◆ dpx_get_r32()

float AJA_EXPORT dpx_get_r32 ( const float *  ptr,
bool  BE 
)

Definition at line 95 of file dpx_hdr.cpp.

◆ dpx_get_u16()

uint16_t AJA_EXPORT dpx_get_u16 ( const uint16_t *  ptr,
bool  BE 
)

Definition at line 72 of file dpx_hdr.cpp.

◆ dpx_get_u32()

uint32_t AJA_EXPORT dpx_get_u32 ( const uint32_t *  ptr,
bool  BE 
)

Definition at line 57 of file dpx_hdr.cpp.

◆ dpx_set_r32()

void AJA_EXPORT dpx_set_r32 ( float *  ptr,
bool  BE,
float  val 
)

Definition at line 88 of file dpx_hdr.cpp.

◆ dpx_set_u16()

void AJA_EXPORT dpx_set_u16 ( uint16_t *  ptr,
bool  BE,
uint16_t  val 
)

Definition at line 81 of file dpx_hdr.cpp.

◆ dpx_set_u32()

void AJA_EXPORT dpx_set_u32 ( uint32_t *  ptr,
bool  BE,
uint32_t  val 
)

Definition at line 65 of file dpx_hdr.cpp.

nlohmann::json_abiNLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON_v3_11_NLOHMANN_JSON_VERSION_PATCH::detail::void
j template void())
Definition: json.hpp:4893
DPX_IS_BE
#define DPX_IS_BE(p)
Definition: dpx_hdr.h:34
DPX_C_MAGIC
#define DPX_C_MAGIC
Definition: dpx_hdr.h:18
DPX_C_MAGIC_BE
#define DPX_C_MAGIC_BE
Definition: dpx_hdr.h:19
DPX_VALID
#define DPX_VALID(p)
Definition: dpx_hdr.h:30