Comment / tidy.
[libdcp.git] / src / stereo_picture_frame.cc
index 6af790336fe0ce9d19dc1ef803a771297b1f4d2d..780ac3622e37bde8370693de9c2002ab3181b73e 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"
 #include "stereo_picture_frame.h"
 #include "exceptions.h"
 #include "argb_frame.h"
-#include "lut.h"
 #include "util.h"
 #include "gamma_lut.h"
 #include "rgb_xyz.h"
+#include "AS_DCP.h"
+#include "KM_fileio.h"
+#include <openjpeg.h>
 
 #define DCI_GAMMA 2.6
 
 using std::string;
 using boost::shared_ptr;
-using namespace libdcp;
+using namespace dcp;
 
 /** Make a picture frame from a 3D (stereoscopic) asset.
  *  @param mxf_path Path to the asset's MXF file.
@@ -41,8 +40,9 @@ using namespace libdcp;
 StereoPictureFrame::StereoPictureFrame (boost::filesystem::path mxf_path, int n)
 {
        ASDCP::JP2K::MXFSReader reader;
-       if (ASDCP_FAILURE (reader.OpenRead (mxf_path.string().c_str()))) {
-               boost::throw_exception (FileError ("could not open MXF file for reading", mxf_path));
+       Kumu::Result_t r = reader.OpenRead (mxf_path.string().c_str());
+       if (ASDCP_FAILURE (r)) {
+               boost::throw_exception (FileError ("could not open MXF file for reading", mxf_path, r));
        }
 
        /* XXX: unfortunate guesswork on this buffer size */
@@ -58,11 +58,12 @@ StereoPictureFrame::~StereoPictureFrame ()
        delete _buffer;
 }
 
-/** @param reduce a factor by which to reduce the resolution
+/** @param eye Eye to return (EYE_LEFT or EYE_RIGHT).
+ *  @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 eye Eye to return (EYE_LEFT or EYE_RIGHT).
+ *  @param srgb_gamma Reciprocal of gamma to use when doing the
+ *  output gamma correction (after conversion from XYZ to RGB).
  *
  *  @return An ARGB representation of one of the eyes (left or right)
  *  of this frame.  This is ARGB in the Cairo sense, so that each