@ISA
=
qw(Text::PDF::Dict)
;
sub
new {
my
(
$class
,
$pdf
,
$name
)=
@_
;
my
$self
=
$class
->SUPER::new();
$self
->{Type}=PDFName(
'XObject'
);
$self
->{Subtype}=PDFName(
'Image'
);
$self
->{Name}=PDFName(
$name
)
if
(
defined
$name
);
$pdf
->new_obj(
$self
);
return
(
$self
);
}
sub
width {
my
$self
=
shift
@_
;
my
$x
=
shift
@_
;
$self
->{Width}=PDFNum(
$x
)
if
(
defined
$x
);
return
(
$self
->{Width}->val);
}
sub
height {
my
$self
=
shift
@_
;
my
$x
=
shift
@_
;
$self
->{Height}=PDFNum(
$x
)
if
(
defined
$x
);
return
(
$self
->{Height}->val);
}
sub
smask {
my
$self
=
shift
@_
;
my
$maskobj
=
shift
@_
;
$self
->{SMask}=
$maskobj
;
return
$self
;
}
sub
mask {
my
$self
=
shift
@_
;
$self
->{Mask}=PDFArray(
map
{ PDFNum(
$_
) }
@_
);
return
$self
;
}
sub
imask {
my
$self
=
shift
@_
;
$self
->{Mask}=
shift
@_
;
return
$self
;
}
sub
colorspace {
my
$self
=
shift
@_
;
my
$obj
=
shift
@_
;
$self
->{
'ColorSpace'
}=
ref
$obj
?
$obj
: PDFName(
$obj
) ;
return
$self
;
}
sub
filters {
my
$self
=
shift
@_
;
$self
->{Filter}=PDFArray(
map
{ PDFName(
$_
) }
@_
);
return
$self
;
}
sub
bpc {
my
$self
=
shift
@_
;
$self
->{BitsPerComponent}=PDFNum(
shift
@_
);
return
$self
;
}
sub
outobjdeep {
my
(
$self
,
@opts
) =
@_
;
foreach
my
$k
(
qw/ api apipdf /
) {
$self
->{
" $k"
}=
undef
;
delete
(
$self
->{
" $k"
});
}
$self
->SUPER::outobjdeep(
@opts
);
}
1;