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>
79 float ratio ()
const {
80 return float (width) / height;
88 extern bool operator== (
Size const & a,
Size const & b);
89 extern bool operator!= (
Size const & a,
Size const & b);
114 std::vector<dcp::Channel> used_audio_channels ();
117 enum class MCASoundField
125 extern std::string channel_to_mca_id (
Channel c, MCASoundField field);
126 extern Channel mca_id_to_channel (std::string);
127 extern std::string channel_to_mca_name (
Channel c, MCASoundField field);
128 extern ASDCP::UL channel_to_mca_universal_label (
Channel c, MCASoundField field, ASDCP::Dictionary
const* dict);
139 extern std::string effect_to_string (Effect e);
140 extern Effect string_to_effect (std::string s);
153 extern std::string direction_to_string (
Direction a);
154 extern Direction string_to_direction (std::string s);
178 Fraction (
int n,
int d) : numerator (n), denominator (d) {}
180 float as_float ()
const {
181 return float (numerator) / denominator;
184 std::string as_string ()
const;
191 extern bool operator== (Fraction
const & a, Fraction
const & b);
192 extern bool operator!= (Fraction
const & a, Fraction
const & b);
195 enum class NoteType {
202 enum class Standard {
208 enum class Formulation {
209 MODIFIED_TRANSITIONAL_1,
210 MULTIPLE_MODIFIED_TRANSITIONAL_1,
216 std::string formulation_to_string (dcp::Formulation formulation);
217 dcp::Formulation string_to_formulation (std::string forumulation);
232 Colour (
int r_,
int g_,
int b_);
238 explicit Colour (std::string argb_hex);
256 extern bool operator== (
Colour const & a,
Colour const & b);
257 extern bool operator!= (
Colour const & a,
Colour const & b);
260 typedef boost::function<void (NoteType, std::string)> NoteHandler;
281 constexpr
float SIZE_EPSILON = 1e-3;
282 constexpr
float OFFSET_EPSILON = 1e-3;
283 constexpr
float SPACING_EPSILON = 1e-3;
302 std::string marker_to_string (
Marker);
303 Marker marker_from_string (std::string);
314 extern std::string status_to_string (
Status s);
315 extern Status string_to_status (std::string s);
329 , label_text (label_text_)
332 void as_xml (xmlpp::Element* parent)
const;
335 std::string label_text;
343 CANDELA_PER_SQUARE_METRE,
351 void set_value (
float v);
352 void set_unit (Unit u) {
356 float value ()
const {
364 float value_in_foot_lamberts ()
const;
366 void as_xml (xmlpp::Element* parent, std::string ns)
const;
368 static std::string unit_to_string (Unit u);
369 static Unit string_to_unit (std::string u);
386 MCASoundField field ()
const {
390 int channels ()
const {
391 return _channels.size();
394 boost::optional<Channel> mapping (
int index)
const;
395 void set_mapping (
int index,
Channel channel);
397 std::string to_string ()
const;
400 MCASoundField _field;
401 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.
@ FFOB
first frame of ratings band
@ 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
@ LFOB
last frame of ratings band
@ LFEC
last frame of end credits
@ LFTC
last frame of title credits
constexpr float SPACE_BEFORE_EPSILON
@ LFE
low-frequency effects (sub)
@ LC
not used, but referred to in MainSoundConfiguration in some CPLs
@ RC
not used, but referred to in MainSoundConfiguration in some CPLs
constexpr float ASPECT_ADJUST_EPSILON
constexpr float ALIGN_EPSILON
@ TEMP
temporary version (picture/sound unfinished)
@ PRE
pre-release (picture/sound finished)
The integer, two-dimensional size of something.