shared_ptr<dcp::MonoPictureMXF> mono = dynamic_pointer_cast<dcp::MonoPictureMXF> (mxf);
shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (mxf);
- shared_ptr<Image> image (new Image (PIX_FMT_RGB48LE, _video_size.get(), false));
-
if (mono) {
- mono->get_frame(0)->rgb_frame (image);
+ mono->get_frame(0)->xyz_image ();
} else {
- stereo->get_frame(0)->rgb_frame (dcp::EYE_LEFT, image);
+ stereo->get_frame(0)->xyz_image (dcp::EYE_LEFT);
}
}
#include "player_video.h"
#include "encoded_data.h"
#include <libcxml/cxml.h>
-#include <dcp/xyz_frame.h>
+#include <dcp/xyz_image.h>
#include <dcp/rgb_xyz.h>
#include <dcp/colour_matrix.h>
#include <dcp/raw_convert.h>
shared_ptr<EncodedData>
DCPVideo::encode_locally (dcp::NoteHandler note)
{
- shared_ptr<dcp::XYZFrame> xyz;
+ shared_ptr<dcp::XYZImage> xyz;
+ shared_ptr<Image> image = _frame->image (AV_PIX_FMT_RGB48LE, _burn_subtitles, note);
if (_frame->colour_conversion()) {
xyz = dcp::rgb_to_xyz (
- _frame->image (AV_PIX_FMT_RGB48LE, _burn_subtitles, note),
+ image->data()[0],
+ image->size(),
+ image->stride()[0],
_frame->colour_conversion().get()
);
} else {
- xyz = dcp::xyz_to_xyz (_frame->image (AV_PIX_FMT_RGB48LE, _burn_subtitles, note));
+ xyz = dcp::xyz_to_xyz (image->data()[0], image->size(), image->stride()[0]);
}
/* Set the max image and component sizes based on frame_rate */
* @param s Size in pixels.
*/
Image::Image (AVPixelFormat p, dcp::Size s, bool aligned)
- : dcp::Image (s)
+ : _size (s)
, _pixel_format (p)
, _aligned (aligned)
{
}
Image::Image (Image const & other)
- : dcp::Image (other)
- , _pixel_format (other._pixel_format)
+ : _size (other._size)
+ , _pixel_format (other._pixel_format)
, _aligned (other._aligned)
{
allocate ();
}
Image::Image (AVFrame* frame)
- : dcp::Image (dcp::Size (frame->width, frame->height))
+ : _size (frame->width, frame->height)
, _pixel_format (static_cast<AVPixelFormat> (frame->format))
, _aligned (true)
{
}
Image::Image (shared_ptr<const Image> other, bool aligned)
- : dcp::Image (other)
+ : _size (other->_size)
, _pixel_format (other->_pixel_format)
, _aligned (aligned)
{
void
Image::swap (Image & other)
{
- dcp::Image::swap (other);
-
+ std::swap (_size, other._size);
std::swap (_pixel_format, other._pixel_format);
for (int i = 0; i < 4; ++i) {
#include "position.h"
#include "position_image.h"
#include "types.h"
-#include <dcp/image.h>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavfilter/avfilter.h>
class Scaler;
class Socket;
-class Image : public dcp::Image
+class Image
{
public:
Image (AVPixelFormat, dcp::Size, bool);
float bytes_per_pixel (int) const;
void yuv_16_black (uint16_t, bool);
static uint16_t swap_16 (uint16_t);
-
+
+ dcp::Size _size;
AVPixelFormat _pixel_format; ///< FFmpeg's way of describing the pixel format of this Image
uint8_t** _data; ///< array of pointers to components
int* _line_size; ///< array of sizes of the data in each line, in pixels (without any alignment padding bytes)
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 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 "exceptions.h"
#include "config.h"
#include "cross.h"
-#include <dcp/xyz_frame.h>
#include <dcp/exceptions.h>
+#include <dcp/xyz_image.h>
#include <Magick++.h>
#include <iostream>
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2015 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 <libcxml/cxml.h>
-#include <dcp/raw_convert.h>
-#include <dcp/mono_picture_frame.h>
-#include <dcp/stereo_picture_frame.h>
#include "j2k_image_proxy.h"
#include "dcpomatic_socket.h"
#include "image.h"
#include "encoded_data.h"
+#include <dcp/raw_convert.h>
+#include <dcp/mono_picture_frame.h>
+#include <dcp/stereo_picture_frame.h>
+#include <dcp/colour_conversion.h>
+#include <dcp/rgb_xyz.h>
+#include <libcxml/cxml.h>
#include "i18n.h"
shared_ptr<Image> image (new Image (PIX_FMT_RGB48LE, _size, true));
if (_mono) {
- _mono->rgb_frame (image, note);
+ dcp::xyz_to_rgb (_mono->xyz_image (), dcp::ColourConversion::xyz_to_srgb(), image->data()[0], image->stride()[0], note);
} else {
- _stereo->rgb_frame (_eye, image);
+ dcp::xyz_to_rgb (_stereo->xyz_image (_eye), dcp::ColourConversion::xyz_to_srgb(), image->data()[0], image->stride()[0], note);
}
return image;