OLD | NEW |
1 #ifndef __DEFINED__SkPdfType6HalftoneDictionary | 1 #ifndef __DEFINED__SkPdfType6HalftoneDictionary |
2 #define __DEFINED__SkPdfType6HalftoneDictionary | 2 #define __DEFINED__SkPdfType6HalftoneDictionary |
3 | 3 |
4 #include "SkPdfUtils.h" | 4 #include "SkPdfUtils.h" |
5 #include "SkPdfEnums_autogen.h" | 5 #include "SkPdfEnums_autogen.h" |
6 #include "SkPdfArray_autogen.h" | 6 #include "SkPdfArray_autogen.h" |
7 #include "SkPdfDictionary_autogen.h" | 7 #include "SkPdfDictionary_autogen.h" |
8 | 8 |
9 // Additional entries specific to a type 6 halftone dictionary | 9 // Additional entries specific to a type 6 halftone dictionary |
10 class SkPdfType6HalftoneDictionary : public SkPdfDictionary { | 10 class SkPdfType6HalftoneDictionary : public SkPdfDictionary { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 SkPdfType6HalftoneDictionary& operator=(const SkPdfType6HalftoneDictionary& fr
om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret
urn *this;} | 526 SkPdfType6HalftoneDictionary& operator=(const SkPdfType6HalftoneDictionary& fr
om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret
urn *this;} |
527 | 527 |
528 /** (Optional) The type of PDF object that this dictionary describes; if | 528 /** (Optional) The type of PDF object that this dictionary describes; if |
529 * present, must be Halftone for a halftone dictionary. | 529 * present, must be Halftone for a halftone dictionary. |
530 **/ | 530 **/ |
531 bool has_Type() const { | 531 bool has_Type() const { |
532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); | 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
533 } | 533 } |
534 | 534 |
535 std::string Type() const { | 535 std::string Type() const; |
536 std::string ret; | |
537 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | |
538 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
539 return ""; | |
540 } | |
541 | |
542 /** (Required) A code identifying the halftone type that this dictionary | 536 /** (Required) A code identifying the halftone type that this dictionary |
543 * describes; must be 6 for this type of halftone. | 537 * describes; must be 6 for this type of halftone. |
544 **/ | 538 **/ |
545 bool has_HalftoneType() const { | 539 bool has_HalftoneType() const { |
546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneType", "", NULL)); | 540 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneType", "", NULL)); |
547 } | 541 } |
548 | 542 |
549 long HalftoneType() const { | 543 long HalftoneType() const; |
550 long ret; | |
551 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneTyp
e", "", &ret)) return ret; | |
552 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
553 return 0; | |
554 } | |
555 | |
556 /** (Optional) The name of the halftone dictionary. | 544 /** (Optional) The name of the halftone dictionary. |
557 **/ | 545 **/ |
558 bool has_HalftoneName() const { | 546 bool has_HalftoneName() const { |
559 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneName", "", NULL)); | 547 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneName", "", NULL)); |
560 } | 548 } |
561 | 549 |
562 std::string HalftoneName() const { | 550 std::string HalftoneName() const; |
563 std::string ret; | |
564 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneN
ame", "", &ret)) return ret; | |
565 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
566 return ""; | |
567 } | |
568 | |
569 /** (Required) The width of the threshold array, in device pixels. | 551 /** (Required) The width of the threshold array, in device pixels. |
570 **/ | 552 **/ |
571 bool has_Width() const { | 553 bool has_Width() const { |
572 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width
", "", NULL)); | 554 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width
", "", NULL)); |
573 } | 555 } |
574 | 556 |
575 long Width() const { | 557 long Width() const; |
576 long ret; | |
577 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width", "",
&ret)) return ret; | |
578 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
579 return 0; | |
580 } | |
581 | |
582 /** (Required) The height of the threshold array, in device pixels. | 558 /** (Required) The height of the threshold array, in device pixels. |
583 **/ | 559 **/ |
584 bool has_Height() const { | 560 bool has_Height() const { |
585 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Heigh
t", "", NULL)); | 561 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Heigh
t", "", NULL)); |
586 } | 562 } |
587 | 563 |
588 long Height() const { | 564 long Height() const; |
589 long ret; | |
590 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Height", ""
, &ret)) return ret; | |
591 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
592 return 0; | |
593 } | |
594 | |
595 /** (Optional) A transfer function, which overrides the current transfer | 565 /** (Optional) A transfer function, which overrides the current transfer |
596 * function in the graphics state for the same component. This entry is | 566 * function in the graphics state for the same component. This entry is |
597 * required if the dictionary is a component of a type 5 halftone (see | 567 * required if the dictionary is a component of a type 5 halftone (see |
598 * "Type 5 Halftones" on page 400) and represents either a nonprimary | 568 * "Type 5 Halftones" on page 400) and represents either a nonprimary |
599 * or nonstandard primary color component (see Section 6.3, "Transfer | 569 * or nonstandard primary color component (see Section 6.3, "Transfer |
600 * Functions"). The name Identity may be used to specify the identity | 570 * Functions"). The name Identity may be used to specify the identity |
601 * function. | 571 * function. |
602 **/ | 572 **/ |
603 bool has_TransferFunction() const { | 573 bool has_TransferFunction() const { |
604 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans
ferFunction", "", NULL)); | 574 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans
ferFunction", "", NULL)); |
605 } | 575 } |
606 | 576 |
607 bool isTransferFunctionAFunction() const { | 577 bool isTransferFunctionAFunction() const { |
608 SkPdfObject* ret = NULL; | 578 SkPdfObject* ret = NULL; |
609 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer
Function", "", &ret)) return false; | 579 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer
Function", "", &ret)) return false; |
610 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 580 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
611 } | 581 } |
612 | 582 |
613 SkPdfFunction getTransferFunctionAsFunction() const { | 583 SkPdfFunction getTransferFunctionAsFunction() const; |
614 SkPdfFunction ret = SkPdfFunction(); | |
615 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfe
rFunction", "", &ret)) return ret; | |
616 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
617 return SkPdfFunction(); | |
618 } | |
619 | |
620 bool isTransferFunctionAName() const { | 584 bool isTransferFunctionAName() const { |
621 SkPdfObject* ret = NULL; | 585 SkPdfObject* ret = NULL; |
622 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer
Function", "", &ret)) return false; | 586 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer
Function", "", &ret)) return false; |
623 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 587 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
624 } | 588 } |
625 | 589 |
626 std::string getTransferFunctionAsName() const { | 590 std::string getTransferFunctionAsName() const; |
627 std::string ret = ""; | |
628 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TransferFun
ction", "", &ret)) return ret; | |
629 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
630 return ""; | |
631 } | |
632 | |
633 }; | 591 }; |
634 | 592 |
635 #endif // __DEFINED__SkPdfType6HalftoneDictionary | 593 #endif // __DEFINED__SkPdfType6HalftoneDictionary |
OLD | NEW |