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