line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::API2::Resource::ColorSpace; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2562
|
use base 'PDF::API2::Basic::PDF::Array'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
226
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
47
|
|
6
|
2
|
|
|
2
|
|
25
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
84
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '2.044'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
13
|
use PDF::API2::Basic::PDF::Utils; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
182
|
|
11
|
2
|
|
|
2
|
|
14
|
use PDF::API2::Util; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
304
|
|
12
|
2
|
|
|
2
|
|
15
|
use Scalar::Util qw(weaken); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
635
|
|
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
|
|
|
|
|
5
|
my $self = $class->SUPER::new(); |
33
|
1
|
50
|
|
|
|
7
|
$pdf->new_obj($self) unless $self->is_obj($pdf); |
34
|
1
|
|
33
|
|
|
12
|
$self->name($key || pdfkey()); |
35
|
1
|
|
|
|
|
2
|
$self->{' apipdf'} = $pdf; |
36
|
1
|
|
|
|
|
4
|
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
|
6
|
my $self = shift(); |
49
|
3
|
100
|
66
|
|
|
12
|
if (@_ and defined $_[0]) { |
50
|
1
|
|
|
|
|
2
|
$self->{' name'} = $_[0]; |
51
|
|
|
|
|
|
|
} |
52
|
3
|
|
|
|
|
18
|
return $self->{' name'}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub type { |
56
|
1
|
|
|
1
|
0
|
1
|
my $self = shift(); |
57
|
1
|
50
|
33
|
|
|
8
|
if (@_ and defined $_[0]) { |
58
|
1
|
|
|
|
|
2
|
$self->{' type'} = $_[0]; |
59
|
|
|
|
|
|
|
} |
60
|
1
|
|
|
|
|
2
|
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
|
|
|
|
|
17
|
return @_; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=back |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |