Comment tweaks.
authorCarl Hetherington <cth@carlh.net>
Wed, 9 Jan 2013 23:18:13 +0000 (23:18 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 9 Jan 2013 23:18:13 +0000 (23:18 +0000)
14 files changed:
doc/mainpage.txt
src/argb_frame.cc
src/asset_map.h
src/cpl_file.h
src/dcp.cc
src/dcp.h
src/dcp_time.cc
src/dcp_time.h
src/exceptions.h
src/mxf_asset.h
src/reel.h
src/types.cc
src/types.h
src/xml.h

index 497b6a0193b9cc1380c3306621016e057bd930c6..b4cb21d57cefc6c4b346c4fc85ee246587161e1d 100644 (file)
@@ -2,7 +2,8 @@
 
 @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.
@@ -17,7 +18,7 @@ An example of DCP creation is given in examples/make_dcp.cc.
 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>
index 7a9ad2b94825b421cf4e7ee2a9b4d28cab073221..8e54e3b48ef55a94a475babd99d88713886eab92 100644 (file)
 
 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)
@@ -34,6 +39,7 @@ ARGBFrame::~ARGBFrame ()
        delete[] _data;
 }
 
+/** @return The stride, in bytes; that is, the number of bytes per row of the image */
 int
 ARGBFrame::stride () const
 {
index 10a0915f23643c7ada179b77b78abc696937a7d6..8cf89b4b72f4f2b4df7c0224c617dc3aef1147aa 100644 (file)
@@ -27,6 +27,9 @@
 
 namespace libdcp {
 
+/** @class Chunk
+ *  @brief A simple parser for and representation of a \<Chunk\> node within an asset map.
+ */
 class Chunk : public XMLNode
 {
 public:
@@ -39,6 +42,9 @@ 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:
@@ -50,6 +56,9 @@ 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:
index 14bcafd0b2aa1283031aa544775b92780804de99..67b38a0d70f112c34ab346a1814dc3cec3adc5dd 100644 (file)
@@ -27,6 +27,7 @@
 
 namespace libdcp {
 
+/** @brief A simple parser for and representation of a CPL \<Picture\> node */
 class Picture : public XMLNode
 {
 public:
@@ -44,7 +45,7 @@ public:
 };
 
 
-/** CPL MainPicture node */
+/** @brief A simple parser for and representation of a CPL \<MainPicture\> node */
 class MainPicture : public Picture
 {
 public:
@@ -52,7 +53,7 @@ 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:
@@ -60,7 +61,7 @@ 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:
@@ -75,7 +76,7 @@ public:
        int64_t duration;
 };
 
-/** CPL MainSubtitle node */   
+/** @brief A simple parser for and representation of a CPL \<MainSubtitle\> node */
 class MainSubtitle : public XMLNode
 {
 public:
@@ -90,7 +91,7 @@ public:
        int64_t duration;
 };
 
-/** CPL AssetList node */      
+/** @brief A simple parser for and representation of a CPL \<AssetList\> node */
 class CPLAssetList : public XMLNode
 {
 public:
@@ -103,7 +104,7 @@ 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:
@@ -114,7 +115,8 @@ 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:
index 5db29beba7a2dafe1732b01a1ed7ae2919ae9313..a5e21d9f50a70c5ce035b3829726e429f76ad66d 100644 (file)
@@ -307,6 +307,12 @@ CPL::CPL (string directory, string name, ContentKind content_kind, int length, i
        _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)
index d4f6aff9aba9a64a377da1caed718eb789b4b1f8..b01934def38c43ff4012f4f77b1f0629f72835e7 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -45,6 +45,7 @@ class SubtitleAsset;
 class Reel;
 class AssetMap;
 
+/** @brief A CPL within a DCP */
 class CPL
 {
 public:
@@ -102,7 +103,9 @@ private:
        /** reels */
        std::list<boost::shared_ptr<const Reel> > _reels;
 
+       /** our UUID */
        std::string _uuid;
+       /** a SHA1 digest of our XML */
        mutable std::string _digest;
 };
 
@@ -181,6 +184,7 @@ private:
 
        /** the directory that we are writing to */
        std::string _directory;
+       /** our CPLs */
        std::list<boost::shared_ptr<const CPL> > _cpls;
 };
 
index c9cd751a7dd91a1a594576410fe45b2889a696a1..15ad05d430d84da9f4282c0617100a5cec70a0f5 100644 (file)
@@ -217,6 +217,7 @@ libdcp::operator/ (Time a, Time const & b)
        return float (at) / bt;
 }
 
+/** @return A string of the form h:m:s:t */
 string
 Time::to_string () const
 {
@@ -225,6 +226,7 @@ Time::to_string () const
        return str.str ();
 }
 
+/** @return This time in ticks */
 int64_t
 Time::to_ticks () const
 {
index 8033348b6b14ba97155f1a1a91f916c4a0530003..48698dcc91c1e1d863842a72d619308471657734 100644 (file)
@@ -39,7 +39,13 @@ public:
         *  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_)
index 25e51c9e2d17dcd91eefb0c2846220a24509e6ce..4c53a66dd1664c10d1dc1352ac99306f71cbcfdd 100644 (file)
@@ -55,6 +55,7 @@ private:
        std::string _filename;
 };
 
+/** @brief An exception related to an MXF file */
 class MXFFileError : public FileError
 {
 public:
index 03f2aa6b486f8427695aba558f8649d9658ca319..b1cb87fefbd77ff826df39e123b97b85270d79ab 100644 (file)
@@ -26,6 +26,7 @@
 namespace libdcp
 {
 
+/** @brief Parent class for assets which have MXF files */     
 class MXFAsset : public Asset
 {
 public:
index 08a438ddbeed51e9f6d62252789fc0072ef9abe1..c7d3b1648142fedc3ee0511c33ac8ddf8c4f748c 100644 (file)
@@ -27,6 +27,7 @@ class PictureAsset;
 class SoundAsset;      
 class SubtitleAsset;   
 
+/** @brief A reel within a DCP; the part which actually contains picture, sound and subtitle data */   
 class Reel
 {
 public:
index a00e82613bf50385b2954cc024fa9cf4061f34a0..ac01ae451466ee68c3dd9ce75eaaa8766841551b 100644 (file)
@@ -49,6 +49,10 @@ Color::Color (int r_, int g_, int b_)
 
 }
 
+/** 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;
@@ -57,6 +61,9 @@ Color::Color (string argb_hex)
        }
 }
 
+/** @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
 {
@@ -72,12 +79,20 @@ 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)
 {
index 433a910cddf9423ca9d63281f881a2419beaa9dc..f1b5f640908d2bd1a851224f8138bf663be28617 100644 (file)
@@ -105,6 +105,9 @@ struct EqualityOptions {
        int max_audio_sample_error;
 };
 
+/** @class Color
+ *  @brief An RGB color (aka colour).
+ */
 class Color
 {
 public:
@@ -112,9 +115,9 @@ 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;
 };
index acace8461e2be49c5a597e66f4f78e9b24c80059..6fc0d0fa6e3acfa93dd5f3c376c6f776b885c7a3 100644 (file)
--- a/src/xml.h
+++ b/src/xml.h
@@ -18,6 +18,7 @@ namespace xmlpp {
 
 namespace libdcp {
 
+/** @brief A helper class for XML nodes */
 class XMLNode
 {
 public:
@@ -86,6 +87,7 @@ private:
        std::list<Glib::ustring> _taken;
 };
 
+/** @brief A helper class for XML files */     
 class XMLFile : public XMLNode
 {
 public: