40 #ifndef LIBDCP_TYPES_H
41 #define LIBDCP_TYPES_H
45 #include <libcxml/cxml.h>
46 LIBDCP_DISABLE_WARNINGS
47 #include <asdcp/KLV.h>
48 LIBDCP_ENABLE_WARNINGS
50 #include <boost/function.hpp>
82 float ratio ()
const {
83 return float (width) / height;
91 extern bool operator== (
Size const & a,
Size const & b);
92 extern bool operator!= (
Size const & a,
Size const & b);
116 std::vector<dcp::Channel> used_audio_channels ();
119 enum class MCASoundField
126 extern std::string channel_to_mca_id (
Channel c, MCASoundField field);
127 extern Channel mca_id_to_channel (std::string);
128 extern std::string channel_to_mca_name (
Channel c, MCASoundField field);
129 extern ASDCP::UL channel_to_mca_universal_label (
Channel c, MCASoundField field, ASDCP::Dictionary
const* dict);
132 enum class ContentKind
142 PUBLIC_SERVICE_ANNOUNCEMENT,
161 extern std::string effect_to_string (Effect e);
162 extern Effect string_to_effect (std::string s);
173 extern std::string halign_to_string (
HAlign a);
174 extern HAlign string_to_halign (std::string s);
185 extern std::string valign_to_string (
VAlign a);
186 extern VAlign string_to_valign (std::string s);
199 extern std::string direction_to_string (
Direction a);
200 extern Direction string_to_direction (std::string s);
223 Fraction (
int n,
int d) : numerator (n), denominator (d) {}
225 float as_float ()
const {
226 return float (numerator) / denominator;
229 std::string as_string ()
const;
236 extern bool operator== (Fraction
const & a, Fraction
const & b);
237 extern bool operator!= (Fraction
const & a, Fraction
const & b);
267 bool load_font_nodes_can_differ =
false;
268 bool keep_going =
false;
274 enum class NoteType {
281 enum class Standard {
288 MODIFIED_TRANSITIONAL_1,
289 MULTIPLE_MODIFIED_TRANSITIONAL_1,
309 Colour (
int r_,
int g_,
int b_);
315 explicit Colour (std::string argb_hex);
333 extern bool operator== (
Colour const & a,
Colour const & b);
334 extern bool operator!= (
Colour const & a,
Colour const & b);
337 typedef boost::function<void (NoteType, std::string)> NoteHandler;
372 std::string marker_to_string (
Marker);
373 Marker marker_from_string (std::string);
384 extern std::string status_to_string (
Status s);
385 extern Status string_to_status (std::string s);
399 , label_text (label_text_)
402 void as_xml (xmlpp::Element* parent)
const;
405 std::string label_text;
413 CANDELA_PER_SQUARE_METRE,
421 void set_value (
float v);
422 void set_unit (Unit u) {
426 float value ()
const {
434 float value_in_foot_lamberts ()
const;
436 void as_xml (xmlpp::Element* parent, std::string ns)
const;
438 static std::string unit_to_string (Unit u);
439 static Unit string_to_unit (std::string u);
456 MCASoundField field ()
const {
460 int channels ()
const {
461 return _channels.size();
464 boost::optional<Channel> mapping (
int index)
const;
465 void set_mapping (
int index,
Channel channel);
467 std::string to_string ()
const;
470 MCASoundField _field;
471 std::vector<boost::optional<Channel>> _channels;
int g
green component, from 0 to 255
int b
blue component, from 0 to 255
int r
red component, from 0 to 255
std::string to_argb_string() const
std::string to_rgb_string() const
A fraction (i.e. a thing with an integer numerator and an integer denominator).
Namespace for everything in libdcp.
@ FFOI
first frame of intermission
@ FFEC
first frame of end credits
@ LFMC
last frame of moving credits
@ LFOI
last frame of intermission
@ FFMC
first frame of moving credits
@ FFTC
first frame of title credits
@ LFOC
last frame of composition
@ FFOC
first frame of composition
@ LFEC
last frame of end credits
@ LFTC
last frame of title credits
@ RIGHT
horizontal position is distance from right of screen to right of subtitle
@ LEFT
horizontal position is distance from left of screen to left of subtitle
@ CENTER
horizontal position is distance from centre of screen to centre of subtitle
std::string content_kind_to_string(ContentKind kind)
constexpr float SPACE_BEFORE_EPSILON
@ BOTTOM
vertical position is distance from bottom of screen to bottom of subtitle
@ TOP
vertical position is distance from top of screen to top of subtitle
@ CENTER
vertical position is distance from centre of screen to centre of subtitle
ContentKind content_kind_from_string(std::string kind)
@ LFE
low-frequency effects (sub)
constexpr float ASPECT_ADJUST_EPSILON
@ MODIFIED_TRANSITIONAL_TEST
constexpr float ALIGN_EPSILON
@ TEMP
temporary version (picture/sound unfinished)
@ PRE
pre-release (picture/sound finished)
A class to describe what "equality" means for a particular test.
bool reel_hashes_can_differ
double max_mean_pixel_error
double max_std_dev_pixel_error
int max_audio_sample_error
bool cpl_annotation_texts_can_differ
bool reel_annotation_texts_can_differ
bool issue_dates_can_differ
bool export_differing_subtitles
The integer, two-dimensional size of something.