#include "rect.h"
#include <boost/shared_ptr.hpp>
-class Image;
+namespace dcpomatic {
+ class Image;
+}
class BitmapText
{
public:
- BitmapText (boost::shared_ptr<Image> i, dcpomatic::Rect<double> r)
+ BitmapText (boost::shared_ptr<dcpomatic::Image> i, dcpomatic::Rect<double> r)
: image (i)
, rectangle (r)
{}
- boost::shared_ptr<Image> image;
+ boost::shared_ptr<dcpomatic::Image> image;
/** Area that the subtitle covers on its corresponding video, expressed in
* proportions of the image size; e.g. rectangle.x = 0.5 would mean that
* the rectangle starts half-way across the video.
#include <dcp/subtitle_string.h>
#include <list>
-class Image;
+namespace dcpomatic {
+ class Image;
+}
class ContentText
{
class ContentBitmapText : public ContentText
{
public:
- ContentBitmapText (dcpomatic::ContentTime f, boost::shared_ptr<Image> im, dcpomatic::Rect<double> r)
+ ContentBitmapText (dcpomatic::ContentTime f, boost::shared_ptr<dcpomatic::Image> im, dcpomatic::Rect<double> r)
: ContentText (f)
, sub (im, r)
{}
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
+using namespace dcpomatic;
+
#define DCI_COEFFICENT (48.0 / 52.37)
#include <boost/thread/mutex.hpp>
#include <stdint.h>
+namespace dcpomatic {
+ class Image;
+}
+
+class AudioBuffers;
+class FFmpegAudioStream;
class Log;
class VideoFilterGraph;
-class FFmpegAudioStream;
-class AudioBuffers;
-class Image;
struct ffmpeg_pts_offset_test;
/** @class FFmpegDecoder
/** true if we have a subtitle which has not had emit_stop called for it yet */
bool _have_current_subtitle;
- boost::shared_ptr<Image> _black_image;
+ boost::shared_ptr<dcpomatic::Image> _black_image;
std::vector<boost::optional<dcpomatic::ContentTime> > _next_time;
};
boost::shared_ptr<AudioBuffers> _pending_audio;
- /** Store of shared_ptr<Image> to keep them alive whilst raw pointers into
+ /** Store of shared_ptr<dcpomatic::Image> to keep them alive whilst raw pointers into
their data have been passed to FFmpeg.
*/
- std::map<uint8_t*, boost::shared_ptr<const Image> > _pending_images;
+ std::map<uint8_t*, boost::shared_ptr<const dcpomatic::Image> > _pending_images;
boost::mutex _pending_images_mutex;
static int _video_stream_index;
using boost::optional;
using boost::dynamic_pointer_cast;
using dcp::raw_convert;
+using namespace dcpomatic;
+
FFmpegImageProxy::FFmpegImageProxy (boost::filesystem::path path)
: _data (path)
failed-decode errors can give more detail.
*/
boost::optional<boost::filesystem::path> _path;
- mutable boost::shared_ptr<Image> _image;
+ mutable boost::shared_ptr<dcpomatic::Image> _image;
mutable boost::mutex _mutex;
};
struct AVFilterContext;
struct AVFrame;
-class Image;
class Filter;
/** @class FilterGraph
using std::runtime_error;
using boost::shared_ptr;
using dcp::Size;
+using namespace dcpomatic;
int
Image::vertical_factor (int n) const
double const b = lut_in[op[blue]];
/* RGB to XYZ, including Bradford transform and DCI companding */
- double const x = max (0.0, min (65535.0, r * fast_matrix[0] + g * fast_matrix[1] + b * fast_matrix[2]));
- double const y = max (0.0, min (65535.0, r * fast_matrix[3] + g * fast_matrix[4] + b * fast_matrix[5]));
- double const z = max (0.0, min (65535.0, r * fast_matrix[6] + g * fast_matrix[7] + b * fast_matrix[8]));
+ double const x = std::max(0.0, std::min(65535.0, r * fast_matrix[0] + g * fast_matrix[1] + b * fast_matrix[2]));
+ double const y = std::max(0.0, std::min(65535.0, r * fast_matrix[3] + g * fast_matrix[4] + b * fast_matrix[5]));
+ double const z = std::max(0.0, std::min(65535.0, r * fast_matrix[6] + g * fast_matrix[7] + b * fast_matrix[8]));
/* Out gamma LUT and blend */
tp[0] = lrint(lut_out[lrint(x)] * 65535) * alpha + tp[0] * (1 - alpha);
DCPOMATIC_ASSERT (_pixel_format == AV_PIX_FMT_RGB24 && other->pixel_format() == AV_PIX_FMT_RGB24);
DCPOMATIC_ASSERT (position.x >= 0 && position.y >= 0);
- int const N = min (position.x + other->size().width, size().width) - position.x;
+ int const N = std::min (position.x + other->size().width, size().width) - position.x;
for (int ty = position.y, oy = 0; ty < size().height && oy < other->size().height; ++ty, ++oy) {
uint8_t * const tp = data()[0] + ty * stride()[0] + position.x * 3;
uint8_t * const op = other->data()[0] + oy * other->stride()[0];
}
PositionImage
-merge (list<PositionImage> images)
+dcpomatic::merge (list<PositionImage> images)
{
if (images.empty ()) {
return PositionImage ();
}
bool
-operator== (Image const & a, Image const & b)
+dcpomatic::operator== (Image const & a, Image const & b)
{
if (a.planes() != b.planes() || a.pixel_format() != b.pixel_format() || a.aligned() != b.aligned()) {
return false;
struct AVFrame;
class Socket;
+namespace dcpomatic {
+
class Image : public boost::enable_shared_from_this<Image>
{
public:
extern PositionImage merge (std::list<PositionImage> images);
extern bool operator== (Image const & a, Image const & b);
+}
+
#endif
#include <boost/optional.hpp>
#include <boost/utility.hpp>
-class Image;
+namespace dcpomatic {
+ class Image;
+}
+
class Socket;
namespace xmlpp {
virtual ~ImageProxy () {}
struct Result {
- Result (boost::shared_ptr<Image> image_, int log2_scaling_)
+ Result (boost::shared_ptr<dcpomatic::Image> image_, int log2_scaling_)
: image (image_)
, log2_scaling (log2_scaling_)
, error (false)
{}
- Result (boost::shared_ptr<Image> image_, int log2_scaling_, bool error_)
+ Result (boost::shared_ptr<dcpomatic::Image> image_, int log2_scaling_, bool error_)
: image (image_)
, log2_scaling (log2_scaling_)
, error (error_)
{}
/** Image (which will be aligned) */
- boost::shared_ptr<Image> image;
+ boost::shared_ptr<dcpomatic::Image> image;
/** log2 of any scaling down that has already been applied to the image;
* e.g. if the image is already half the size of the original, this value
* will be 1.
using boost::dynamic_pointer_cast;
using dcp::Data;
using dcp::raw_convert;
+using namespace dcpomatic;
+
/** Construct a J2KImageProxy from a JPEG2000 file */
J2KImageProxy::J2KImageProxy (boost::filesystem::path path, dcp::Size size, AVPixelFormat pixel_format)
dcp::Data _data;
dcp::Size _size;
boost::optional<dcp::Eye> _eye;
- mutable boost::shared_ptr<Image> _image;
+ mutable boost::shared_ptr<dcpomatic::Image> _image;
mutable boost::optional<dcp::Size> _target_size;
mutable boost::optional<int> _reduce;
AVPixelFormat _pixel_format;
* the size of preview in a window.
*/
dcp::Size _video_container_size;
- boost::shared_ptr<Image> _black_image;
+ boost::shared_ptr<dcpomatic::Image> _black_image;
/** true if the player should ignore all video; i.e. never produce any */
bool _ignore_video;
using boost::function;
using dcp::Data;
using dcp::raw_convert;
+using namespace dcpomatic;
PlayerVideo::PlayerVideo (
shared_ptr<const ImageProxy> in,
#include <boost/thread/mutex.hpp>
#include <boost/noncopyable.hpp>
-class Image;
+namespace dcpomatic {
+ class Image;
+}
+
class ImageProxy;
class Film;
class Socket;
void set_text (PositionImage);
void prepare (boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast);
- boost::shared_ptr<Image> image (boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const;
+ boost::shared_ptr<dcpomatic::Image> image (boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const;
static AVPixelFormat force (AVPixelFormat, AVPixelFormat);
static AVPixelFormat keep_xyz_or_rgb (AVPixelFormat);
boost::optional<Frame> _video_frame;
mutable boost::mutex _mutex;
- mutable boost::shared_ptr<Image> _image;
+ mutable boost::shared_ptr<dcpomatic::Image> _image;
/** _crop that was used to make _image */
mutable Crop _image_crop;
/** _inter_size that was used to make _image */
#include "position.h"
#include <boost/shared_ptr.hpp>
-class Image;
+namespace dcpomatic {
+ class Image;
+}
class PositionImage
{
public:
PositionImage () {}
- PositionImage (boost::shared_ptr<Image> i, Position<int> p)
+ PositionImage (boost::shared_ptr<dcpomatic::Image> i, Position<int> p)
: image (i)
, position (p)
{}
- boost::shared_ptr<Image> image;
+ boost::shared_ptr<dcpomatic::Image> image;
Position<int> position;
bool same (PositionImage const & other) const;
using boost::dynamic_pointer_cast;
using boost::optional;
using dcp::raw_convert;
+using namespace dcpomatic;
RawImageProxy::RawImageProxy (shared_ptr<Image> image)
: _image (image)
class RawImageProxy : public ImageProxy
{
public:
- explicit RawImageProxy (boost::shared_ptr<Image>);
+ explicit RawImageProxy (boost::shared_ptr<dcpomatic::Image>);
RawImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
Result image (
size_t memory_used () const;
private:
- boost::shared_ptr<Image> _image;
+ boost::shared_ptr<dcpomatic::Image> _image;
};
#endif
class Subtitle;
}
-class Image;
+namespace dcpomatic {
+ class Image;
+}
class TextDecoder : public DecoderPart
{
return _position;
}
- void emit_bitmap_start (dcpomatic::ContentTime from, boost::shared_ptr<Image> image, dcpomatic::Rect<double> rect);
- void emit_bitmap (dcpomatic::ContentTimePeriod period, boost::shared_ptr<Image> image, dcpomatic::Rect<double> rect);
+ void emit_bitmap_start (dcpomatic::ContentTime from, boost::shared_ptr<dcpomatic::Image> image, dcpomatic::Rect<double> rect);
+ void emit_bitmap (dcpomatic::ContentTimePeriod period, boost::shared_ptr<dcpomatic::Image> image, dcpomatic::Rect<double> rect);
void emit_plain_start (dcpomatic::ContentTime from, std::list<dcp::SubtitleString> s);
void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle);
void emit_plain (dcpomatic::ContentTimePeriod period, std::list<dcp::SubtitleString> s);
#include <boost/signals2.hpp>
#include <boost/shared_ptr.hpp>
-class VideoContent;
+class FrameIntervalChecker;
class ImageProxy;
-class Image;
class Log;
-class FrameIntervalChecker;
+class VideoContent;
/** @class VideoDecoder
* @brief Parent for classes which decode video.
using std::string;
using std::make_pair;
using boost::shared_ptr;
+using namespace dcpomatic;
+
VideoFilterGraph::VideoFilterGraph (dcp::Size s, AVPixelFormat p, dcp::Fraction r)
: _size (s)
VideoFilterGraph (dcp::Size s, AVPixelFormat p, dcp::Fraction r);
bool can_process (dcp::Size s, AVPixelFormat p) const;
- std::list<std::pair<boost::shared_ptr<Image>, int64_t> > process (AVFrame * frame);
+ std::list<std::pair<boost::shared_ptr<dcpomatic::Image>, int64_t> > process (AVFrame * frame);
protected:
std::string src_parameters () const;
#include <wx/wx.h>
DCPOMATIC_ENABLE_WARNINGS
-class wxToggleButton;
-class FFmpegPlayer;
-class Image;
-class RGBPlusAlphaImage;
-class PlayerVideo;
-class Player;
class Butler;
class ClosedCaptionsDialog;
+class FFmpegPlayer;
+class Player;
+class PlayerVideo;
+class RGBPlusAlphaImage;
+class wxToggleButton;
/** @class FilmViewer
* @brief A wx widget to view a Film.
using std::cout;
using boost::shared_ptr;
using boost::optional;
+using namespace dcpomatic;
static void
}
private:
- void set_image (boost::shared_ptr<const Image> image);
+ void set_image (boost::shared_ptr<const dcpomatic::Image> image);
void set_image_and_draw ();
void draw (Position<int> inter_position, dcp::Size inter_size);
void thread ();
bool display_next_frame (bool non_blocking);
private:
- void set_image (boost::shared_ptr<const Image> image) {
+ void set_image (boost::shared_ptr<const dcpomatic::Image> image) {
_image = image;
}
void timer ();
wxPanel* _panel;
- boost::shared_ptr<const Image> _image;
+ boost::shared_ptr<const dcpomatic::Image> _image;
wxTimer _timer;
Position<int> _inter_position;
dcp::Size _inter_size;
#include <boost/thread.hpp>
#include <boost/noncopyable.hpp>
-class Image;
-class wxWindow;
class FilmViewer;
class PlayerVideo;
+class wxWindow;
+
+namespace dcpomatic {
+ class Image;
+}
class VideoView : public ExceptionStore, public boost::noncopyable
{
using boost::weak_ptr;
using boost::shared_ptr;
using dcp::locale_convert;
+using namespace dcpomatic;
+
int const VideoWaveformPlot::_vertical_margin = 8;
int const VideoWaveformPlot::_pixel_values = 4096;
class OpenJPEGImage;
}
-class PlayerVideo;
-class Image;
+namespace dcpomatic {
+ class Image;
+}
+
class Film;
class FilmViewer;
+class PlayerVideo;
class VideoWaveformPlot : public wxPanel
{
boost::weak_ptr<const Film> _film;
boost::shared_ptr<dcp::OpenJPEGImage> _image;
- boost::shared_ptr<const Image> _waveform;
+ boost::shared_ptr<const dcpomatic::Image> _waveform;
bool _dirty;
bool _enabled;
int _component;
using boost::optional;
using boost::weak_ptr;
using dcp::Data;
+using namespace dcpomatic;
+
void
do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription description, Data locally_encoded)
using std::list;
using std::cout;
using boost::shared_ptr;
+using namespace dcpomatic;
+
BOOST_AUTO_TEST_CASE (aligned_image_test)
{
#include "lib/image.h"
using std::list;
+using namespace dcpomatic;
+
BOOST_AUTO_TEST_CASE (make_black_test)
{
using std::list;
using std::cout;
+using namespace dcpomatic;
/** @struct Case
* @brief A test case for pixel_formats_test.
}
void
-write_image (shared_ptr<const Image> image, boost::filesystem::path file, string format, MagickCore::StorageType pixel_type)
+write_image (shared_ptr<const dcpomatic::Image> image, boost::filesystem::path file, string format, MagickCore::StorageType pixel_type)
{
using namespace MagickCore;
#include <boost/shared_ptr.hpp>
class Film;
-class Image;
class Log;
+namespace dcpomatic {
+ class Image;
+}
class TestPaths
{
extern void check_ffmpeg (boost::filesystem::path, boost::filesystem::path, int audio_tolerance);
extern void check_image (boost::filesystem::path, boost::filesystem::path, double threshold = 0.01);
extern boost::filesystem::path test_film_dir (std::string);
-extern void write_image (boost::shared_ptr<const Image> image, boost::filesystem::path file, std::string format, MagickCore::StorageType pixel_type = MagickCore::CharPixel);
+extern void write_image (boost::shared_ptr<const dcpomatic::Image> image, boost::filesystem::path file, std::string format, MagickCore::StorageType pixel_type = MagickCore::CharPixel);
boost::filesystem::path dcp_file (boost::shared_ptr<const Film> film, std::string prefix);
void check_one_frame (boost::filesystem::path dcp, int64_t index, boost::filesystem::path ref);
extern boost::filesystem::path subtitle_file (boost::shared_ptr<Film> film);