@mainpage libdcp
-libdcp is a small library to create and read Digital Cinema Packages (DCPs) from JPEG2000 and WAV files.
+libdcp is a library to create Digital Cinema Packages (DCPs) from JPEG2000 and WAV files, and also to
+read and process existing DCPs.
Most of the hard work is done by a (slightly patched) version of asdcplib (http://www.cinecert.com/asdcplib/)
which is included in the source distribution for libdcp.
Reading existing DCPs
--
-Alternatively libdcp can be used to read existing DCPs and examine their content. You might do
+libdcp can be used to read existing DCPs and examine their content. You might do
@code
#include <libdcp/dcp.h>
using namespace libdcp;
+/** Construct an empty ARGBFrame with a given width and height and with
+ * undefined contents.
+ * @param width Width in pixels.
+ * @param height Height in pixels.
+ */
ARGBFrame::ARGBFrame (int width, int height)
: _width (width)
, _height (height)
delete[] _data;
}
+/** @return The stride, in bytes; that is, the number of bytes per row of the image */
int
ARGBFrame::stride () const
{
namespace libdcp {
+/** @class Chunk
+ * @brief A simple parser for and representation of a \<Chunk\> node within an asset map.
+ */
class Chunk : public XMLNode
{
public:
int64_t length;
};
+/** @class AssetMapAsset
+ * @brief A simple parser for and representation of an \<AssetMap\> node within an asset map.
+ */
class AssetMapAsset : public XMLNode
{
public:
std::list<boost::shared_ptr<Chunk> > chunks;
};
+/** @class AssetMap
+ * @brief A simple parser for and representation of an asset map file.
+ */
class AssetMap : public XMLFile
{
public:
namespace libdcp {
+/** @brief A simple parser for and representation of a CPL \<Picture\> node */
class Picture : public XMLNode
{
public:
};
-/** CPL MainPicture node */
+/** @brief A simple parser for and representation of a CPL \<MainPicture\> node */
class MainPicture : public Picture
{
public:
MainPicture (xmlpp::Node const * node);
};
-/** CPL MainStereoscopicPicture node */
+/** @brief A simple parser for and representation of a CPL \<MainStereoscopicPicture\> node */
class MainStereoscopicPicture : public Picture
{
public:
MainStereoscopicPicture (xmlpp::Node const * node);
};
-/** CPL MainSound node */
+/** @brief A simple parser for and representation of a CPL \<MainSound\> node */
class MainSound : public XMLNode
{
public:
int64_t duration;
};
-/** CPL MainSubtitle node */
+/** @brief A simple parser for and representation of a CPL \<MainSubtitle\> node */
class MainSubtitle : public XMLNode
{
public:
int64_t duration;
};
-/** CPL AssetList node */
+/** @brief A simple parser for and representation of a CPL \<AssetList\> node */
class CPLAssetList : public XMLNode
{
public:
boost::shared_ptr<MainSubtitle> main_subtitle;
};
-/** CPL Reel node */
+/** @brief A simple parser for and representation of a CPL \<Reel\> node */
class CPLReel : public XMLNode
{
public:
boost::shared_ptr<CPLAssetList> asset_list;
};
-/** CPL ContentVersion node */
+
+/** @brief A simple parser for and representation of a CPL \<ContentVersion\> node */
class ContentVersion : public XMLNode
{
public:
_uuid = make_uuid ();
}
+/** Construct a CPL object from a XML file.
+ * @param directory The directory containing this CPL's DCP.
+ * @param file The CPL XML filename.
+ * @param asset_map The corresponding asset map.
+ * @param require_mxfs true to throw an exception if a required MXF file does not exist.
+ */
CPL::CPL (string directory, string file, shared_ptr<const AssetMap> asset_map, bool require_mxfs)
: _directory (directory)
, _content_kind (FEATURE)
class Reel;
class AssetMap;
+/** @brief A CPL within a DCP */
class CPL
{
public:
/** reels */
std::list<boost::shared_ptr<const Reel> > _reels;
+ /** our UUID */
std::string _uuid;
+ /** a SHA1 digest of our XML */
mutable std::string _digest;
};
/** the directory that we are writing to */
std::string _directory;
+ /** our CPLs */
std::list<boost::shared_ptr<const CPL> > _cpls;
};
return float (at) / bt;
}
+/** @return A string of the form h:m:s:t */
string
Time::to_string () const
{
return str.str ();
}
+/** @return This time in ticks */
int64_t
Time::to_ticks () const
{
* and a frames per second count.
*/
Time (int frame, int frames_per_second);
-
+
+ /** Construct a Time from hours, minutes, seconds and ticks.
+ * @param h_ Hours.
+ * @param m_ Minutes.
+ * @param s_ Seconds.
+ * @param t_ Ticks (where 1 tick is 4 milliseconds).
+ */
Time (int h_, int m_, int s_, int t_)
: h (h_)
, m (m_)
std::string _filename;
};
+/** @brief An exception related to an MXF file */
class MXFFileError : public FileError
{
public:
namespace libdcp
{
+/** @brief Parent class for assets which have MXF files */
class MXFAsset : public Asset
{
public:
class SoundAsset;
class SubtitleAsset;
+/** @brief A reel within a DCP; the part which actually contains picture, sound and subtitle data */
class Reel
{
public:
}
+/** Construct a Color from an ARGB hex string; the alpha value is ignored.
+ * @param argb_hex A string of the form AARRGGBB, where e.g. RR is a two-character
+ * hex value.
+ */
Color::Color (string argb_hex)
{
int alpha;
}
}
+/** @return An ARGB string of the form AARRGGBB, where e.g. RR is a two-character
+ * hex value. The alpha value will always be FF (ie 255; maximum alpha).
+ */
string
Color::to_argb_string () const
{
return t;
}
+/** operator== for Colors.
+ * @param a First color to compare.
+ * @param b Second color to compare.
+ */
bool
libdcp::operator== (Color const & a, Color const & b)
{
return (a.r == b.r && a.g == b.g && a.b == b.b);
}
+/** operator!= for Colors.
+ * @param a First color to compare.
+ * @param b Second color to compare.
+ */
bool
libdcp::operator!= (Color const & a, Color const & b)
{
int max_audio_sample_error;
};
+/** @class Color
+ * @brief An RGB color (aka colour).
+ */
class Color
{
public:
Color (int r_, int g_, int b_);
Color (std::string argb_hex);
- int r;
- int g;
- int b;
+ int r; ///< red component, from 0 to 255
+ int g; ///< green component, from 0 to 255
+ int b; ///< blue component, from 0 to 255
std::string to_argb_string () const;
};
namespace libdcp {
+/** @brief A helper class for XML nodes */
class XMLNode
{
public:
std::list<Glib::ustring> _taken;
};
+/** @brief A helper class for XML files */
class XMLFile : public XMLNode
{
public: