class VideoBlur::Screen

Public Class Methods

new(width: 1440, height: 815) click to toggle source
# File lib/video_blur/screen.rb, line 3
def initialize(width: 1440, height: 815)
  @width = width && width.to_f || 1140
  @height = height && height.to_f || 815
end

Public Instance Methods

ratio(video:) click to toggle source
# File lib/video_blur/screen.rb, line 8
def ratio(video:)
  #If video is re-dimensionned along x axis
  if video.width > @width
    video.width/@width
  #If video is re-dimensionned along y axis
  elsif video.height > @height
    video.height/@height
  #If video fits on screen
  else
    1.0
  end
end