C++11 tidying.
[dcpomatic.git] / src / lib / filter.h
1 /*
2     Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21
22 /** @file src/filter.h
23  *  @brief A class to describe one of FFmpeg's video or audio filters.
24  */
25
26
27 #ifndef DCPOMATIC_FILTER_H
28 #define DCPOMATIC_FILTER_H
29
30
31 #include <string>
32 #include <vector>
33
34
35 /** @class Filter
36  *  @brief A class to describe one of FFmpeg's video or audio filters.
37  *
38  *  We don't support FFmpeg's post-processing filters here as they cannot cope with greater than
39  *  8bpp.  FFmpeg quantizes e.g. yuv422p10le down to yuv422p before running such filters, which
40  *  we don't really want to do.
41  */
42 class Filter
43 {
44 public:
45         Filter (std::string i, std::string n, std::string c, std::string f);
46
47         Filter (Filter const&) = delete;
48         Filter& operator= (Filter const&) = delete;
49
50         /** @return our id */
51         std::string id () const {
52                 return _id;
53         }
54
55         /** @return user-visible name */
56         std::string name () const {
57                 return _name;
58         }
59
60         /** @return string for a FFmpeg filter descriptor */
61         std::string ffmpeg () const {
62                 return _ffmpeg;
63         }
64
65         std::string category () const {
66                 return _category;
67         }
68
69         static std::vector<Filter const *> all ();
70         static Filter const * from_id (std::string d);
71         static void setup_filters ();
72         static std::string ffmpeg_string (std::vector<Filter const *> const & filters);
73
74 private:
75
76         /** our id */
77         std::string _id;
78         /** user-visible name */
79         std::string _name;
80         std::string _category;
81         /** string for a FFmpeg filter descriptor */
82         std::string _ffmpeg;
83
84         /** all available filters */
85         static std::vector<Filter const *> _filters;
86         static void maybe_add (std::string, std::string, std::string, std::string);
87 };
88
89
90 #endif