line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::Builder::Resource::ColorSpace; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2095
|
use base 'PDF::Builder::Basic::PDF::Array'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
179
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
35
|
|
6
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
94
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '3.024'; # VERSION |
9
|
|
|
|
|
|
|
our $LAST_UPDATE = '3.024'; # manually update whenever code is changed |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
11
|
use PDF::Builder::Basic::PDF::Utils; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
168
|
|
12
|
2
|
|
|
2
|
|
14
|
use PDF::Builder::Util; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
249
|
|
13
|
2
|
|
|
2
|
|
12
|
use Scalar::Util qw(weaken); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
522
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
PDF::Builder::Resource::ColorSpace - Base class for PDF color spaces |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 METHODS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=over |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=item $cs = PDF::Builder::Resource::ColorSpace->new($pdf, $key, %opts) |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Returns a new colorspace object, base class for all colorspaces. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub new { |
30
|
1
|
|
|
1
|
1
|
2
|
my ($class, $pdf, $key, %opts) = @_; |
31
|
|
|
|
|
|
|
|
32
|
1
|
50
|
|
|
|
2
|
$class = ref($class) if ref($class); |
33
|
1
|
|
|
|
|
6
|
my $self = $class->SUPER::new(); |
34
|
1
|
50
|
|
|
|
6
|
$pdf->new_obj($self) unless $self->is_obj($pdf); |
35
|
1
|
|
33
|
|
|
6
|
$self->name($key || pdfkey()); |
36
|
1
|
|
|
|
|
1
|
$self->{' apipdf'} = $pdf; |
37
|
1
|
|
|
|
|
3
|
weaken $self->{' apipdf'}; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
3
|
return $self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item $name = $res->name($name) # Set |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item $name = $res->name() # Get |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Returns or sets the Name of the resource. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub name { |
51
|
3
|
|
|
3
|
1
|
6
|
my ($self, $name) = @_; |
52
|
|
|
|
|
|
|
|
53
|
3
|
100
|
|
|
|
6
|
if (defined $name) { |
54
|
1
|
|
|
|
|
2
|
$self->{' name'} = $name; |
55
|
|
|
|
|
|
|
} |
56
|
3
|
|
|
|
|
15
|
return $self->{' name'}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub type { |
60
|
1
|
|
|
1
|
0
|
2
|
my ($self, $type) = @_; |
61
|
|
|
|
|
|
|
|
62
|
1
|
50
|
|
|
|
3
|
if (defined $type) { |
63
|
1
|
|
|
|
|
1
|
$self->{' type'} = $type; |
64
|
|
|
|
|
|
|
} |
65
|
1
|
|
|
|
|
42
|
return $self->{' type'}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item @param = $cs->param(@param) |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Returns properly formatted color-parameters based on the colorspace. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub param { |
75
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
76
|
|
|
|
|
|
|
|
77
|
1
|
|
|
|
|
7
|
return @_; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
#sub outobjdeep { |
81
|
|
|
|
|
|
|
# my ($self, @opts) = @_; |
82
|
|
|
|
|
|
|
# |
83
|
|
|
|
|
|
|
# foreach my $k (qw/ api apipdf /) { |
84
|
|
|
|
|
|
|
# $self->{" $k"} = undef; |
85
|
|
|
|
|
|
|
# delete($self->{" $k"}); |
86
|
|
|
|
|
|
|
# } |
87
|
|
|
|
|
|
|
# return $self->SUPER::outobjdeep(@opts); |
88
|
|
|
|
|
|
|
#} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=back |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |