Class: Bagel::Video::FFMPEG::OverlayFilter
- Inherits:
-
Object
- Object
- Bagel::Video::FFMPEG::OverlayFilter
- Defined in:
- lib/bagel/video/ffmpeg/overlay_filter.rb
Instance Attribute Summary collapse
-
#fade ⇒ Object
readonly
Returns the value of attribute fade.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#is_last ⇒ Object
readonly
Returns the value of attribute is_last.
-
#orientation ⇒ Object
readonly
Returns the value of attribute orientation.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
Instance Method Summary collapse
-
#initialize(fade:, padding:, orientation:, index:, is_last:) ⇒ OverlayFilter
constructor
A new instance of OverlayFilter.
- #to_s ⇒ Object
Constructor Details
#initialize(fade:, padding:, orientation:, index:, is_last:) ⇒ OverlayFilter
Returns a new instance of OverlayFilter.
5 6 7 8 9 10 11 |
# File 'lib/bagel/video/ffmpeg/overlay_filter.rb', line 5 def initialize(fade:, padding:, orientation:, index:, is_last:) @fade = fade @padding = padding @orientation = orientation @index = index @is_last = is_last end |
Instance Attribute Details
#fade ⇒ Object (readonly)
Returns the value of attribute fade.
3 4 5 |
# File 'lib/bagel/video/ffmpeg/overlay_filter.rb', line 3 def fade @fade end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
3 4 5 |
# File 'lib/bagel/video/ffmpeg/overlay_filter.rb', line 3 def index @index end |
#is_last ⇒ Object (readonly)
Returns the value of attribute is_last.
3 4 5 |
# File 'lib/bagel/video/ffmpeg/overlay_filter.rb', line 3 def is_last @is_last end |
#orientation ⇒ Object (readonly)
Returns the value of attribute orientation.
3 4 5 |
# File 'lib/bagel/video/ffmpeg/overlay_filter.rb', line 3 def orientation @orientation end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
3 4 5 |
# File 'lib/bagel/video/ffmpeg/overlay_filter.rb', line 3 def padding @padding end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bagel/video/ffmpeg/overlay_filter.rb', line 13 def to_s bottom = LABEL_VIDEO bottom += (1..index).map { |n| LABEL_OVERLAY+n.to_s }.join if index > 0 bottom = "[#{bottom}]" top = fade ? "[#{LABEL_OVERLAY}#{index}]" : "[#{index+1}]" label_out = "[#{LABEL_VIDEO + (1..index+1).map { |n| LABEL_OVERLAY+n.to_s }.join}]" label_out = '' if is_last "#{bottom}#{top}overlay=x=(#{position_x}):y=(#{position_y}):shortest=1#{label_out}" end |