line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::API2::Resource::ColorSpace; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
3065
|
use base 'PDF::API2::Basic::PDF::Array'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
300
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
47
|
|
6
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
93
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '2.043'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
12
|
use PDF::API2::Basic::PDF::Utils; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
170
|
|
11
|
2
|
|
|
2
|
|
13
|
use PDF::API2::Util; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
336
|
|
12
|
2
|
|
|
2
|
|
15
|
use Scalar::Util qw(weaken); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
646
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
PDF::API2::Resource::ColorSpace - Base class for PDF color spaces |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 METHODS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=over |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=item $cs = PDF::API2::Resource::ColorSpace->new $pdf, $key, %parameters |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Returns a new colorspace object. base class for all colorspaces. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new { |
29
|
1
|
|
|
1
|
1
|
3
|
my ($class, $pdf, $key) = @_; |
30
|
|
|
|
|
|
|
|
31
|
1
|
50
|
|
|
|
3
|
$class = ref($class) if ref($class); |
32
|
1
|
|
|
|
|
6
|
my $self = $class->SUPER::new(); |
33
|
1
|
50
|
|
|
|
10
|
$pdf->new_obj($self) unless $self->is_obj($pdf); |
34
|
1
|
|
33
|
|
|
8
|
$self->name($key || pdfkey()); |
35
|
1
|
|
|
|
|
2
|
$self->{' apipdf'} = $pdf; |
36
|
1
|
|
|
|
|
5
|
weaken $self->{' apipdf'}; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
3
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item $name = $res->name $name |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Returns or sets the Name of the resource. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub name { |
48
|
3
|
|
|
3
|
1
|
5
|
my $self = shift(); |
49
|
3
|
100
|
66
|
|
|
13
|
if (@_ and defined $_[0]) { |
50
|
1
|
|
|
|
|
3
|
$self->{' name'} = $_[0]; |
51
|
|
|
|
|
|
|
} |
52
|
3
|
|
|
|
|
20
|
return $self->{' name'}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub type { |
56
|
1
|
|
|
1
|
0
|
2
|
my $self = shift(); |
57
|
1
|
50
|
33
|
|
|
8
|
if (@_ and defined $_[0]) { |
58
|
1
|
|
|
|
|
3
|
$self->{' type'} = $_[0]; |
59
|
|
|
|
|
|
|
} |
60
|
1
|
|
|
|
|
3
|
return $self->{' type'}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item @param = $cs->param @param |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Returns properly formatted color-parameters based on the colorspace. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub param { |
70
|
1
|
|
|
1
|
1
|
2
|
my $self = shift(); |
71
|
1
|
|
|
|
|
10
|
return @_; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=back |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |