line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::Builder::Resource::ColorSpace::Indexed::Hue; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1100
|
use base 'PDF::Builder::Resource::ColorSpace::Indexed'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
104
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
22
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
49
|
|
7
|
|
|
|
|
|
|
#no warnings qw[ deprecated recursion uninitialized ]; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '3.023'; # VERSION |
10
|
|
|
|
|
|
|
our $LAST_UPDATE = '3.021'; # manually update whenever code is changed |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
18
|
use PDF::Builder::Basic::PDF::Utils; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
94
|
|
13
|
1
|
|
|
1
|
|
7
|
use PDF::Builder::Util; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
144
|
|
14
|
1
|
|
|
1
|
|
8
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
385
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
PDF::Builder::Resource::ColorSpace::Indexed::Hue - colorspace support for Device RGB. Inherits from L |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
0
|
|
|
0
|
1
|
|
my ($class, $pdf) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
$class = ref $class if ref $class; |
26
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new($pdf, pdfkey()); |
27
|
0
|
0
|
|
|
|
|
$pdf->new_obj($self) unless $self->is_obj($pdf); |
28
|
0
|
|
|
|
|
|
$self->{' apipdf'} = $pdf; |
29
|
0
|
|
|
|
|
|
weaken $self->{' apipdf'}; |
30
|
0
|
|
|
|
|
|
my $csd = PDFDict(); |
31
|
0
|
|
|
|
|
|
$pdf->new_obj($csd); |
32
|
0
|
|
|
|
|
|
$csd->{'Filter'} = PDFArray(PDFName('FlateDecode')); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
## $csd->{'WhitePoint'} = PDFArray(map { PDFNum($_) } (0.95049, 1, 1.08897)); |
35
|
|
|
|
|
|
|
## $csd->{'BlackPoint'} = PDFArray(map { PDFNum($_) } (0, 0, 0)); |
36
|
|
|
|
|
|
|
## $csd->{'Gamma'} = PDFArray(map { PDFNum($_) } (2.22218, 2.22218, 2.22218)); |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
$csd->{' stream'} = ''; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my %cc = (); |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
foreach my $s (4,3,2,1) { |
43
|
0
|
|
|
|
|
|
foreach my $v (4,3) { |
44
|
0
|
|
|
|
|
|
foreach my $r (0..31) { |
45
|
0
|
|
|
|
|
|
$csd->{' stream'} .= pack('CCC', map { $_*255 } namecolor('!'.sprintf('%02X', $r*255/31).sprintf('%02X', $s*255/4).sprintf('%02X', $v*255/4))); |
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
$csd->{' stream'} .= "\x00" x 768; |
51
|
0
|
|
|
|
|
|
$csd->{' stream'} = substr($csd->{' stream'}, 0, 768); |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
$self->add_elements(PDFName('DeviceRGB'), PDFNum(255), $csd); |
54
|
0
|
|
|
|
|
|
$self->{' csd'} = $csd; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
return $self; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |