blib/lib/CXC/Gnuplot/V1/Terminal/pngcairo.pm

filter: Statementstmt 60.0% 3 / 5 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 71.4% 5 / 7 CC 1 SCAR 1.4
CC
1
Cov
60%
BEGIN
1.3
BEGIN
1.0
CRAP 1.1
« blib/lib/CXC/Gnuplot/V1/Terminal/pdfcairo.pm ↑ Summary blib/lib/CXC/Gnuplot/V1/TerminalBase.pm »
1 package CXC::Gnuplot::V1::Terminal::pngcairo;
2  
3 1 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Object::Pad 0.821;
Subroutine BEGIN: called CC=1 SCAR=2.6
5 use experimental 'builtin';
6  
7 our $VERSION = 'v0.29.3';
8  
9 class CXC::Gnuplot::V1::Terminal::pngcairo : isa(CXC::Gnuplot::V1::Terminal::cairo);
10  
11 use CXC::Gnuplot::V1::Types -lexical, qw( PositiveNum );
12 use CXC::Gnuplot::V1::Util -lexical => 'pvalidate', 'to_hash_r';
13  
14 use builtin 'is_bool';
15  
16 #<<< no tidy
17 field $transparent :param :reader = undef;
18 field $crop :param :reader = undef;
19 field $pointscale :param :reader = undef;
20 #>>>
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42 sub terminal { 'pngcairo' }
43  
44 use constant _DEFAULT_EXT => '.png';
45  
46  
47 ADJUST {
48  
49 defined $transparent
50 and !is_bool( $transparent )
51 and croak( q{invalid value for "transparent" parameter: must be bool} );
52  
53 defined $crop
54 and !is_bool( $crop )
55 and croak( q{invalid value for "crop" parameter: must be bool} );
56  
57 pvalidate( pointscale => PositiveNum, \$pointscale );
58 }
59  
60  
61  
62  
63  
64  
65  
66  
67 method to_hash {
68  
69 to_hash_r( {
70 $self->SUPER::to_hash->%*,
71 ( defined $transparent ? ( transparent => $transparent ) : () ),
72 ( defined $crop ? ( crop => $crop ) : () ),
73 ( defined $pointscale ? ( pointscale => $pointscale ) : () ),
74 } );
75  
76 }
77  
78  
79  
80  
81  
82 method opts {
83  
84 return (
85 $self->SUPER::opts,
86 ( defined $transparent ? $transparent ? 'transparent' : 'notransparent' : () ),
87 ( defined $crop ? $crop ? 'crop' : 'nocrop' : () ),
88 ( defined $pointscale ? [ pointscale => $pointscale ] : () ),
89 );
90  
91 }
92  
93 1;
94  
95 #
96 # This file is part of CXC-Gnuplot
97 #
98 # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory.
99 #
100 # This is free software, licensed under:
101 #
102 # The GNU General Public License, Version 3, June 2007
103 #
104  
105 __END__
« blib/lib/CXC/Gnuplot/V1/Terminal/pdfcairo.pm ↑ Summary blib/lib/CXC/Gnuplot/V1/TerminalBase.pm »