| 1 | package PDF::API2::Resource::ColorSpace; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use base 'PDF::API2::Basic::PDF::Array'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 2 | our $VERSION = '2.044'; # VERSION | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use PDF::API2::Basic::PDF::Utils; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use PDF::API2::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use Scalar::Util qw(weaken); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | =head1 NAME | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | PDF::API2::Resource::ColorSpace - Base class for PDF color spaces | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | =head1 METHODS | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | =over | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | =item $cs = PDF::API2::Resource::ColorSpace->new $pdf, $key, %parameters | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | Returns a new colorspace object. base class for all colorspaces. | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | =cut | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | sub new { | ||||||||||||||||||||||||||||
| 29 | 1 | ▶ | my ($class, $pdf, $key) = @_; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.6
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 1 | ▶ | $class = ref($class) if ref($class); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | 1 | my $self = $class->SUPER::new(); | |||||||||||||||||||||||||||
| 33 | 1 | ▶ | $pdf->new_obj($self) unless $self->is_obj($pdf); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 1 | ▶ | $self->name($key || pdfkey()); | ||||||||||||||||||||||||||
|
Condition33%1/3
$key || pdfkey()
MC/DC0%0/2
$key || pdfkey()
$key
pdfkey()
Truth table33%1/3
A || B
A= $keyB= pdfkey()
| |||||||||||||||||||||||||||||
| 35 | 1 | $self->{' apipdf'} = $pdf; | |||||||||||||||||||||||||||
| 36 | 1 | weaken $self->{' apipdf'}; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 1 | return $self; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | =item $name = $res->name $name | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | Returns or sets the Name of the resource. | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =cut | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | sub name { | ||||||||||||||||||||||||||||
| 48 | 3 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
name: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 49 | 3 | ▶ | if (@_ and defined $_[0]) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ and defined $_[0]
MC/DC50%1/2
@_ and defined $_[0]
@_
defined $_[0]
Truth table66%2/3
A and B
A= @_B= defined $_[0]
| |||||||||||||||||||||||||||||
| 50 | 1 | $self->{' name'} = $_[0]; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | 3 | return $self->{' name'}; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | sub type { | ||||||||||||||||||||||||||||
| 56 | 1 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
type: called CC=3 SCAR=12.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 57 | 1 | ▶ | if (@_ and defined $_[0]) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@_ and defined $_[0]
MC/DC0%0/2
@_ and defined $_[0]
@_
defined $_[0]
Truth table33%1/3
A and B
A= @_B= defined $_[0]
| |||||||||||||||||||||||||||||
| 58 | 1 | $self->{' type'} = $_[0]; | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | 1 | return $self->{' type'}; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | =item @param = $cs->param @param | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | Returns properly formatted color-parameters based on the colorspace. | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | =cut | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | sub param { | ||||||||||||||||||||||||||||
| 70 | 1 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
param: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 71 | 1 | return @_; | |||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | =back | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | =cut | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 2 | 1; | |||||||||||||||||||||||||||