X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fvideo_content.h;h=e88fb022720d0c91e13d875b36ff6589c1eec0ce;hb=12efbd5938f08eb445b43f539fa4f27aa5caccfb;hp=27b36e9bc65ed73358ae36ef2da2adb32c607f77;hpb=cc27c2716f755305d67f1e1ba828ecf37f8405dd;p=dcpomatic.git diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 27b36e9bc..e88fb0227 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -22,6 +22,7 @@ #include "content.h" #include "colour_conversion.h" +#include "video_content_scale.h" class VideoExaminer; class Ratio; @@ -35,46 +36,10 @@ public: static int const VIDEO_CROP; static int const VIDEO_SCALE; static int const COLOUR_CONVERSION; + static int const VIDEO_FADE_IN; + static int const VIDEO_FADE_OUT; }; -class VideoContentScale -{ -public: - VideoContentScale (); - VideoContentScale (Ratio const *); - VideoContentScale (bool); - VideoContentScale (cxml::NodePtr); - - dcp::Size size (boost::shared_ptr, dcp::Size, dcp::Size, int round) const; - std::string id () const; - std::string name () const; - void as_xml (xmlpp::Node *) const; - - Ratio const * ratio () const { - return _ratio; - } - - bool scale () const { - return _scale; - } - - static void setup_scales (); - static std::vector all () { - return _scales; - } - -private: - /** a ratio to stretch the content to, or 0 for no stretch */ - Ratio const * _ratio; - /** true if we want to scale the content */ - bool _scale; - - static std::vector _scales; -}; - -bool operator== (VideoContentScale const & a, VideoContentScale const & b); -bool operator!= (VideoContentScale const & a, VideoContentScale const & b); - class VideoContent : public virtual Content { public: @@ -125,6 +90,9 @@ public: void set_scale (VideoContentScale); void set_colour_conversion (ColourConversion); + + void set_fade_in (ContentTime); + void set_fade_out (ContentTime); VideoFrameType video_frame_type () const { boost::mutex::scoped_lock lm (_mutex); @@ -167,11 +135,23 @@ public: return _colour_conversion; } + ContentTime fade_in () const { + boost::mutex::scoped_lock lm (_mutex); + return _fade_in; + } + + ContentTime fade_out () const { + boost::mutex::scoped_lock lm (_mutex); + return _fade_out; + } + dcp::Size video_size_after_3d_split () const; dcp::Size video_size_after_crop () const; ContentTime dcp_time_to_content_time (DCPTime) const; + boost::optional fade (VideoFrame) const; + void scale_and_crop_to_fit_width (); void scale_and_crop_to_fit_height (); @@ -194,6 +174,8 @@ private: Crop _crop; VideoContentScale _scale; ColourConversion _colour_conversion; + ContentTime _fade_in; + ContentTime _fade_out; }; #endif