| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package PDF::Builder::Resource::ColorSpace::Indexed::Hue; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
983
|
use base 'PDF::Builder::Resource::ColorSpace::Indexed'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
97
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
42
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
77
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '3.028'; # VERSION |
|
9
|
|
|
|
|
|
|
our $LAST_UPDATE = '3.027'; # manually update whenever code is changed |
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use PDF::Builder::Basic::PDF::Utils; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
108
|
|
|
12
|
1
|
|
|
1
|
|
6
|
use PDF::Builder::Util; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
138
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use Scalar::Util qw(weaken); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
347
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
PDF::Builder::Resource::ColorSpace::Indexed::Hue - Colorspace support for Device RGB |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Inherits from L<PDF::Builder::Resource::ColorSpace::Indexed> |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 new |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=over |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Create a new Indexed Hue colorspace object. |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=back |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
|
34
|
0
|
|
|
0
|
1
|
|
my ($class, $pdf) = @_; |
|
35
|
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
$class = ref($class) if ref($class); |
|
37
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new($pdf, pdfkey()); |
|
38
|
0
|
0
|
|
|
|
|
$pdf->new_obj($self) unless $self->is_obj($pdf); |
|
39
|
0
|
|
|
|
|
|
$self->{' apipdf'} = $pdf; |
|
40
|
0
|
|
|
|
|
|
weaken $self->{' apipdf'}; |
|
41
|
0
|
|
|
|
|
|
my $csd = PDFDict(); |
|
42
|
0
|
|
|
|
|
|
$pdf->new_obj($csd); |
|
43
|
0
|
|
|
|
|
|
$csd->{'Filter'} = PDFArray(PDFName('FlateDecode')); |
|
44
|
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
my %cc; |
|
46
|
0
|
|
|
|
|
|
my $stream = ''; |
|
47
|
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
foreach my $s (4,3,2,1) { |
|
49
|
0
|
|
|
|
|
|
foreach my $v (4,3) { |
|
50
|
0
|
|
|
|
|
|
foreach my $r (0..31) { |
|
51
|
|
|
|
|
|
|
$stream .= pack('CCC', |
|
52
|
0
|
|
|
|
|
|
map { $_*255 } |
|
|
0
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
namecolor(join('', |
|
54
|
|
|
|
|
|
|
'!', |
|
55
|
|
|
|
|
|
|
sprintf('%02X', $r*255/31), |
|
56
|
|
|
|
|
|
|
sprintf('%02X', $s*255/4), |
|
57
|
|
|
|
|
|
|
sprintf('%02X', $v*255/4)))); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
$stream .= "\x00" x 768; |
|
63
|
0
|
|
|
|
|
|
$stream = substr($stream, 0, 768); |
|
64
|
0
|
|
|
|
|
|
$csd->{' stream'} = $stream; |
|
65
|
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
$self->add_elements(PDFName('DeviceRGB'), PDFNum(255), $csd); |
|
67
|
0
|
|
|
|
|
|
$self->{' csd'} = $csd; |
|
68
|
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
return $self; |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |