line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::Builder::Resource::ColorSpace::Indexed::ACTFile; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1067
|
use base 'PDF::Builder::Resource::ColorSpace::Indexed'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
105
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
20
|
|
6
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
63
|
|
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
|
|
9
|
use PDF::Builder::Basic::PDF::Utils; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
13
|
1
|
|
|
1
|
|
6
|
use PDF::Builder::Util; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
155
|
|
14
|
1
|
|
|
1
|
|
8
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
404
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
PDF::Builder::Resource::ColorSpace::Indexed::ACTFile - Adobe Color Table support |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 METHODS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=over |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=item $cs = PDF::Builder::Resource::ColorSpace::Indexed::ACTFile->new($pdf, $actfile) |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Returns a new colorspace object created from an adobe color table file (ACT/8BCT). |
27
|
|
|
|
|
|
|
See |
28
|
|
|
|
|
|
|
Adobe Photoshop(R) 6.0 -- |
29
|
|
|
|
|
|
|
File Formats Specification Version 6.0 Release 2, |
30
|
|
|
|
|
|
|
November 2000 |
31
|
|
|
|
|
|
|
for details. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
0
|
|
|
0
|
1
|
|
my ($class, $pdf, $file) = @_; |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
die "could not find act-file '$file'." unless -f $file; |
39
|
0
|
0
|
|
|
|
|
$class = ref $class if ref $class; |
40
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new($pdf, pdfkey()); |
41
|
0
|
0
|
|
|
|
|
$pdf->new_obj($self) unless $self->is_obj($pdf); |
42
|
0
|
|
|
|
|
|
$self->{' apipdf'} = $pdf; |
43
|
0
|
|
|
|
|
|
weaken $self->{' apipdf'}; |
44
|
0
|
|
|
|
|
|
my $csd = PDFDict(); |
45
|
0
|
|
|
|
|
|
$pdf->new_obj($csd); |
46
|
0
|
|
|
|
|
|
$csd->{'Filter'} = PDFArray(PDFName('FlateDecode')); |
47
|
0
|
|
|
|
|
|
$csd->{'WhitePoint'} = PDFArray(map {PDFNum($_)} (0.95049, 1, 1.08897)); |
|
0
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
$csd->{'BlackPoint'} = PDFArray(map {PDFNum($_)} (0, 0, 0)); |
|
0
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
$csd->{'Gamma'} = PDFArray(map {PDFNum($_)} (2.22218, 2.22218, 2.22218)); |
|
0
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $fh; |
52
|
0
|
0
|
|
|
|
|
open($fh, "<", $file) or die "$!: $file"; |
53
|
0
|
|
|
|
|
|
binmode($fh,':raw'); |
54
|
0
|
|
|
|
|
|
read($fh, $csd->{' stream'}, 768); |
55
|
0
|
|
|
|
|
|
close($fh); |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$csd->{' stream'} .= "\x00" x 768; |
58
|
0
|
|
|
|
|
|
$csd->{' stream'} = substr($csd->{' stream'}, 0, 768); |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
$self->add_elements(PDFName('DeviceRGB'), PDFNum(255),$csd); |
61
|
0
|
|
|
|
|
|
$self->{' csd'} = $csd; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return $self; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=back |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |