]> git.sesse.net Git - casparcg/blobdiff - core/producer/frame/image_transform.h
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / core / producer / frame / image_transform.h
index d473f9597f6e226f5077ad45cfa46141f47a9114..1d1e33c5412623f1952974aa19f763e05d89acc5 100644 (file)
@@ -23,6 +23,7 @@
 #include <core/video_format.h>\r
 \r
 #include <array>\r
+#include <type_traits>\r
 \r
 namespace caspar { namespace core {\r
 \r
@@ -31,6 +32,61 @@ struct pixel_format_desc;
 class image_transform \r
 {\r
 public:\r
+       \r
+       struct blend_mode\r
+       {\r
+               enum type \r
+               {\r
+                       normal = 0,\r
+                       lighten,\r
+                       darken,\r
+                       multiply,\r
+                       average,\r
+                       add,\r
+                       subtract,\r
+                       difference,\r
+                       negation,\r
+                       exclusion,\r
+                       screen,\r
+                       overlay,\r
+                       soft_light,\r
+                       hard_light,\r
+                       color_dodge,\r
+                       color_burn,\r
+                       linear_dodge,\r
+                       linear_burn,\r
+                       linear_light,\r
+                       vivid_light,\r
+                       pin_light,\r
+                       hard_mix,\r
+                       reflect,\r
+                       glow,\r
+                       phoenix,\r
+                       contrast,\r
+                       saturation,\r
+                       color,\r
+                       luminosity,\r
+                       blend_mode_count \r
+               };\r
+       };\r
+       \r
+       struct levels\r
+       {\r
+               levels() \r
+                       : min_input(0.0)\r
+                       , max_input(1.0)\r
+                       , gamma(1.0)\r
+                       , min_output(0.0)\r
+                       , max_output(1.0)\r
+               {               \r
+               }\r
+               double min_input;\r
+               double max_input;\r
+               double gamma;\r
+               double min_output;\r
+               double max_output;\r
+       };\r
+\r
        image_transform();\r
 \r
        void set_opacity(double value);\r
@@ -38,6 +94,18 @@ public:
 \r
        void set_gain(double value);\r
        double get_gain() const;\r
+\r
+       void set_brightness(double value);\r
+       double get_brightness() const;\r
+\r
+       void set_contrast(double value);\r
+       double get_contrast() const;\r
+\r
+       void set_saturation(double value);\r
+       double get_saturation() const;\r
+       \r
+       void set_levels(const levels& value);\r
+       levels get_levels() const;\r
        \r
        void set_fill_translation(double x, double y);\r
        std::array<double, 2> get_fill_translation() const;\r
@@ -45,37 +113,44 @@ public:
        void set_fill_scale(double x, double y);\r
        std::array<double, 2> get_fill_scale() const;\r
        \r
-       void set_key_translation(double x, double y);\r
-       std::array<double, 2> get_key_translation() const;\r
-\r
-       void set_key_scale(double x, double y);\r
-       std::array<double, 2> get_key_scale() const;\r
-\r
-       void set_mode(video_mode::type mode);\r
-       video_mode::type get_mode() const;\r
+       void set_clip_translation(double x, double y);\r
+       std::array<double, 2> get_clip_translation() const;\r
 \r
+       void set_clip_scale(double x, double y);\r
+       std::array<double, 2> get_clip_scale() const;\r
+       \r
        image_transform& operator*=(const image_transform &other);\r
        const image_transform operator*(const image_transform &other) const;\r
+\r
+       void set_is_key(bool value);\r
+       bool get_is_key() const;\r
+\r
+       void set_blend_mode(blend_mode::type value);\r
+       blend_mode::type get_blend_mode() const;\r
+       \r
 private:\r
        double opacity_;\r
        double gain_;\r
+       double contrast_;\r
+       double brightness_;\r
+       double saturation_;\r
+       double desaturation_;\r
+       levels levels_;\r
        std::array<double, 2> fill_translation_; \r
        std::array<double, 2> fill_scale_; \r
-       std::array<double, 2> key_translation_; \r
-       std::array<double, 2> key_scale_; \r
+       std::array<double, 2> clip_translation_; \r
+       std::array<double, 2> clip_scale_; \r
        video_mode::type mode_;\r
+       bool is_key_;\r
+       blend_mode::type blend_mode_;\r
 };\r
 \r
-image_transform tween(double time, const image_transform& source, const image_transform& dest, double duration, const tweener_t& tweener);\r
+image_transform::blend_mode::type get_blend_mode(const std::wstring& str);\r
 \r
-inline bool operator==(const image_transform& lhs, const image_transform& rhs)\r
-{\r
-       return memcmp(&lhs, &rhs, sizeof(image_transform)) == 0;\r
-}\r
+image_transform tween(double time, const image_transform& source, const image_transform& dest, double duration, const tweener_t& tweener);\r
 \r
-inline bool operator!=(const image_transform& lhs, const image_transform& rhs)\r
-{\r
-       return !(lhs == rhs);\r
-}\r
+bool operator<(const image_transform& lhs, const image_transform& rhs);\r
+bool operator==(const image_transform& lhs, const image_transform& rhs);\r
+bool operator!=(const image_transform& lhs, const image_transform& rhs);\r
 \r
 }}
\ No newline at end of file