Image-Sane
view release on metacpan or search on metacpan
examples/scanadf-perl view on Meta::CPAN
#
# The number in brackets (I), if present, determines the index of the
# vector element to be set next. If I is not present, the value of
# last index used plus 1 is used. The first index value used is 0
# unless I is present.
#
# S is a scalar value as defined by parse_scalar().
#
# If two consecutive value specs are separated by a comma (,) their
# values are set independently. If they are separated by a dash (-),
# they define the endpoints of a line and all vector values between
# the two endpoints are set according to the value of the
# interpolated line. For example, [0]15-[255]15 defines a vector of
# 256 elements whose value is 15. Similarly, [0]0-[255]255 defines a
# vector of 256 elements whose value starts at 0 and increases to
# 255.
sub parse_vector {
my ( $opt, $str ) = @_;
my $index = -1; ## no critic (ProhibitMagicNumbers)
my $prev_value = 0;
examples/scanimage-perl view on Meta::CPAN
#
# The number in brackets (I), if present, determines the index of the
# vector element to be set next. If I is not present, the value of
# last index used plus 1 is used. The first index value used is 0
# unless I is present.
#
# S is a scalar value as defined by parse_scalar().
#
# If two consecutive value specs are separated by a comma (,) their
# values are set independently. If they are separated by a dash (-),
# they define the endpoints of a line and all vector values between
# the two endpoints are set according to the value of the
# interpolated line. For example, [0]15-[255]15 defines a vector of
# 256 elements whose value is 15. Similarly, [0]0-[255]255 defines a
# vector of 256 elements whose value starts at 0 and increases to
# 255.
sub parse_vector {
my ( $opt, $str ) = @_;
my $index = $INFINITY;
my $prev_value = 0;
( run in 0.649 second using v1.01-cache-2.11-cpan-524268b4103 )