A little tidying up.
authorCarl Hetherington <cth@carlh.net>
Sun, 26 Jan 2014 22:25:11 +0000 (22:25 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 26 Jan 2014 22:25:11 +0000 (22:25 +0000)
13 files changed:
src/asset.h
src/certificates.cc
src/dcp.cc
src/dcp.h
src/kdm.h
src/mono_picture_frame.cc
src/mono_picture_frame.h
src/object.cc
src/object.h
src/signer.cc
src/util.cc
src/util.h
src/xml/kdm_smpte.h

index e8867ae551f7aa65363b3e53a87b47c79a5792cc..abaa63be88c2e1b8978f0e7939657b3c9a59b181 100644 (file)
@@ -39,7 +39,7 @@ namespace dcp {
  *  @brief Parent class for DCP assets, i.e. picture/sound/subtitles and CPLs.
  *
  *  Note that this class is not used for ReelAssets; they are just for the metadata
- *  that gets put into <Reel>s.
+ *  that gets put into &lt;Reel&gt;s.
  */
 class Asset : public Object
 {
index 222352f2e95b05bf461353c55a6823d000f51757..0a0393c652bdd6032c98c4a33d9f37a7eda804b6 100644 (file)
 
 */
 
+/** @file  src/certificates.cc
+ *  @brief Certificate and CertificateChain classes.
+ */
+
 #include "KM_util.h"
 #include "certificates.h"
 #include "compose.hpp"
@@ -160,7 +164,7 @@ Certificate::certificate (bool with_begin_end) const
 }
 
 /** @return Certificate's issuer, in the form
- *  dnqualifier=<dnQualififer>,CN=<commonName>,OU=<organizationalUnitName>,O=organizationName
+ *  dnqualifier=&lt;dnQualififer&gt;,CN=&lt;commonName&gt;,OU=&lt;organizationalUnitName&gt,O=&lt;organizationName&gt;
  *  and with + signs escaped to \+
  */
 string
index 808c040e74307d1be87f234bbfb9b0744f974e6f..dc67dd2ec31b67b60523f4d7becc1c6d0d00f51f 100644 (file)
@@ -52,8 +52,6 @@ using std::string;
 using std::list;
 using std::stringstream;
 using std::ostream;
-using std::copy;
-using std::back_inserter;
 using std::make_pair;
 using std::map;
 using boost::shared_ptr;
index 9f6d60fd8896de80c2edcd437a0616dec89831f1..3f4c8418de7acd5a2310f1df6ab41e9e3de4c96b 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 */
 
 /** @file  src/dcp.h
- *  @brief A class to create or read a DCP.
+ *  @brief DCP class.
  */
 
 #ifndef LIBDCP_DCP_H
@@ -73,6 +73,7 @@ public:
        /** Compare this DCP with another, according to various options.
         *  @param other DCP to compare this one to.
         *  @param options Options to define what "equality" means.
+        *  @param note Functor to handle notes made by the equality operation.
         *  @return true if the DCPs are equal according to EqualityOptions, otherwise false.
         */
        bool equals (DCP const & other, EqualityOptions options, boost::function<void (NoteType, std::string)> note) const;
@@ -113,6 +114,7 @@ private:
 
        /** the directory that we are writing to */
        boost::filesystem::path _directory;
+       /** the assets that make up this DCP */
        std::list<boost::shared_ptr<Asset> > _assets;
 };
 
index 9ee793c9601cfed455b4310e6758d5c189e9e528..567ff8444f437a949fd0f91eaf254014094406bb 100644 (file)
--- a/src/kdm.h
+++ b/src/kdm.h
@@ -161,8 +161,8 @@ public:
         *  @param recipient_cert Certificate of the projector that this KDM is targeted at.
         *  @param not_valid_before Start of validity period.
         *  @param not_valid_after End of validity period.
-        *  @param annotation_text Text for the <AnnotationText> node.
-        *  @param issue_date Text for the <IssueDate> node.
+        *  @param annotation_text Text for the &lt;AnnotationText&gt; node.
+        *  @param issue_date Text for the &lt;IssueDate&gt; node.
         */
        KDM (
                boost::shared_ptr<const CPL> cpl, boost::shared_ptr<const Signer> signer, boost::shared_ptr<const Certificate> recipient_cert,
index 964b543b8612f77cc70a196e43b3b7a732fade0a..9fa13d8884204f738f1c81443c31a2a2fda12500 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
-#include <openjpeg.h>
-#include "AS_DCP.h"
-#include "KM_fileio.h"
+/** @file  src/mono_picture_frame.cc
+ *  @brief MonoPictureFrame class.
+ */
+
 #include "mono_picture_frame.h"
 #include "exceptions.h"
 #include "argb_frame.h"
@@ -27,6 +28,9 @@
 #include "util.h"
 #include "gamma_lut.h"
 #include "rgb_xyz.h"
+#include "KM_fileio.h"
+#include "AS_DCP.h"
+#include <openjpeg.h>
 
 #define DCI_GAMMA 2.6
 
@@ -37,6 +41,7 @@ using namespace dcp;
 /** Make a picture frame from a 2D (monoscopic) asset.
  *  @param mxf_path Path to the asset's MXF file.
  *  @param n Frame within the asset, not taking EntryPoint into account.
+ *  @param c Context for decryption, or 0.
  */
 MonoPictureFrame::MonoPictureFrame (boost::filesystem::path mxf_path, int n, ASDCP::AESDecContext* c)
 {
@@ -54,17 +59,20 @@ MonoPictureFrame::MonoPictureFrame (boost::filesystem::path mxf_path, int n, ASD
        }
 }
 
+/** MonoPictureFrame destructor */
 MonoPictureFrame::~MonoPictureFrame ()
 {
        delete _buffer;
 }
 
+/** @return Pointer to JPEG2000 data */
 uint8_t const *
 MonoPictureFrame::j2k_data () const
 {
        return _buffer->RoData ();
 }
 
+/** @return Size of JPEG2000 data in bytes */
 int
 MonoPictureFrame::j2k_size () const
 {
@@ -74,11 +82,12 @@ MonoPictureFrame::j2k_size () const
 /** @param reduce a factor by which to reduce the resolution
  *  of the image, expressed as a power of two (pass 0 for no
  *  reduction).
+ *  @param srgb_gamma Reciprocal of output gamma to use after
+ *  the conversion from XYZ to RGB.
  *
  *  @return An ARGB representation of this frame.  This is ARGB in the
  *  Cairo sense, so that each pixel takes up 4 bytes; the first byte
  *  is blue, second green, third red and fourth alpha (always 255).
- *
  */
 shared_ptr<ARGBFrame>
 MonoPictureFrame::argb_frame (int reduce, float srgb_gamma) const
index 44df68c9e52b17fd5e74adfad0d41ab747c88b0e..cc6096cd8c705093b8333c48ad989a5bdbe48391 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
+/** @file  src/mono_picture_frame.h
+ *  @brief MonoPictureFrame class.
+ */
+
+#include "types.h"
+#include <boost/shared_ptr.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/filesystem.hpp>
 #include <string>
 #include <stdint.h>
-#include <boost/shared_ptr.hpp>
-#include "types.h"
 
 namespace ASDCP {
        namespace JP2K {
@@ -33,8 +39,10 @@ namespace dcp {
 
 class ARGBFrame;
 
-/** A single frame of a 2D (monoscopic) picture asset */       
-class MonoPictureFrame
+/** @class MonoPictureFrame
+ *  @brief A single frame of a 2D (monoscopic) picture asset.
+ */
+class MonoPictureFrame : public boost::noncopyable
 {
 public:
        MonoPictureFrame (boost::filesystem::path mxf_path, int n, ASDCP::AESDecContext *);
index e3849d792f6c114c39e6a12bc1f02259936ce354..315e501aaf4403f37f5de4a68439d2b783a9489a 100644 (file)
 
 */
 
+/** @file  src/object.cc
+ *  @brief Object class.
+ */
+
 #include "object.h"
 #include "util.h"
 
@@ -31,7 +35,7 @@ Object::Object ()
 }
 
 /** Create an Object with a given ID.
- *  @param ID to use.
+ *  @param id ID to use.
  */
 Object::Object (string id)
        : _id (id)
index e12888e8b337016a8b3def3febfa9a95896279d7..1b99e363b2e58da79ad89862c9131496b709ec07 100644 (file)
 
 */
 
+/** @file  src/object.h
+ *  @brief Object class.
+ */
+
 #ifndef LIBDCP_OBJECT_H
 #define LIBDCP_OBJECT_H
 
index 4c5d199a25514e4cc05df90dfaa03fd154d06f87..a280cb07af0ff693fd15f306fca1dbe9ce31584a 100644 (file)
@@ -38,7 +38,7 @@ using namespace dcp;
 
 /** Add a &lt;Signer&gt; and &lt;ds:Signature&gt; nodes to an XML node.
  *  @param parent XML node to add to.
- *  @param interop true to use Interop standards, false for SMPTE.
+ *  @param standard INTEROP or SMPTE.
  */
 void
 Signer::sign (xmlpp::Element* parent, Standard standard) const
index fe89ca72fbe2299c8a20390a4c085deb46e1f170..767c149090db42514738eff71bd0ee58b5632000 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -121,7 +121,7 @@ dcp::make_digest (boost::filesystem::path filename, boost::function<void (float)
 }
 
 /** Convert a content kind to a string which can be used in a
- *  <ContentKind> node.
+ *  &lt;ContentKind&gt; node.
  *  @param kind ContentKind.
  *  @return string.
  */
@@ -154,7 +154,7 @@ dcp::content_kind_to_string (ContentKind kind)
        assert (false);
 }
 
-/** Convert a string from a <ContentKind> node to a libdcp ContentKind.
+/** Convert a string from a &lt;ContentKind&gt; node to a libdcp ContentKind.
  *  Reasonably tolerant about varying case.
  *  @param type Content kind string.
  *  @return libdcp ContentKind.
@@ -237,6 +237,9 @@ dcp::empty_or_white_space (string s)
        return true;
 }
 
+/** Set up various bits that the library needs.  Should be called one
+ *  by client applications.
+ */
 void
 dcp::init ()
 {
@@ -269,8 +272,14 @@ bool dcp::operator!= (dcp::Size const & a, dcp::Size const & b)
        return !(a == b);
 }
 
-/** The base64 decode routine in KM_util.cpp gives different values to both
- *  this and the command-line base64 for some inputs.  Not sure why.
+/** Decode a base64 string.  The base64 decode routine in KM_util.cpp
+ *  gives different values to both this and the command-line base64
+ *  for some inputs.  Not sure why.
+ *
+ *  @param in base64-encoded string.
+ *  @param out Output buffer.
+ *  @param out_length Length of output buffer.
+ *  @return Number of characters written to the output buffer.
  */
 int
 dcp::base64_decode (string const & in, unsigned char* out, int out_length)
@@ -297,6 +306,11 @@ dcp::base64_decode (string const & in, unsigned char* out, int out_length)
        return N;
 }
 
+/** Convert a struct tm to a string of the form
+ *  2014-01-26T21:39:00+01:00
+ *  @param tm struct tm.
+ *  @return Time as a string.
+ */
 string
 dcp::tm_to_string (struct tm* tm)
 {
@@ -339,6 +353,11 @@ dcp::utc_offset_to_string (int b)
        return o.str ();
 }
 
+/** Convert a boost::posix_time::ptime to a string of the form
+ *  2014-01-26T21:39:00+01:00.
+ *  @param t boost::posix_time::ptime.
+ *  @return Time as a string.
+ */
 string
 dcp::ptime_to_string (boost::posix_time::ptime t)
 {
@@ -347,10 +366,14 @@ dcp::ptime_to_string (boost::posix_time::ptime t)
 }
 
 
-/* Apparently there is no way to create an ofstream using a UTF-8
-   filename under Windows.  We are hence reduced to using fopen
-   with this wrapper.
-*/
+/** @param p Path to open.
+ *  @param t mode flags, as for fopen(3).
+ *  @return FILE pointer or 0 on error.
+ *
+ *  Apparently there is no way to create an ofstream using a UTF-8
+ *  filename under Windows.  We are hence reduced to using fopen
+ *  with this wrapper.
+ */
 FILE *
 dcp::fopen_boost (boost::filesystem::path p, string t)
 {
index 5d7a9c4f96cc4513da15a76a208211621d8c63b7..e26c73326000b46a1aca11e7f2ab29906b84887a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
  *  @brief Utility methods.
  */
 
-#include <string>
-#include <stdint.h>
+#include "types.h"
 #include <boost/shared_ptr.hpp>
 #include <boost/function.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <boost/filesystem.hpp>
 #include <openjpeg.h>
-#include "types.h"
+#include <string>
+#include <stdint.h>
 
 namespace xmlpp {
        class Element;
@@ -44,7 +44,8 @@ class CertificateChain;
 class GammaLUT;
 class XYZFrame;
 
-struct Size {
+struct Size
+{
        Size ()
                : width (0)
                , height (0)
index 49281d70a1e58c61c8dc8345d35853ae6a192987..7154958abb467d1940a4d49a9c9b7cdac6f8b40c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 #ifndef LIBDCP_XML_KDM_SMPTE_H
 #define LIBDCP_XML_KDM_SMPTE_H
 
-#include <string>
-#include <list>
-#include <boost/optional.hpp>
-#include <boost/filesystem.hpp>
+#include "../exceptions.h"
+#include <libcxml/cxml.h>
 #include <libxml/parser.h>
 #include <libxml++/libxml++.h>
-#include <libcxml/cxml.h>
-#include "../exceptions.h"
+#include <boost/optional.hpp>
+#include <boost/filesystem.hpp>
+#include <string>
+#include <list>
 
 namespace dcp {
 namespace xml {