line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CAM::PDF::Renderer::Images; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
35
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
52
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
5
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
648
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.60'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=for stopwords inline |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
CAM::PDF::Renderer::Images - Find all of the images in a page |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 LICENSE |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
See CAM::PDF. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
use CAM::PDF; |
22
|
|
|
|
|
|
|
my $pdf = CAM::PDF->new($filename); |
23
|
|
|
|
|
|
|
my $contentTree = $pdf->getPageContentTree(4); |
24
|
|
|
|
|
|
|
my $gs = $contentTree->findImages(); |
25
|
|
|
|
|
|
|
my @imageNodes = @{$gs->{images}}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
This class is used to identify all image nodes in a page content tree. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 FUNCTIONS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=over |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=item $self->new() |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Creates a new renderer. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new |
42
|
|
|
|
|
|
|
{ |
43
|
14
|
|
|
14
|
1
|
24
|
my $pkg = shift; |
44
|
14
|
|
|
|
|
89
|
return bless { |
45
|
|
|
|
|
|
|
images => [], |
46
|
|
|
|
|
|
|
}, $pkg; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item $self->clone() |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Duplicates an instance. The new instance deliberately shares its |
52
|
|
|
|
|
|
|
C property with the original instance. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub clone |
57
|
|
|
|
|
|
|
{ |
58
|
9
|
|
|
9
|
1
|
15
|
my $self = shift; |
59
|
|
|
|
|
|
|
|
60
|
9
|
|
|
|
|
16
|
my $pkg = ref $self; |
61
|
9
|
|
|
|
|
22
|
my $new_self = $pkg->new(); |
62
|
9
|
|
|
|
|
17
|
$new_self->{images} = $self->{images}; |
63
|
9
|
|
|
|
|
30
|
return $new_self; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=item $self->Do(DATA...) |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Record an indirect image node. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub Do |
73
|
|
|
|
|
|
|
{ |
74
|
8
|
|
|
8
|
1
|
23
|
my ($self, @rest) = @_; |
75
|
8
|
|
|
|
|
20
|
my $value = [@rest]; |
76
|
|
|
|
|
|
|
|
77
|
8
|
|
|
|
|
11
|
push @{$self->{images}}, { |
|
8
|
|
|
|
|
50
|
|
78
|
|
|
|
|
|
|
type => 'Do', |
79
|
|
|
|
|
|
|
value => $value, |
80
|
|
|
|
|
|
|
}; |
81
|
8
|
|
|
|
|
25
|
return; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item $self->BI(DATA...) |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Record an inline image node. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub BI |
91
|
|
|
|
|
|
|
{ |
92
|
1
|
|
|
1
|
1
|
4
|
my ($self, @rest) = @_; |
93
|
1
|
|
|
|
|
3
|
my $value = [@rest]; |
94
|
|
|
|
|
|
|
|
95
|
1
|
|
|
|
|
3
|
push @{$self->{images}}, { |
|
1
|
|
|
|
|
4
|
|
96
|
|
|
|
|
|
|
type => 'BI', |
97
|
|
|
|
|
|
|
value => $value, |
98
|
|
|
|
|
|
|
}; |
99
|
1
|
|
|
|
|
4
|
return; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |
103
|
|
|
|
|
|
|
__END__ |