Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| ThreeDLightingScheme | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toPdf | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Pdf\Core\ThreeD; |
| 6 | |
| 7 | use Phpdftk\Pdf\Core\PdfDictionary; |
| 8 | use Phpdftk\Pdf\Core\PdfName; |
| 9 | use Phpdftk\Pdf\Core\PdfObject; |
| 10 | use Phpdftk\Pdf\Core\PdfVersion; |
| 11 | use Phpdftk\Pdf\Core\RequiresPdfVersion; |
| 12 | |
| 13 | /** |
| 14 | * 3D lighting scheme dictionary (/Type /3DLightingScheme) — |
| 15 | * ISO 32000-2 §13.6.7. |
| 16 | * |
| 17 | * Subtype is one of the preset schemes: Artwork, None, White, Day, Night, |
| 18 | * Hard, Primary, Blue, Red, Cube, CAD, Headlamp. |
| 19 | */ |
| 20 | #[RequiresPdfVersion(PdfVersion::V1_6)] |
| 21 | class ThreeDLightingScheme extends PdfObject |
| 22 | { |
| 23 | public const PDF_TYPE = '3DLightingScheme'; |
| 24 | |
| 25 | public PdfName $subtype; |
| 26 | |
| 27 | public function __construct(string $subtype = 'Artwork') |
| 28 | { |
| 29 | $this->subtype = new PdfName($subtype); |
| 30 | } |
| 31 | |
| 32 | public function toPdf(): string |
| 33 | { |
| 34 | $dict = new PdfDictionary(); |
| 35 | $dict->set('Type', new PdfName(self::PDF_TYPE)); |
| 36 | $dict->set('Subtype', $this->subtype); |
| 37 | return $dict->toPdf(); |
| 38 | } |
| 39 | } |