summaryrefslogtreecommitdiff
path: root/src/MXFTypes.cpp
diff options
context:
space:
mode:
authormschroffel <mschroffel@cinecert.com>2015-02-19 22:42:18 +0000
committermschroffel <>2015-02-19 22:42:18 +0000
commit528cacb6122b33f73a805fbb47b4ae83a46db418 (patch)
treead68a5c66b827dba27ed0d84c54735aa5dee0569 /src/MXFTypes.cpp
parent665b2e2e5dcf2266e636d29bcf4ef281da65117f (diff)
banner updates to 2015
Diffstat (limited to 'src/MXFTypes.cpp')
-rwxr-xr-xsrc/MXFTypes.cpp59
1 files changed, 58 insertions, 1 deletions
diff --git a/src/MXFTypes.cpp b/src/MXFTypes.cpp
index c575b96..46ddf61 100755
--- a/src/MXFTypes.cpp
+++ b/src/MXFTypes.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2005-2012, John Hurst
+Copyright (c) 2005-2015, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -668,6 +668,63 @@ ASDCP::MXF::TLVWriter::WriteUi64(const MDDEntry& Entry, ui64_t* value)
//----------------------------------------------------------------------------------------------------
//
+
+ASDCP::MXF::RGBALayout::RGBALayout()
+{
+ memset(m_value, 0, RGBAValueLength);
+}
+
+ASDCP::MXF::RGBALayout::RGBALayout(const byte_t* value)
+{
+ memcpy(m_value, value, RGBAValueLength);
+}
+
+ASDCP::MXF::RGBALayout::~RGBALayout()
+{
+}
+
+static char
+get_char_for_code(byte_t c)
+{
+ for ( int i = 0; ASDCP::MXF::RGBALayoutTable[i].code != 0; ++i )
+ {
+ if ( ASDCP::MXF::RGBALayoutTable[i].code == c )
+ {
+ return ASDCP::MXF::RGBALayoutTable[i].symbol;
+ }
+ }
+
+ return '_';
+}
+
+//
+const char*
+ASDCP::MXF::RGBALayout::EncodeString(char* buf, ui32_t buf_len) const
+{
+ std::string tmp_str;
+ char tmp_buf[64];
+
+ for ( int i = 0; i < RGBAValueLength && m_value[i] != 0; i += 2 )
+ {
+ snprintf(tmp_buf, 64, "%c(%d)", get_char_for_code(m_value[i]), m_value[i+1]);
+
+ if ( ! tmp_str.empty() )
+ {
+ tmp_str += " ";
+ }
+
+ tmp_str += tmp_buf;
+ }
+
+ assert(tmp_str.size() < buf_len);
+ strncpy(buf, tmp_str.c_str(), tmp_str.size());
+ return buf;
+}
+
+
+//----------------------------------------------------------------------------------------------------
+//
+
ASDCP::MXF::Raw::Raw()
{
Capacity(256);