| 1 | package PDF::API2::Resource::ExtGState; | ||||||||||
| 2 | |||||||||||
| 3 | 38 | ▶ | use base 'PDF::API2::Resource'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 38 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 38 | ▶ | no warnings qw[ deprecated recursion uninitialized ]; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 38 | our $VERSION = '2.044'; # VERSION | |||||||||
| 9 | |||||||||||
| 10 | 38 | ▶ | use PDF::API2::Basic::PDF::Utils; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 38 | ▶ | use PDF::API2::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | =head1 NAME | ||||||||||
| 14 | |||||||||||
| 15 | PDF::API2::Resource::ExtGState - Graphics state dictionary support | ||||||||||
| 16 | |||||||||||
| 17 | =head1 METHODS | ||||||||||
| 18 | |||||||||||
| 19 | =over | ||||||||||
| 20 | |||||||||||
| 21 | =item $egs = PDF::API2::Resource::ExtGState->new @parameters | ||||||||||
| 22 | |||||||||||
| 23 | Returns a new extgstate object (called from $pdf->egstate). | ||||||||||
| 24 | |||||||||||
| 25 | =cut | ||||||||||
| 26 | |||||||||||
| 27 | sub new { | ||||||||||
| 28 | 3 | ▶ | my ($class,$pdf,$key)=@_; | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 29 | 3 | my $self = $class->SUPER::new($pdf,$key); | |||||||||
| 30 | 3 | $self->{Type}=PDFName('ExtGState'); | |||||||||
| 31 | 3 | return($self); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | =item $egs->strokeadjust $boolean | ||||||||||
| 35 | |||||||||||
| 36 | =cut | ||||||||||
| 37 | |||||||||||
| 38 | sub strokeadjust { | ||||||||||
| 39 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
strokeadjust: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 40 | 0 | $self->{SA}=PDFBool($var); | |||||||||
| 41 | 0 | return($self); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | =item $egs->strokeoverprint $boolean | ||||||||||
| 45 | |||||||||||
| 46 | =cut | ||||||||||
| 47 | |||||||||||
| 48 | sub strokeoverprint { | ||||||||||
| 49 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
strokeoverprint: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 50 | 0 | $self->{OP}=PDFBool($var); | |||||||||
| 51 | 0 | return($self); | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | =item $egs->filloverprint $boolean | ||||||||||
| 55 | |||||||||||
| 56 | =cut | ||||||||||
| 57 | |||||||||||
| 58 | sub filloverprint { | ||||||||||
| 59 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
filloverprint: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 60 | 0 | $self->{op}=PDFBool($var); | |||||||||
| 61 | 0 | return($self); | |||||||||
| 62 | } | ||||||||||
| 63 | |||||||||||
| 64 | =item $egs->overprintmode $num | ||||||||||
| 65 | |||||||||||
| 66 | =cut | ||||||||||
| 67 | |||||||||||
| 68 | sub overprintmode { | ||||||||||
| 69 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
overprintmode: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 70 | 0 | $self->{OPM}=PDFNum($var); | |||||||||
| 71 | 0 | return($self); | |||||||||
| 72 | } | ||||||||||
| 73 | |||||||||||
| 74 | =item $egs->blackgeneration $obj | ||||||||||
| 75 | |||||||||||
| 76 | =cut | ||||||||||
| 77 | |||||||||||
| 78 | sub blackgeneration { | ||||||||||
| 79 | 0 | ▶ | my ($self,$obj)=@_; | ||||||||
|
Subroutine
blackgeneration: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 80 | 0 | $self->{BG}=$obj; | |||||||||
| 81 | 0 | return($self); | |||||||||
| 82 | } | ||||||||||
| 83 | |||||||||||
| 84 | =item $egs->blackgeneration2 $obj | ||||||||||
| 85 | |||||||||||
| 86 | =cut | ||||||||||
| 87 | |||||||||||
| 88 | sub blackgeneration2 { | ||||||||||
| 89 | 0 | ▶ | my ($self,$obj)=@_; | ||||||||
|
Subroutine
blackgeneration2: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 90 | 0 | $self->{BG2}=$obj; | |||||||||
| 91 | 0 | return($self); | |||||||||
| 92 | } | ||||||||||
| 93 | |||||||||||
| 94 | =item $egs->undercolorremoval $obj | ||||||||||
| 95 | |||||||||||
| 96 | =cut | ||||||||||
| 97 | |||||||||||
| 98 | sub undercolorremoval { | ||||||||||
| 99 | 0 | ▶ | my ($self,$obj)=@_; | ||||||||
|
Subroutine
undercolorremoval: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 100 | 0 | $self->{UCR}=$obj; | |||||||||
| 101 | 0 | return($self); | |||||||||
| 102 | } | ||||||||||
| 103 | |||||||||||
| 104 | =item $egs->undercolorremoval2 $obj | ||||||||||
| 105 | |||||||||||
| 106 | =cut | ||||||||||
| 107 | |||||||||||
| 108 | sub undercolorremoval2 { | ||||||||||
| 109 | 0 | ▶ | my ($self,$obj)=@_; | ||||||||
|
Subroutine
undercolorremoval2: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 110 | 0 | $self->{UCR2}=$obj; | |||||||||
| 111 | 0 | return($self); | |||||||||
| 112 | } | ||||||||||
| 113 | |||||||||||
| 114 | =item $egs->transfer $obj | ||||||||||
| 115 | |||||||||||
| 116 | =cut | ||||||||||
| 117 | |||||||||||
| 118 | sub transfer { | ||||||||||
| 119 | 0 | ▶ | my ($self,$obj)=@_; | ||||||||
|
Subroutine
transfer: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 120 | 0 | $self->{TR}=$obj; | |||||||||
| 121 | 0 | return($self); | |||||||||
| 122 | } | ||||||||||
| 123 | |||||||||||
| 124 | =item $egs->transfer2 $obj | ||||||||||
| 125 | |||||||||||
| 126 | =cut | ||||||||||
| 127 | |||||||||||
| 128 | sub transfer2 { | ||||||||||
| 129 | 0 | ▶ | my ($self,$obj)=@_; | ||||||||
|
Subroutine
transfer2: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 130 | 0 | $self->{TR2}=$obj; | |||||||||
| 131 | 0 | return($self); | |||||||||
| 132 | } | ||||||||||
| 133 | |||||||||||
| 134 | =item $egs->halftone $obj | ||||||||||
| 135 | |||||||||||
| 136 | =cut | ||||||||||
| 137 | |||||||||||
| 138 | sub halftone { | ||||||||||
| 139 | 0 | ▶ | my ($self,$obj)=@_; | ||||||||
|
Subroutine
halftone: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 140 | 0 | $self->{HT}=$obj; | |||||||||
| 141 | 0 | return($self); | |||||||||
| 142 | } | ||||||||||
| 143 | |||||||||||
| 144 | =item $egs->halftonephase $obj | ||||||||||
| 145 | |||||||||||
| 146 | =cut | ||||||||||
| 147 | |||||||||||
| 148 | # Per RT #113514, this was last present in version 1.2 of the PDF | ||||||||||
| 149 | # spec, so it can probably be removed. | ||||||||||
| 150 | sub halftonephase { | ||||||||||
| 151 | 0 | ▶ | my ($self,$obj)=@_; | ||||||||
|
Subroutine
halftonephase: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 152 | 0 | $self->{HTP}=$obj; | |||||||||
| 153 | 0 | return($self); | |||||||||
| 154 | } | ||||||||||
| 155 | |||||||||||
| 156 | =item $egs->smoothness $num | ||||||||||
| 157 | |||||||||||
| 158 | =cut | ||||||||||
| 159 | |||||||||||
| 160 | sub smoothness { | ||||||||||
| 161 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
smoothness: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 162 | 0 | $self->{SM}=PDFNum($var); | |||||||||
| 163 | 0 | return($self); | |||||||||
| 164 | } | ||||||||||
| 165 | |||||||||||
| 166 | =item $egs->font $font, $size | ||||||||||
| 167 | |||||||||||
| 168 | =cut | ||||||||||
| 169 | |||||||||||
| 170 | sub font { | ||||||||||
| 171 | 0 | ▶ | my ($self,$font,$size)=@_; | ||||||||
|
Subroutine
font: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 172 | 0 | $self->{Font}=PDFArray(PDFName($font->{' apiname'}),PDFNum($size)); | |||||||||
| 173 | 0 | return($self); | |||||||||
| 174 | } | ||||||||||
| 175 | |||||||||||
| 176 | =item $egs->linewidth $size | ||||||||||
| 177 | |||||||||||
| 178 | =cut | ||||||||||
| 179 | |||||||||||
| 180 | sub linewidth { | ||||||||||
| 181 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
linewidth: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 182 | 0 | $self->{LW}=PDFNum($var); | |||||||||
| 183 | 0 | return($self); | |||||||||
| 184 | } | ||||||||||
| 185 | |||||||||||
| 186 | =item $egs->linecap $cap | ||||||||||
| 187 | |||||||||||
| 188 | =cut | ||||||||||
| 189 | |||||||||||
| 190 | sub linecap { | ||||||||||
| 191 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
linecap: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 192 | 0 | $self->{LC}=PDFNum($var); | |||||||||
| 193 | 0 | return($self); | |||||||||
| 194 | } | ||||||||||
| 195 | |||||||||||
| 196 | =item $egs->linejoin $join | ||||||||||
| 197 | |||||||||||
| 198 | =cut | ||||||||||
| 199 | |||||||||||
| 200 | sub linejoin { | ||||||||||
| 201 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
linejoin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 202 | 0 | $self->{LJ}=PDFNum($var); | |||||||||
| 203 | 0 | return($self); | |||||||||
| 204 | } | ||||||||||
| 205 | |||||||||||
| 206 | =item $egs->miterlimit $limit | ||||||||||
| 207 | |||||||||||
| 208 | =cut | ||||||||||
| 209 | |||||||||||
| 210 | sub miterlimit { | ||||||||||
| 211 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
miterlimit: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 212 | 0 | $self->{ML}=PDFNum($var); | |||||||||
| 213 | 0 | return($self); | |||||||||
| 214 | } | ||||||||||
| 215 | |||||||||||
| 216 | # Deprecated: miterlimit was originally named incorrectly | ||||||||||
| 217 | 0 | ▶ | sub meterlimit { return miterlimit(@_) } | ||||||||
|
Subroutine
meterlimit: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 218 | |||||||||||
| 219 | =item $egs->dash @dash | ||||||||||
| 220 | |||||||||||
| 221 | =cut | ||||||||||
| 222 | |||||||||||
| 223 | sub dash { | ||||||||||
| 224 | 1 | ▶ | my ($self,@dash)=@_; | ||||||||
|
Subroutine
dash: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 225 | 1 | $self->{D}=PDFArray(PDFArray( map { PDFNum($_); } @dash), PDFNum(0)); | |||||||||
| 226 | 1 | return($self); | |||||||||
| 227 | } | ||||||||||
| 228 | |||||||||||
| 229 | =item $egs->flatness $flat | ||||||||||
| 230 | |||||||||||
| 231 | =cut | ||||||||||
| 232 | |||||||||||
| 233 | sub flatness { | ||||||||||
| 234 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
flatness: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 235 | 0 | $self->{FL}=PDFNum($var); | |||||||||
| 236 | 0 | return($self); | |||||||||
| 237 | } | ||||||||||
| 238 | |||||||||||
| 239 | =item $egs->renderingintent $intentName | ||||||||||
| 240 | |||||||||||
| 241 | =cut | ||||||||||
| 242 | |||||||||||
| 243 | sub renderingintent { | ||||||||||
| 244 | 1 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
renderingintent: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 245 | 1 | $self->{RI}=PDFName($var); | |||||||||
| 246 | 1 | return($self); | |||||||||
| 247 | } | ||||||||||
| 248 | |||||||||||
| 249 | =item $egs->strokealpha $alpha | ||||||||||
| 250 | |||||||||||
| 251 | The current stroking alpha constant, specifying the | ||||||||||
| 252 | constant shape or constant opacity value to be used | ||||||||||
| 253 | for stroking operations in the transparent imaging model. | ||||||||||
| 254 | |||||||||||
| 255 | =cut | ||||||||||
| 256 | |||||||||||
| 257 | sub strokealpha { | ||||||||||
| 258 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
strokealpha: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 259 | 0 | $self->{CA}=PDFNum($var); | |||||||||
| 260 | 0 | return($self); | |||||||||
| 261 | } | ||||||||||
| 262 | |||||||||||
| 263 | =item $egs->fillalpha $alpha | ||||||||||
| 264 | |||||||||||
| 265 | Same as strokealpha, but for nonstroking operations. | ||||||||||
| 266 | |||||||||||
| 267 | =cut | ||||||||||
| 268 | |||||||||||
| 269 | sub fillalpha { | ||||||||||
| 270 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
fillalpha: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 271 | 0 | $self->{ca}=PDFNum($var); | |||||||||
| 272 | 0 | return($self); | |||||||||
| 273 | } | ||||||||||
| 274 | |||||||||||
| 275 | =item $egs->blendmode $blendname | ||||||||||
| 276 | |||||||||||
| 277 | =item $egs->blendmode $blendfunctionobj | ||||||||||
| 278 | |||||||||||
| 279 | The current blend mode to be used in the transparent | ||||||||||
| 280 | imaging model. | ||||||||||
| 281 | |||||||||||
| 282 | =cut | ||||||||||
| 283 | |||||||||||
| 284 | sub blendmode { | ||||||||||
| 285 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
blendmode: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 286 | 0 | ▶ | if(ref($var)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 287 | 0 | $self->{BM}=$var; | |||||||||
| 288 | } else { | ||||||||||
| 289 | 0 | $self->{BM}=PDFName($var); | |||||||||
| 290 | } | ||||||||||
| 291 | 0 | return($self); | |||||||||
| 292 | } | ||||||||||
| 293 | |||||||||||
| 294 | =item $egs->alphaisshape $boolean | ||||||||||
| 295 | |||||||||||
| 296 | The alpha source flag (alpha is shape), specifying | ||||||||||
| 297 | whether the current soft mask and alpha constant | ||||||||||
| 298 | are to be interpreted as shape values (true) or | ||||||||||
| 299 | opacity values (false). | ||||||||||
| 300 | |||||||||||
| 301 | =cut | ||||||||||
| 302 | |||||||||||
| 303 | sub alphaisshape { | ||||||||||
| 304 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
alphaisshape: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 305 | 0 | $self->{AIS}=PDFBool($var); | |||||||||
| 306 | 0 | return($self); | |||||||||
| 307 | } | ||||||||||
| 308 | |||||||||||
| 309 | =item $egs->textknockout $boolean | ||||||||||
| 310 | |||||||||||
| 311 | The text knockout flag, which determines the behavior | ||||||||||
| 312 | of overlapping glyphs within a text object in the | ||||||||||
| 313 | transparent imaging model. | ||||||||||
| 314 | |||||||||||
| 315 | =cut | ||||||||||
| 316 | |||||||||||
| 317 | sub textknockout { | ||||||||||
| 318 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
textknockout: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 319 | 0 | $self->{TK}=PDFBool($var); | |||||||||
| 320 | 0 | return($self); | |||||||||
| 321 | } | ||||||||||
| 322 | |||||||||||
| 323 | =item $egs->transparency $t | ||||||||||
| 324 | |||||||||||
| 325 | The graphics transparency, with 0 being fully opaque and 1 being fully transparent. | ||||||||||
| 326 | This is a convenience method setting proper values for strokealpha and fillalpha. | ||||||||||
| 327 | |||||||||||
| 328 | =cut | ||||||||||
| 329 | |||||||||||
| 330 | sub transparency { | ||||||||||
| 331 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
transparency: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 332 | 0 | $self->strokealpha(1-$var); | |||||||||
| 333 | 0 | $self->fillalpha(1-$var); | |||||||||
| 334 | 0 | return($self); | |||||||||
| 335 | } | ||||||||||
| 336 | |||||||||||
| 337 | =item $egs->opacity $op | ||||||||||
| 338 | |||||||||||
| 339 | The graphics opacity , with 1 being fully opaque and 0 being fully transparent. | ||||||||||
| 340 | This is a convenience method setting proper values for strokealpha and fillalpha. | ||||||||||
| 341 | |||||||||||
| 342 | =cut | ||||||||||
| 343 | |||||||||||
| 344 | sub opacity { | ||||||||||
| 345 | 0 | ▶ | my ($self,$var)=@_; | ||||||||
|
Subroutine
opacity: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 346 | 0 | $self->strokealpha($var); | |||||||||
| 347 | 0 | $self->fillalpha($var); | |||||||||
| 348 | 0 | return($self); | |||||||||
| 349 | } | ||||||||||
| 350 | |||||||||||
| 351 | =back | ||||||||||
| 352 | |||||||||||
| 353 | =cut | ||||||||||
| 354 | |||||||||||
| 355 | 38 | 1; | |||||||||