class GrabzIt::AnimationOptions

Represents all of the options available when creating an animated GIF @version 3.0 @author GrabzIt

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/grabzit/animationoptions.rb, line 8
def initialize()
        super()
        @width = 0
        @height = 0
        @start = 0
        @duration = 1
        @speed = 0
        @framesPerSecond = 0
        @repeat = 0
        @reverse = false
        @customWaterMarkId = nil
        @quality = -1
end

Public Instance Methods

_getParameters(applicationKey, sig, callBackURL, dataName, dataValue) click to toggle source

@!visibility private

# File lib/grabzit/animationoptions.rb, line 166
def _getParameters(applicationKey, sig, callBackURL, dataName, dataValue)
        params = createParameters(applicationKey, sig, callBackURL, dataName, dataValue)     
        params['width'] = GrabzIt::Utility.nil_int_check(@width)
        params['height'] = GrabzIt::Utility.nil_int_check(@height)
        params['duration'] = GrabzIt::Utility.nil_int_check(@duration)
        params['speed'] = GrabzIt::Utility.nil_float_check(@speed)
        params['customwatermarkid'] = GrabzIt::Utility.nil_check(@customWaterMarkId)
        params['start'] = GrabzIt::Utility.nil_int_check(@start)
        params['fps'] = GrabzIt::Utility.nil_float_check(@framesPerSecond)
        params['repeat'] = GrabzIt::Utility.nil_int_check(@repeat)
        params['reverse'] = GrabzIt::Utility.b_to_str(@reverse)              
        params['quality'] = GrabzIt::Utility.nil_int_check(@quality)                 
        
        return params
end
_getSignatureString(applicationSecret, callBackURL, url = nil) click to toggle source

@!visibility private

# File lib/grabzit/animationoptions.rb, line 153
def _getSignatureString(applicationSecret, callBackURL, url = nil)
        items = [applicationSecret]
        
        if(url != nil)
                items.push(GrabzIt::Utility.nil_check(url))
        end
        
        items.push(GrabzIt::Utility.nil_check(callBackURL),GrabzIt::Utility.nil_int_check(@height),GrabzIt::Utility.nil_int_check(@width),GrabzIt::Utility.nil_check(@customId),GrabzIt::Utility.nil_float_check(@framesPerSecond),GrabzIt::Utility.nil_float_check(@speed),GrabzIt::Utility.nil_int_check(@duration),GrabzIt::Utility.nil_int_check(@repeat),GrabzIt::Utility.b_to_str(@reverse),GrabzIt::Utility.nil_int_check(@start),GrabzIt::Utility.nil_check(@customWaterMarkId),GrabzIt::Utility.nil_check(@country),GrabzIt::Utility.nil_int_check(@quality),GrabzIt::Utility.nil_check(@exportURL),GrabzIt::Utility.nil_check(@encryptionKey),GrabzIt::Utility.nil_check(@proxy))

        return items.join("|")
end
customWaterMarkId() click to toggle source

@return [String] the custom watermark id

# File lib/grabzit/animationoptions.rb, line 127
def customWaterMarkId
        @customWaterMarkId
end
customWaterMarkId=(value) click to toggle source

Set a custom watermark to add to the animated GIF

@param value [String] custom watermark id @return [void]

# File lib/grabzit/animationoptions.rb, line 135
def customWaterMarkId=(value)
        @customWaterMarkId = value
end
duration() click to toggle source

@return [Integer] the length in seconds of the video that should be converted into a animated GIF

# File lib/grabzit/animationoptions.rb, line 62
def duration
        @duration
end
duration=(value) click to toggle source

Set the length in seconds of the video that should be converted into a animated GIF

@param value [Integer] the number of seconds @return [void]

# File lib/grabzit/animationoptions.rb, line 70
def duration=(value)
        @duration = value
end
framesPerSecond() click to toggle source

@return [Float] the number of frames per second that should be captured from the video

# File lib/grabzit/animationoptions.rb, line 88
def framesPerSecond
        @framesPerSecond
end
framesPerSecond=(value) click to toggle source

Set the number of frames per second that should be captured from the video. From a minimum of 0.2 to a maximum of 60

@param value [Float] the number of frames per second @return [void]

# File lib/grabzit/animationoptions.rb, line 96
def framesPerSecond=(value)
        @framesPerSecond = value
end
height() click to toggle source

@return [Integer] the height of the resulting animated GIF in pixels

# File lib/grabzit/animationoptions.rb, line 36
def height
        @height
end
height=(value) click to toggle source

Set the height of the resulting animated GIF in pixels

@param value [Integer] the height @return [void]

# File lib/grabzit/animationoptions.rb, line 44
def height=(value)
        @height = value
end
quality() click to toggle source

@return [Integer] the quality of the animated GIF

# File lib/grabzit/animationoptions.rb, line 140
def quality
        @quality
end
quality=(value) click to toggle source

Set the quality of the image where 0 is poor and 100 excellent. The default is -1 which uses the recommended quality

@param value [Integer] the custom identifier @return [void]

# File lib/grabzit/animationoptions.rb, line 148
def quality=(value)
        @quality = value
end
repeat() click to toggle source

@return [Integer] the number of times to loop the animated GIF

# File lib/grabzit/animationoptions.rb, line 101
def repeat
        @repeat
end
repeat=(value) click to toggle source

Set the number of times to loop the animated GIF. If 0 it will loop forever

@param value [Integer] the number of times to loop @return [void]

# File lib/grabzit/animationoptions.rb, line 109
def repeat=(value)
        @repeat = value
end
reverse() click to toggle source

@return [Boolean] if the frames of the animated GIF should be reversed

# File lib/grabzit/animationoptions.rb, line 114
def reverse
        @reverse
end
reverse=(value) click to toggle source

Set to true if the frames of the animated GIF should be reversed

@param value [Boolean] reverse value @return [void]

# File lib/grabzit/animationoptions.rb, line 122
def reverse=(value)
        @reverse = value
end
speed() click to toggle source

@return [Float] the speed of the animated GIF

# File lib/grabzit/animationoptions.rb, line 75
def speed
        @speed
end
speed=(value) click to toggle source

Set the speed of the animated GIF from 0.2 to 10 times the original speed

@param value [Float] the speed @return [void]

# File lib/grabzit/animationoptions.rb, line 83
def speed=(value)
        @speed = value
end
start() click to toggle source

@return [Integer] the starting position of the video that should be converted into an animated GIF

# File lib/grabzit/animationoptions.rb, line 49
def start
        @start
end
start=(value) click to toggle source

Set the starting position of the video that should be converted into an animated GIF

@param value [Integer] the second to start at @return [void]

# File lib/grabzit/animationoptions.rb, line 57
def start=(value)
        @start = value
end
width() click to toggle source

@return [Integer] the width of the resulting animated GIF in pixels

# File lib/grabzit/animationoptions.rb, line 23
def width
        @width
end
width=(value) click to toggle source

Set the width of the resulting animated GIF in pixels

@param value [Integer] the width @return [void]

# File lib/grabzit/animationoptions.rb, line 31
def width=(value)
        @width = value
end