BlurFill/CLI.pm

filter: Statementstmt 90.9% 20 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 90.3% 28 / 31 CC 2 SCAR 3.0
CC
2
Cov
88%
run
2.2
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« BlurFill.pm ↑ Summary
1 =head1 NAME
2  
3 App::BlurFill::CLI - The command line interface for App::BlurFill
4  
5 =head1 SYNOPSIS
6  
7 use App::BlurFill::CLI;
8  
9 my $blur_fill = App::BlurFill::CLI->new;
10  
11 my $output = $blur_fill->process;
12 print "Blurred image saved to: $output\n";
13  
14 =head1 DESCRIPTION
15  
16 App::BlurFill::CLI is a simple command line tool to create a blurred background image
17 from a given image. It scales the image to a specified width and height, applies
18 a Gaussian blur, and saves the result as a new image file.
19  
20 =head1 METHODS
21  
22 =head2 new
23  
24 my $blur_fill = App::BlurFill::CLI->new();
25  
26 Creates a new App::BlurFill object. The no parameters are required.
27  
28 =head2 run
29  
30 $blur_fill->run();
31  
32 Runs the command line interface. It processes the command line arguments and
33 creates a new App::BlurFill object.
34  
35 =cut
36  
37 2 ▶use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 2 ▶use experimental 'class';
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 2 class App::BlurFill::CLI {
41 2 our $VERSION = '0.1.0';
42  
43 2 ▶ use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 2 ▶ use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
45 2 ▶ use App::BlurFill;
Subroutine BEGIN: called CC=1 SCAR=0.0
46  
47 1 ▶ method run {
Subroutine run: called CC=2 SCAR=7.9
Pod documented
48 1 my %opts;
49 1 GetOptions(\%opts, 'width:i', 'height:i', 'output:s');
50  
51 1 ▶ my $in = shift @ARGV or die "Usage: blurfill [--width w] [--height h] [--output o] image_file\n";
Branch: 1 branch
BranchTrueFalseTotal
my $in = shift @ARGV or die "Usage: blurfill [--width w] [--height h] [--output o] image_file\n" 1 0 1
52  
53 1 my $blur = App::BlurFill->new(
54 file => $in,
55 %opts,
56 );
57  
58 0 my $outfile = $blur->process;
59 0 say "Wrote $outfile";
60 }
61 }
62  
63 =head1 AUTHOR
64  
65 Dave Cross <dave@perlhacks.com>
66  
67 =head1 COPYRIGHT AND LICENSE
68  
69 This software is copyright (c) 2025, Magnum Solutions Ltd. All rights reserved.
70  
71 This is free software; you can redistribute it and/or modify it under the same
72 terms as the Perl 5 programming language system itself.
73  
74 =cut
« BlurFill.pm ↑ Summary