Video::Delay::Func - Video::Delay class for delays defined by math function.
use Video::Delay::Func; my $obj = Video::Delay::Func->new(%parameters); my $delay = $obj->delay;
new(%parameters)
Constructor
func
Math function in string with 't' time variable. Or callback with one input argument as time variable. Default value is reference to subroutine: sub { my $t = shift; return 1000 * sin($t); };
incr
Counter increment. Default value is 0.1.
delay()
Returns delay defined by function in miliseconds. Time si affected by 'incr' increment parameter.
new(): Parameter 'func' must be scalar or code. From Class::Utils::set_params(): Unknown parameter '%s'. delay(): Error in function. Error, %s
use strict; use warnings; use Video::Delay::Func; # Object. my $obj = Video::Delay::Func->new( 'func' => sub { my $t = shift; return 1000 * sin($t); }, 'incr' => 0.1, ); # Print delay. print $obj->delay."\n"; print $obj->delay."\n"; print $obj->delay."\n"; # Output: # 99.8334166468282 # 198.669330795061 # 295.52020666134
use strict; use warnings; use Video::Delay::Func; # Object. my $obj = Video::Delay::Func->new( 'func' => '1000 * sin(t)', 'incr' => 0.1, ); # Print delay. print $obj->delay."\n"; print $obj->delay."\n"; print $obj->delay."\n"; # Output: # 99.8334166468282 # 198.669330795061 # 295.52020666134
Class::Utils, English, Error::Pure.
Perl classes for delays between frames generation.
https://github.com/michal-josef-spacek/Video-Delay
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2012-2020 Michal Josef Špaček BSD 2-Clause License
0.07
To install Video::Delay, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Video::Delay
CPAN shell
perl -MCPAN -e shell install Video::Delay
For more information on module installation, please visit the detailed CPAN module installation guide.