diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-06-28 16:17:39 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-06-29 11:26:56 +0100 |
| commit | 29377b18a8cef724c8e2de2316a66ceae89a2e9a (patch) | |
| tree | 10bf8a39b26282274382e1d74aefa1603f10711e /src/lib/ratio.h | |
| parent | cb845fc94ce2015138ddecb6c5a94e722361642a (diff) | |
Offer only flat/scope/full-frame as container choices and differentiate
the names from the UI for content ratios.
Diffstat (limited to 'src/lib/ratio.h')
| -rw-r--r-- | src/lib/ratio.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/ratio.h b/src/lib/ratio.h index 9e9d58a40..42f29458a 100644 --- a/src/lib/ratio.h +++ b/src/lib/ratio.h @@ -28,10 +28,11 @@ class Ratio : public boost::noncopyable { public: - Ratio (float ratio, std::string id, std::string n, std::string d) + Ratio (float ratio, std::string id, std::string in, boost::optional<std::string> cn, std::string d) : _ratio (ratio) , _id (id) - , _nickname (n) + , _image_nickname (in) + , _container_nickname (cn) , _isdcf_name (d) {} @@ -39,10 +40,12 @@ public: return _id; } - std::string nickname () const { - return _nickname; + std::string image_nickname () const { + return _image_nickname; } + std::string container_nickname () const; + std::string isdcf_name () const { return _isdcf_name; } @@ -55,16 +58,21 @@ public: static Ratio const * from_id (std::string i); static Ratio const * from_ratio (float r); static Ratio const * nearest_from_ratio (float r); + static std::vector<Ratio const *> all () { return _ratios; } + static std::vector<Ratio const *> containers (); + private: float _ratio; /** id for use in metadata */ std::string _id; - /** nickname (e.g. Flat, Scope) */ - std::string _nickname; + /** nickname when used to describe an image ratio (e.g. Flat, Scope) */ + std::string _image_nickname; + /** nickname when used to describe a container ratio */ + boost::optional<std::string> _container_nickname; std::string _isdcf_name; static std::vector<Ratio const *> _ratios; |
