2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>
\r
4 * This file is part of CasparCG.
\r
6 * CasparCG is free software: you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation, either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * CasparCG is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
\r
22 #include <common/utility/tweener.h>
\r
23 #include <core/video_format.h>
\r
26 #include <type_traits>
\r
28 namespace caspar { namespace core {
\r
30 struct pixel_format_desc;
\r
32 class image_transform
\r
92 void set_opacity(double value);
\r
93 double get_opacity() const;
\r
95 void set_gain(double value);
\r
96 double get_gain() const;
\r
98 void set_brightness(double value);
\r
99 double get_brightness() const;
\r
101 void set_contrast(double value);
\r
102 double get_contrast() const;
\r
104 void set_saturation(double value);
\r
105 double get_saturation() const;
\r
107 void set_levels(const levels& value);
\r
108 levels get_levels() const;
\r
110 void set_fill_translation(double x, double y);
\r
111 std::array<double, 2> get_fill_translation() const;
\r
113 void set_fill_scale(double x, double y);
\r
114 std::array<double, 2> get_fill_scale() const;
\r
116 void set_clip_translation(double x, double y);
\r
117 std::array<double, 2> get_clip_translation() const;
\r
119 void set_clip_scale(double x, double y);
\r
120 std::array<double, 2> get_clip_scale() const;
\r
122 image_transform& operator*=(const image_transform &other);
\r
123 const image_transform operator*(const image_transform &other) const;
\r
125 void set_is_key(bool value);
\r
126 bool get_is_key() const;
\r
128 void set_deinterlace(bool value);
\r
129 bool get_deinterlace() const;
\r
131 void set_blend_mode(blend_mode::type value);
\r
132 blend_mode::type get_blend_mode() const;
\r
138 double brightness_;
\r
139 double saturation_;
\r
140 double desaturation_;
\r
142 std::array<double, 2> fill_translation_;
\r
143 std::array<double, 2> fill_scale_;
\r
144 std::array<double, 2> clip_translation_;
\r
145 std::array<double, 2> clip_scale_;
\r
146 video_mode::type mode_;
\r
149 blend_mode::type blend_mode_;
\r
152 image_transform::blend_mode::type get_blend_mode(const std::wstring& str);
\r
154 image_transform tween(double time, const image_transform& source, const image_transform& dest, double duration, const tweener_t& tweener);
\r
156 bool operator<(const image_transform& lhs, const image_transform& rhs);
\r
157 bool operator==(const image_transform& lhs, const image_transform& rhs);
\r
158 bool operator!=(const image_transform& lhs, const image_transform& rhs);
\r