projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.
[dcpomatic.git]
/
src
/
lib
/
format.h
diff --git
a/src/lib/format.h
b/src/lib/format.h
index fd6cdbece31b1ffb51db910fa77493a98228aa38..cc7502893149a800a9ea432bec5ff277c6e54016 100644
(file)
--- a/
src/lib/format.h
+++ b/
src/lib/format.h
@@
-31,27
+31,32
@@
class Film;
class Format
{
public:
class Format
{
public:
- Format (
Size dcp, std::string id, std::string n
)
+ Format (
libdcp::Size dcp, std::string id, std::string n, std::string d, std::string e
)
: _dcp_size (dcp)
, _id (id)
, _nickname (n)
: _dcp_size (dcp)
, _id (id)
, _nickname (n)
+ , _dci_name (d)
+ , _description (e)
{}
/** @return the aspect ratio multiplied by 100
* (e.g. 239 for Cinemascope 2.39:1)
*/
{}
/** @return the aspect ratio multiplied by 100
* (e.g. 239 for Cinemascope 2.39:1)
*/
- virtual int ratio_as_integer (
Film const *
f) const = 0;
+ virtual int ratio_as_integer (
boost::shared_ptr<const Film>
f) const = 0;
/** @return the ratio as a floating point number */
/** @return the ratio as a floating point number */
- virtual float ratio_as_float (
Film const *
f) const = 0;
+ virtual float ratio_as_float (
boost::shared_ptr<const Film>
f) const = 0;
- int dcp_padding (Film const * f) const;
+ /** @return the ratio of the container (including any padding) as a floating point number */
+ float container_ratio_as_float () const;
+
+ int dcp_padding (boost::shared_ptr<const Film>) const;
/** @return size in pixels of the images that we should
* put in a DCP for this ratio. This size will not correspond
* to the ratio when we are doing things like 16:9 in a Flat frame.
*/
/** @return size in pixels of the images that we should
* put in a DCP for this ratio. This size will not correspond
* to the ratio when we are doing things like 16:9 in a Flat frame.
*/
- Size dcp_size () const {
+
libdcp::
Size dcp_size () const {
return _dcp_size;
}
return _dcp_size;
}
@@
-67,6
+72,14
@@
public:
return _nickname;
}
return _nickname;
}
+ std::string dci_name () const {
+ return _dci_name;
+ }
+
+ std::string description () const {
+ return _description;
+ }
+
std::string as_metadata () const;
static Format const * from_nickname (std::string n);
std::string as_metadata () const;
static Format const * from_nickname (std::string n);
@@
-76,15
+89,17
@@
public:
static void setup_formats ();
protected:
static void setup_formats ();
protected:
- /** Size in pixels of the images that we should
+ /**
libdcp::
Size in pixels of the images that we should
* put in a DCP for this ratio. This size will not correspond
* to the ratio when we are doing things like 16:9 in a Flat frame.
*/
* put in a DCP for this ratio. This size will not correspond
* to the ratio when we are doing things like 16:9 in a Flat frame.
*/
- Size _dcp_size;
+
libdcp::
Size _dcp_size;
/** id for use in metadata */
std::string _id;
/** nickname (e.g. Flat, Scope) */
std::string _nickname;
/** id for use in metadata */
std::string _id;
/** nickname (e.g. Flat, Scope) */
std::string _nickname;
+ std::string _dci_name;
+ std::string _description;
private:
/** all available formats */
private:
/** all available formats */
@@
-98,13
+113,13
@@
private:
class FixedFormat : public Format
{
public:
class FixedFormat : public Format
{
public:
- FixedFormat (int,
Size
, std::string, std::string);
+ FixedFormat (int,
libdcp::Size, std::string, std::string
, std::string, std::string);
- int ratio_as_integer (
Film const *
) const {
+ int ratio_as_integer (
boost::shared_ptr<const Film>
) const {
return _ratio;
}
return _ratio;
}
- float ratio_as_float (
Film const *
) const {
+ float ratio_as_float (
boost::shared_ptr<const Film>
) const {
return _ratio / 100.0;
}
return _ratio / 100.0;
}
@@
-119,10
+134,10
@@
private:
class VariableFormat : public Format
{
public:
class VariableFormat : public Format
{
public:
- VariableFormat (
Size
, std::string, std::string);
+ VariableFormat (
libdcp::Size, std::string, std::string
, std::string, std::string);
- int ratio_as_integer (
Film const *
f) const;
- float ratio_as_float (
Film const *
f) const;
+ int ratio_as_integer (
boost::shared_ptr<const Film>
f) const;
+ float ratio_as_float (
boost::shared_ptr<const Film>
f) const;
std::string name () const;
};
std::string name () const;
};