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

filter: Statementstmt 81.8% 9 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 86.6% 13 / 15 CC 1 SCAR 0.7
CC
1
Cov
82%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/CXC/Gnuplot/V1/Title.pm ↑ Summary Build »
1 package CXC::Gnuplot::V0::Terminal::pngcairo;
2  
3 1 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Feature::Compat::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use experimental 'builtin';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 our $VERSION = 'v0.29.3';
8  
9 1 ▶class CXC::Gnuplot::V0::Terminal::pngcairo : isa(CXC::Gnuplot::V0::Terminal::cairo);
Subroutine BEGIN: called CC=1 SCAR=2.6
10  
11 use CXC::Gnuplot::V0::Types -lexical, qw( PositiveNum );
12 use CXC::Gnuplot::V0::Util -lexical => 'clone_object', '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 sub terminal { 'pngcairo' }
41  
42 use constant _DEFAULT_EXT => '.png';
43  
44 ADJUST {
45  
46 defined $transparent
47 and !is_bool( $transparent )
48 and croak( q{invalid value for "transparent" parameter: must be bool} );
49  
50 defined $crop
51 and !is_bool( $crop )
52 and croak( q{invalid value for "crop" parameter: must be bool} );
53  
54 pvalidate( pointscale => PositiveNum, \$pointscale );
55 }
56  
57  
58  
59  
60  
61 method to_hash {
62  
63 to_hash_r( {
64 $self->SUPER::to_hash->%*,
65 ( defined $transparent ? ( transparent => $transparent ) : () ),
66 ( defined $crop ? ( crop => $crop ) : () ),
67 ( defined $pointscale ? ( pointscale => $pointscale ) : () ),
68 } );
69  
70 }
71  
72  
73  
74  
75  
76 method opts {
77  
78 return (
79 $self->SUPER::opts,
80 ( defined $transparent ? $transparent ? 'transparent' : 'notransparent' : () ),
81 ( defined $crop ? $crop ? 'crop' : 'nocrop' : () ),
82 ( defined $pointscale ? [ pointscale => $pointscale ] : () ),
83 );
84  
85 }
86  
87 1;
88  
89 #
90 # This file is part of CXC-Gnuplot
91 #
92 # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory.
93 #
94 # This is free software, licensed under:
95 #
96 # The GNU General Public License, Version 3, June 2007
97 #
98  
99 __END__
« blib/lib/CXC/Gnuplot/V1/Title.pm ↑ Summary Build »