-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add dynamic overlay update * Add overlay description struct and use it in unified way for both the initial overlay and dynamic overlay changes --------- Co-authored-by: Łukasz Kita <lukasz.kita0@gmail.com>
- Loading branch information
1 parent
f5843d3
commit 878d43e
Showing
8 changed files
with
125 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
defmodule Membrane.OverlayFilter.OverlayDescription do | ||
@moduledoc """ | ||
Specifies the overlay, its position on the underlay image | ||
and the blend mode. | ||
""" | ||
|
||
@enforce_keys [:overlay] | ||
defstruct @enforce_keys ++ [x: :center, y: :middle, blend_mode: :over] | ||
|
||
@typedoc """ | ||
Specifies the overlay, its position on the underlay image | ||
and the blend mode. | ||
The following fields can be specified: | ||
* `overlay` - Path to the overlay image or a `Vix` image. | ||
You can get a `Vix` image for example by calling `Image.open/2`, | ||
`Image.Text.text/2` or `Vix.Vips.Image.new_from_buffer/2`. | ||
* `x` - Distance of the overlay image from the left (or right if negative) | ||
border of the frame. Can be also set to center, left or right. | ||
Defaults to `:center`. | ||
* `y` - Distance of the overlay image from the top (or bottom if negative) | ||
border of the frame. Can be also set to middle, top or bottom. | ||
Defaults to `:middle`. | ||
* `blend_mode` - The manner in which the overlay is composed on the frame. | ||
Defaults to `:over`. | ||
""" | ||
@type t :: %__MODULE__{ | ||
overlay: Path.t() | Vix.Vips.Image.t(), | ||
x: integer() | :center | :left | :right, | ||
y: integer() | :middle | :top | :bottom, | ||
blend_mode: Image.BlendMode.t() | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.