X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fproducer%2Fframe%2Fimage_transform.h;h=c85aef121b71c36b8a86be563dd0e16bdb2c340d;hb=c23d77ad73a54d13a3c80a4c77496e509b96941c;hp=e0e6a2a6060175c6916f912fa5b42b91a73c535e;hpb=37573b2ec60da488befcfddbfbb06b589e5c2d20;p=casparcg diff --git a/core/producer/frame/image_transform.h b/core/producer/frame/image_transform.h index e0e6a2a60..c85aef121 100644 --- a/core/producer/frame/image_transform.h +++ b/core/producer/frame/image_transform.h @@ -32,6 +32,70 @@ struct pixel_format_desc; class image_transform { public: + + struct blend_mode + { + enum type + { + normal = 0, + lighten, + darken, + multiply, + average, + add, + subtract, + difference, + negation, + exclusion, + screen, + overlay, + soft_light, + hard_light, + color_dodge, + color_burn, + linear_dodge, + linear_burn, + linear_light, + vivid_light, + pin_light, + hard_mix, + reflect, + glow, + phoenix, + contrast, + saturation, + color, + luminosity, + invert, + blend_mode_count + }; + }; + + struct alpha_mode + { + enum type + { + normal = 0, + }; + }; + + struct levels + { + levels() + : min_input(0.0) + , max_input(1.0) + , gamma(1.0) + , min_output(0.0) + , max_output(1.0) + { + } + double min_input; + double max_input; + double gamma; + double min_output; + double max_output; + }; + image_transform(); void set_opacity(double value); @@ -39,6 +103,18 @@ public: void set_gain(double value); double get_gain() const; + + void set_brightness(double value); + double get_brightness() const; + + void set_contrast(double value); + double get_contrast() const; + + void set_saturation(double value); + double get_saturation() const; + + void set_levels(const levels& value); + levels get_levels() const; void set_fill_translation(double x, double y); std::array get_fill_translation() const; @@ -46,11 +122,11 @@ public: void set_fill_scale(double x, double y); std::array get_fill_scale() const; - void set_key_translation(double x, double y); - std::array get_key_translation() const; + void set_clip_translation(double x, double y); + std::array get_clip_translation() const; - void set_key_scale(double x, double y); - std::array get_key_scale() const; + void set_clip_scale(double x, double y); + std::array get_clip_scale() const; void set_mode(video_mode::type mode); video_mode::type get_mode() const; @@ -58,19 +134,40 @@ public: image_transform& operator*=(const image_transform &other); const image_transform operator*(const image_transform &other) const; - void set_key_depth(size_t depth); - size_t get_key_depth() const; + void set_is_key(bool value); + bool get_is_key() const; + + void set_deinterlace(bool value); + bool get_deinterlace() const; + + void set_blend_mode(blend_mode::type value); + blend_mode::type get_blend_mode() const; + + void set_alpha_mode(alpha_mode::type value); + alpha_mode::type get_alpha_mode() const; + private: double opacity_; double gain_; + double contrast_; + double brightness_; + double saturation_; + double desaturation_; + levels levels_; std::array fill_translation_; std::array fill_scale_; - std::array key_translation_; - std::array key_scale_; + std::array clip_translation_; + std::array clip_scale_; video_mode::type mode_; - size_t key_depth_; + bool is_key_; + bool deinterlace_; + blend_mode::type blend_mode_; + alpha_mode::type alpha_mode_; }; +image_transform::blend_mode::type get_blend_mode(const std::wstring& str); +image_transform::alpha_mode::type get_alpha_mode(const std::wstring& str); + image_transform tween(double time, const image_transform& source, const image_transform& dest, double duration, const tweener_t& tweener); inline bool operator==(const image_transform& lhs, const image_transform& rhs)