Fix code and tests so that SubtitleString::v_position is between 0 and 1 (not a perce...
[libdcp.git] / src / xyz_frame.cc
index 4c793f22eb53388e7882ece863094c5fae8a69a0..f1c6949173cbc1edb5c7ffb14507a334daef9b62 100644 (file)
 
 */
 
+/** @file  src/xyz_frame.cc
+ *  @brief XZYFrame class.
+ */
+
 #include "xyz_frame.h"
-#include <cassert>
+#include "dcp_assert.h"
 #include <stdexcept>
 
 using namespace dcp;
@@ -27,9 +31,12 @@ using namespace dcp;
 XYZFrame::XYZFrame (opj_image_t* image)
        : _opj_image (image)
 {
-       assert (_opj_image->numcomps == 3);
+       DCP_ASSERT (_opj_image->numcomps == 3);
 }
 
+/** Construct a new XYZFrame with undefined contents.
+ *  @param size Size for the frame in pixels.
+ */
 XYZFrame::XYZFrame (Size size)
 {
        opj_image_cmptparm_t cmptparm[3];
@@ -58,18 +65,23 @@ XYZFrame::XYZFrame (Size size)
        _opj_image->y1 = size.height;
 }
 
+/** XYZFrame destructor */
 XYZFrame::~XYZFrame ()
 {
        opj_image_destroy (_opj_image);
 }
 
+/** @param c Component index (0, 1 or 2)
+ *  @return Pointer to the data for component c; 12-bit values from 0-4095.
+ */
 int *
 XYZFrame::data (int c) const
 {
-       assert (c >= 0 && c < 3);
+       DCP_ASSERT (c >= 0 && c < 3);
        return _opj_image->comps[c].data;
 }
 
+/** @return Size of the image in pixels */
 dcp::Size
 XYZFrame::size () const
 {