Class: VideoBlur::Box

Inherits:
Object
  • Object
show all
Defined in:
lib/video_blur/box.rb

Instance Method Summary collapse

Constructor Details

#initialize(x:, y:, width:, height:, ratio: 1) ⇒ Box

Returns a new instance of Box.



3
4
5
6
7
8
9
# File 'lib/video_blur/box.rb', line 3

def initialize(x:, y:, width:, height:, ratio: 1)
  @x = x
  @y = y
  @width = width
  @height = height
  @ratio = ratio
end

Instance Method Details

#heightObject



23
24
25
# File 'lib/video_blur/box.rb', line 23

def height
  (@height * @ratio).to_i
end

#widthObject



19
20
21
# File 'lib/video_blur/box.rb', line 19

def width
  (@width * @ratio).to_i
end

#xObject



11
12
13
# File 'lib/video_blur/box.rb', line 11

def x      
  (@x * @ratio).to_i
end

#yObject



15
16
17
# File 'lib/video_blur/box.rb', line 15

def y
  (@y * @ratio).to_i
end