#include "colour_conversion.h"
#include "config.h"
#include "digester.h"
+#include "player_video.h"
#include "util.h"
#include <dcp/chromaticity.h>
#include <dcp/gamma_transfer_function.h>
#include <dcp/identity_transfer_function.h>
#include <dcp/modified_gamma_transfer_function.h>
+#include <dcp/openjpeg_image.h>
#include <dcp/raw_convert.h>
+#include <dcp/rgb_xyz.h>
#include <dcp/s_gamut3_transfer_function.h>
#include <dcp/warnings.h>
#include <libcxml/cxml.h>
using std::string;
using std::vector;
using boost::optional;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
using dcp::raw_convert;
DCPOMATIC_ASSERT (false);
}
+
+
+shared_ptr<dcp::OpenJPEGImage>
+convert_to_xyz (shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note)
+{
+ shared_ptr<dcp::OpenJPEGImage> xyz;
+
+ auto image = frame->image (bind(&PlayerVideo::keep_xyz_or_rgb, _1), VideoRange::FULL, false);
+ if (frame->colour_conversion()) {
+ xyz = dcp::rgb_to_xyz (
+ image->data()[0],
+ image->size(),
+ image->stride()[0],
+ frame->colour_conversion().get(),
+ note
+ );
+ } else {
+ xyz = make_shared<dcp::OpenJPEGImage>(image->data()[0], image->size(), image->stride()[0]);
+ }
+
+ return xyz;
+}
+
*/
+
#ifndef DCPOMATIC_COLOUR_CONVERSION_H
#define DCPOMATIC_COLOUR_CONVERSION_H
+
/* Hack for OS X compile failure; see https://bugs.launchpad.net/hugin/+bug/910160 */
#ifdef check
#undef check
#endif
+
#include <dcp/colour_conversion.h>
+#include <dcp/types.h>
#include <libcxml/cxml.h>
+
namespace xmlpp {
class Node;
}
+namespace dcp {
+ class OpenJPEGImage;
+}
+
+
+class PlayerVideo;
+
+
class ColourConversion : public dcp::ColourConversion
{
public:
bool operator!= (ColourConversion const &, ColourConversion const &);
bool operator== (PresetColourConversion const &, PresetColourConversion const &);
+
+extern std::shared_ptr<dcp::OpenJPEGImage> convert_to_xyz (std::shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note);
+
+
#endif
*/
+#include "colour_conversion.h"
#include "compose.hpp"
#include "config.h"
#include "cross.h"
_resolution = Resolution (node->optional_number_child<int>("Resolution").get_value_or(static_cast<int>(Resolution::TWO_K)));
}
-shared_ptr<dcp::OpenJPEGImage>
-DCPVideo::convert_to_xyz (shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note)
-{
- shared_ptr<dcp::OpenJPEGImage> xyz;
-
- auto image = frame->image (bind(&PlayerVideo::keep_xyz_or_rgb, _1), VideoRange::FULL, false);
- if (frame->colour_conversion()) {
- xyz = dcp::rgb_to_xyz (
- image->data()[0],
- image->size(),
- image->stride()[0],
- frame->colour_conversion().get(),
- note
- );
- } else {
- xyz = make_shared<dcp::OpenJPEGImage>(image->data()[0], image->size(), image->stride()[0]);
- }
-
- return xyz;
-}
/** J2K-encode this frame on the local host.
* @return Encoded data.
bool same (std::shared_ptr<const DCPVideo> other) const;
- static std::shared_ptr<dcp::OpenJPEGImage> convert_to_xyz (std::shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note);
-
private:
void add_metadata (xmlpp::Element *) const;
/* We must copy the PlayerVideo here as we will call ::image() on it, potentially
with a different pixel_format than was used when ::prepare() was called.
*/
- _image = DCPVideo::convert_to_xyz (image->shallow_copy(), [](dcp::NoteType, string) {});
+ _image = convert_to_xyz (image->shallow_copy(), [](dcp::NoteType, string) {});
_dirty = true;
Refresh ();
}