Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: experimental/PdfViewer/SkPdfGraphicsStateDictionary_autogen.h

Issue 16975013: Deal with ca and CA transparency operators in pdf. add comments to generated classes. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #ifndef __DEFINED__SkPdfGraphicsStateDictionary 1 #ifndef __DEFINED__SkPdfGraphicsStateDictionary
2 #define __DEFINED__SkPdfGraphicsStateDictionary 2 #define __DEFINED__SkPdfGraphicsStateDictionary
3 3
4 #include "SkPdfEnums_autogen.h" 4 #include "SkPdfEnums_autogen.h"
5 #include "SkPdfArray_autogen.h" 5 #include "SkPdfArray_autogen.h"
6 #include "SkPdfDictionary_autogen.h" 6 #include "SkPdfDictionary_autogen.h"
7 7
8 // Entries in a graphics state parameter dictionary
8 class SkPdfGraphicsStateDictionary : public SkPdfDictionary { 9 class SkPdfGraphicsStateDictionary : public SkPdfDictionary {
9 public: 10 public:
10 virtual SkPdfObjectType getType() const { return kGraphicsStateDictionary_SkPd fObjectType;} 11 virtual SkPdfObjectType getType() const { return kGraphicsStateDictionary_SkPd fObjectType;}
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kGraphic sStateDictionary_SkPdfObjectType + 1);} 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kGraphic sStateDictionary_SkPdfObjectType + 1);}
12 public: 13 public:
13 virtual SkPdfGraphicsStateDictionary* asGraphicsStateDictionary() {return this ;} 14 virtual SkPdfGraphicsStateDictionary* asGraphicsStateDictionary() {return this ;}
14 virtual const SkPdfGraphicsStateDictionary* asGraphicsStateDictionary() const {return this;} 15 virtual const SkPdfGraphicsStateDictionary* asGraphicsStateDictionary() const {return this;}
15 16
16 private: 17 private:
17 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return NULL;} 18 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return NULL;}
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 515
515 public: 516 public:
516 private: 517 private:
517 public: 518 public:
518 SkPdfGraphicsStateDictionary(const PdfMemDocument* podofoDoc = NULL, const Pdf Object* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} 519 SkPdfGraphicsStateDictionary(const PdfMemDocument* podofoDoc = NULL, const Pdf Object* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
519 520
520 virtual bool valid() const {return true;} 521 virtual bool valid() const {return true;}
521 522
522 SkPdfGraphicsStateDictionary& operator=(const SkPdfGraphicsStateDictionary& fr om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret urn *this;} 523 SkPdfGraphicsStateDictionary& operator=(const SkPdfGraphicsStateDictionary& fr om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret urn *this;}
523 524
525 /** (Optional) The type of PDF object that this dictionary describes; must be
526 * ExtGState for a graphics state parameter dictionary.
527 **/
528 bool has_Type() const {
529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type" , "", NULL));
530 }
531
524 std::string Type() const { 532 std::string Type() const {
525 std::string ret; 533 std::string ret;
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret; 534 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret;
527 // TODO(edisonn): warn about missing required field, assert for known good p dfs 535 // TODO(edisonn): warn about missing required field, assert for known good p dfs
528 return ""; 536 return "";
529 } 537 }
530 538
539 /** (Optional; PDF 1.3) The line width (see "Line Width" on page 152).
540 **/
541 bool has_LW() const {
542 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LW", "", NULL));
543 }
544
531 double LW() const { 545 double LW() const {
532 double ret; 546 double ret;
533 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LW", "", &ret)) return ret; 547 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LW", "", &ret)) return ret;
534 // TODO(edisonn): warn about missing required field, assert for known good p dfs 548 // TODO(edisonn): warn about missing required field, assert for known good p dfs
535 return 0; 549 return 0;
536 } 550 }
537 551
552 /** (Optional; PDF 1.3) The line cap style (see "Line Cap Style" on page 153).
553 **/
554 bool has_LC() const {
555 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LC", "", NULL));
556 }
557
538 long LC() const { 558 long LC() const {
539 long ret; 559 long ret;
540 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LC", "", &r et)) return ret; 560 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LC", "", &r et)) return ret;
541 // TODO(edisonn): warn about missing required field, assert for known good p dfs 561 // TODO(edisonn): warn about missing required field, assert for known good p dfs
542 return 0; 562 return 0;
543 } 563 }
544 564
565 /** (Optional; PDF 1.3) The line join style (see "Line Join Style" on page 153).
566 **/
567 bool has_LJ() const {
568 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LJ", "", NULL));
569 }
570
545 long LJ() const { 571 long LJ() const {
546 long ret; 572 long ret;
547 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LJ", "", &r et)) return ret; 573 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LJ", "", &r et)) return ret;
548 // TODO(edisonn): warn about missing required field, assert for known good p dfs 574 // TODO(edisonn): warn about missing required field, assert for known good p dfs
549 return 0; 575 return 0;
550 } 576 }
551 577
578 /** (Optional; PDF 1.3) The miter limit (see "Miter Limit" on page 153).
579 **/
580 bool has_ML() const {
581 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ML", "", NULL));
582 }
583
552 double ML() const { 584 double ML() const {
553 double ret; 585 double ret;
554 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ML", "", &ret)) return ret; 586 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ML", "", &ret)) return ret;
555 // TODO(edisonn): warn about missing required field, assert for known good p dfs 587 // TODO(edisonn): warn about missing required field, assert for known good p dfs
556 return 0; 588 return 0;
557 } 589 }
558 590
591 /** (Optional; PDF 1.3) The line dash pattern, expressed as an array of the form
592 * [dashArray dashPhase], where dashArray is itself an array and dashPhase is a n
593 * integer (see "Line Dash Pattern" on page 155).
594 **/
595 bool has_D() const {
596 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", " ", NULL));
597 }
598
559 SkPdfArray D() const { 599 SkPdfArray D() const {
560 SkPdfArray ret; 600 SkPdfArray ret;
561 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &r et)) return ret; 601 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &r et)) return ret;
562 // TODO(edisonn): warn about missing required field, assert for known good p dfs 602 // TODO(edisonn): warn about missing required field, assert for known good p dfs
563 return SkPdfArray(); 603 return SkPdfArray();
564 } 604 }
565 605
606 /** (Optional; PDF 1.3) The name of the rendering intent (see "Rendering
607 * Intents" on page 197).
608 **/
609 bool has_RI() const {
610 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "RI", "", NULL));
611 }
612
566 std::string RI() const { 613 std::string RI() const {
567 std::string ret; 614 std::string ret;
568 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "RI", "", &r et)) return ret; 615 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "RI", "", &r et)) return ret;
569 // TODO(edisonn): warn about missing required field, assert for known good p dfs 616 // TODO(edisonn): warn about missing required field, assert for known good p dfs
570 return ""; 617 return "";
571 } 618 }
572 619
620 /** (Optional) A flag specifying whether to apply overprint (see Section 4.5.6,
621 * "Overprint Control"). In PDF 1.2 and earlier, there is a single overprint
622 * parameter that applies to all painting operations. Beginning with PDF 1.3,
623 * there are two separate overprint parameters: one for stroking and one for al l
624 * other painting operations. Specifying an OP entry sets both parameters un-
625 * less there is also an op entry in the same graphics state parameter dictiona ry,
626 * in which case the OP entry sets only the overprint parameter for stroking.
627 **/
628 bool has_OP() const {
629 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OP", "", NULL));
630 }
631
573 bool OP() const { 632 bool OP() const {
574 bool ret; 633 bool ret;
575 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OP", "", &r et)) return ret; 634 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OP", "", &r et)) return ret;
576 // TODO(edisonn): warn about missing required field, assert for known good p dfs 635 // TODO(edisonn): warn about missing required field, assert for known good p dfs
577 return false; 636 return false;
578 } 637 }
579 638
639 /** (Optional; PDF 1.3) A flag specifying whether to apply overprint (see Sectio n
640 * 4.5.6, "Overprint Control") for painting operations other than stroking. If
641 * this entry is absent, the OP entry, if any, sets this parameter.
642 **/
643 bool has_op() const {
644 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "op", "", NULL));
645 }
646
580 bool op() const { 647 bool op() const {
581 bool ret; 648 bool ret;
582 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "op", "", &r et)) return ret; 649 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "op", "", &r et)) return ret;
583 // TODO(edisonn): warn about missing required field, assert for known good p dfs 650 // TODO(edisonn): warn about missing required field, assert for known good p dfs
584 return false; 651 return false;
585 } 652 }
586 653
654 /** (Optional; PDF 1.3) The overprint mode (see Section 4.5.6, "Overprint Con-
655 * trol").
656 **/
657 bool has_OPM() const {
658 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OPM", "", NULL));
659 }
660
587 long OPM() const { 661 long OPM() const {
588 long ret; 662 long ret;
589 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OPM", "", & ret)) return ret; 663 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OPM", "", & ret)) return ret;
590 // TODO(edisonn): warn about missing required field, assert for known good p dfs 664 // TODO(edisonn): warn about missing required field, assert for known good p dfs
591 return 0; 665 return 0;
592 } 666 }
593 667
668 /** (Optional; PDF 1.3) An array of the form [font size], where font is an indir ect
669 * reference to a font dictionary and size is a number expressed in text space
670 * units. These two objects correspond to the operands of the Tf operator (see
671 * Section 5.2, "Text State Parameters and Operators"); however, the first oper -
672 * and is an indirect object reference instead of a resource name.
673 **/
674 bool has_Font() const {
675 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Font" , "", NULL));
676 }
677
594 SkPdfArray Font() const { 678 SkPdfArray Font() const {
595 SkPdfArray ret; 679 SkPdfArray ret;
596 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Font", "", &ret)) return ret; 680 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Font", "", &ret)) return ret;
597 // TODO(edisonn): warn about missing required field, assert for known good p dfs 681 // TODO(edisonn): warn about missing required field, assert for known good p dfs
598 return SkPdfArray(); 682 return SkPdfArray();
599 } 683 }
600 684
685 /** (Optional) The black-generation function, which maps the interval [0.0 1.0]
686 * to the interval [0.0 1.0] (see Section 6.2.3, "Conversion from DeviceRGB to
687 * DeviceCMYK").
688 **/
689 bool has_BG() const {
690 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG", "", NULL));
691 }
692
601 SkPdfFunction BG() const { 693 SkPdfFunction BG() const {
602 SkPdfFunction ret; 694 SkPdfFunction ret;
603 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG", "" , &ret)) return ret; 695 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG", "" , &ret)) return ret;
604 // TODO(edisonn): warn about missing required field, assert for known good p dfs 696 // TODO(edisonn): warn about missing required field, assert for known good p dfs
605 return SkPdfFunction(); 697 return SkPdfFunction();
606 } 698 }
607 699
700 /** (Optional; PDF 1.3) Same as BG except that the value may also be the name
701 * Default, denoting the black-generation function that was in effect at the st art
702 * of the page. If both BG and BG2 are present in the same graphics state param -
703 * eter dictionary, BG2 takes precedence.
704 **/
705 bool has_BG2() const {
706 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", "", NULL));
707 }
708
608 bool isBG2AFunction() const { 709 bool isBG2AFunction() const {
609 SkPdfObject* ret = NULL; 710 SkPdfObject* ret = NULL;
610 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", "" , &ret)) return false; 711 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", "" , &ret)) return false;
611 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 712 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
612 } 713 }
613 714
614 SkPdfFunction getBG2AsFunction() const { 715 SkPdfFunction getBG2AsFunction() const {
615 SkPdfFunction ret = SkPdfFunction(); 716 SkPdfFunction ret = SkPdfFunction();
616 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", " ", &ret)) return ret; 717 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", " ", &ret)) return ret;
617 // TODO(edisonn): warn about missing required field, assert for known good p dfs 718 // TODO(edisonn): warn about missing required field, assert for known good p dfs
618 return SkPdfFunction(); 719 return SkPdfFunction();
619 } 720 }
620 721
621 bool isBG2AName() const { 722 bool isBG2AName() const {
622 SkPdfObject* ret = NULL; 723 SkPdfObject* ret = NULL;
623 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", "" , &ret)) return false; 724 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", "" , &ret)) return false;
624 return ret->podofo()->GetDataType() == ePdfDataType_Name; 725 return ret->podofo()->GetDataType() == ePdfDataType_Name;
625 } 726 }
626 727
627 std::string getBG2AsName() const { 728 std::string getBG2AsName() const {
628 std::string ret = ""; 729 std::string ret = "";
629 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", "", & ret)) return ret; 730 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG2", "", & ret)) return ret;
630 // TODO(edisonn): warn about missing required field, assert for known good p dfs 731 // TODO(edisonn): warn about missing required field, assert for known good p dfs
631 return ""; 732 return "";
632 } 733 }
633 734
735 /** (Optional) The undercolor-removal function, which maps the interval
736 * [0.0 1.0] to the interval [-1.0 1.0] (see Section 6.2.3, "Conversion from
737 * DeviceRGB to DeviceCMYK").
738 **/
739 bool has_UCR() const {
740 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR", "", NULL));
741 }
742
634 SkPdfFunction UCR() const { 743 SkPdfFunction UCR() const {
635 SkPdfFunction ret; 744 SkPdfFunction ret;
636 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR", " ", &ret)) return ret; 745 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR", " ", &ret)) return ret;
637 // TODO(edisonn): warn about missing required field, assert for known good p dfs 746 // TODO(edisonn): warn about missing required field, assert for known good p dfs
638 return SkPdfFunction(); 747 return SkPdfFunction();
639 } 748 }
640 749
750 /** (Optional; PDF 1.3) Same as UCR except that the value may also be the name
751 * Default, denoting the undercolor-removal function that was in effect at the
752 * start of the page. If both UCR and UCR2 are present in the same graphics sta te
753 * parameter dictionary, UCR2 takes precedence.
754 **/
755 bool has_UCR2() const {
756 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2" , "", NULL));
757 }
758
641 bool isUCR2AFunction() const { 759 bool isUCR2AFunction() const {
642 SkPdfObject* ret = NULL; 760 SkPdfObject* ret = NULL;
643 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2", " ", &ret)) return false; 761 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2", " ", &ret)) return false;
644 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 762 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
645 } 763 }
646 764
647 SkPdfFunction getUCR2AsFunction() const { 765 SkPdfFunction getUCR2AsFunction() const {
648 SkPdfFunction ret = SkPdfFunction(); 766 SkPdfFunction ret = SkPdfFunction();
649 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2", "", &ret)) return ret; 767 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2", "", &ret)) return ret;
650 // TODO(edisonn): warn about missing required field, assert for known good p dfs 768 // TODO(edisonn): warn about missing required field, assert for known good p dfs
651 return SkPdfFunction(); 769 return SkPdfFunction();
652 } 770 }
653 771
654 bool isUCR2AName() const { 772 bool isUCR2AName() const {
655 SkPdfObject* ret = NULL; 773 SkPdfObject* ret = NULL;
656 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2", " ", &ret)) return false; 774 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2", " ", &ret)) return false;
657 return ret->podofo()->GetDataType() == ePdfDataType_Name; 775 return ret->podofo()->GetDataType() == ePdfDataType_Name;
658 } 776 }
659 777
660 std::string getUCR2AsName() const { 778 std::string getUCR2AsName() const {
661 std::string ret = ""; 779 std::string ret = "";
662 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2", "", &ret)) return ret; 780 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "UCR2", "", &ret)) return ret;
663 // TODO(edisonn): warn about missing required field, assert for known good p dfs 781 // TODO(edisonn): warn about missing required field, assert for known good p dfs
664 return ""; 782 return "";
665 } 783 }
666 784
785 /** (Optional) The transfer function, which maps the interval [0.0 1.0] to the
786 * interval [0.0 1.0] (see Section 6.3, "Transfer Functions"). The value is eit her
787 * a single function (which applies to all process colorants) or an array of fo ur
788 * functions (which apply to the process colorants individually). The name
789 * Identity may be used to represent the identity function.
790 **/
791 bool has_TR() const {
792 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "", NULL));
793 }
794
667 bool isTRAFunction() const { 795 bool isTRAFunction() const {
668 SkPdfObject* ret = NULL; 796 SkPdfObject* ret = NULL;
669 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "", &ret)) return false; 797 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "", &ret)) return false;
670 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 798 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
671 } 799 }
672 800
673 SkPdfFunction getTRAsFunction() const { 801 SkPdfFunction getTRAsFunction() const {
674 SkPdfFunction ret = SkPdfFunction(); 802 SkPdfFunction ret = SkPdfFunction();
675 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "" , &ret)) return ret; 803 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "" , &ret)) return ret;
676 // TODO(edisonn): warn about missing required field, assert for known good p dfs 804 // TODO(edisonn): warn about missing required field, assert for known good p dfs
(...skipping 19 matching lines...) Expand all
696 return ret->podofo()->GetDataType() == ePdfDataType_Name; 824 return ret->podofo()->GetDataType() == ePdfDataType_Name;
697 } 825 }
698 826
699 std::string getTRAsName() const { 827 std::string getTRAsName() const {
700 std::string ret = ""; 828 std::string ret = "";
701 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "", &r et)) return ret; 829 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "", &r et)) return ret;
702 // TODO(edisonn): warn about missing required field, assert for known good p dfs 830 // TODO(edisonn): warn about missing required field, assert for known good p dfs
703 return ""; 831 return "";
704 } 832 }
705 833
834 /** (Optional; PDF 1.3) Same as TR except that the value may also be the name
835 * Default, denoting the transfer function that was in effect at the start of t he
836 * page. If both TR and TR2 are present in the same graphics state parameter di c-
837 * tionary, TR2 takes precedence.
838 **/
839 bool has_TR2() const {
840 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR2", "", NULL));
841 }
842
706 bool isTR2AFunction() const { 843 bool isTR2AFunction() const {
707 SkPdfObject* ret = NULL; 844 SkPdfObject* ret = NULL;
708 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR2", "" , &ret)) return false; 845 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR2", "" , &ret)) return false;
709 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 846 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
710 } 847 }
711 848
712 SkPdfFunction getTR2AsFunction() const { 849 SkPdfFunction getTR2AsFunction() const {
713 SkPdfFunction ret = SkPdfFunction(); 850 SkPdfFunction ret = SkPdfFunction();
714 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR2", " ", &ret)) return ret; 851 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR2", " ", &ret)) return ret;
715 // TODO(edisonn): warn about missing required field, assert for known good p dfs 852 // TODO(edisonn): warn about missing required field, assert for known good p dfs
(...skipping 19 matching lines...) Expand all
735 return ret->podofo()->GetDataType() == ePdfDataType_Name; 872 return ret->podofo()->GetDataType() == ePdfDataType_Name;
736 } 873 }
737 874
738 std::string getTR2AsName() const { 875 std::string getTR2AsName() const {
739 std::string ret = ""; 876 std::string ret = "";
740 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR2", "", & ret)) return ret; 877 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR2", "", & ret)) return ret;
741 // TODO(edisonn): warn about missing required field, assert for known good p dfs 878 // TODO(edisonn): warn about missing required field, assert for known good p dfs
742 return ""; 879 return "";
743 } 880 }
744 881
882 /** (Optional) The halftone dictionary or stream (see Section 6.4, "Halftones")
883 * or the name Default, denoting the halftone that was in effect at the start o f the
884 * page.
885 **/
886 bool has_HT() const {
887 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HT", "", NULL));
888 }
889
745 bool isHTADictionary() const { 890 bool isHTADictionary() const {
746 SkPdfObject* ret = NULL; 891 SkPdfObject* ret = NULL;
747 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HT", "", &ret)) return false; 892 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HT", "", &ret)) return false;
748 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; 893 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary;
749 } 894 }
750 895
751 SkPdfDictionary* getHTAsDictionary() const { 896 SkPdfDictionary* getHTAsDictionary() const {
752 SkPdfDictionary* ret = NULL; 897 SkPdfDictionary* ret = NULL;
753 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HT", "", &ret)) return ret; 898 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HT", "", &ret)) return ret;
754 // TODO(edisonn): warn about missing required field, assert for known good p dfs 899 // TODO(edisonn): warn about missing required field, assert for known good p dfs
(...skipping 19 matching lines...) Expand all
774 return ret->podofo()->GetDataType() == ePdfDataType_Name; 919 return ret->podofo()->GetDataType() == ePdfDataType_Name;
775 } 920 }
776 921
777 std::string getHTAsName() const { 922 std::string getHTAsName() const {
778 std::string ret = ""; 923 std::string ret = "";
779 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HT", "", &r et)) return ret; 924 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HT", "", &r et)) return ret;
780 // TODO(edisonn): warn about missing required field, assert for known good p dfs 925 // TODO(edisonn): warn about missing required field, assert for known good p dfs
781 return ""; 926 return "";
782 } 927 }
783 928
929 /** (Optional; PDF 1.3) The flatness tolerance (see Section 6.5.1, "Flatness Tol er-
930 * ance").
931 **/
932 bool has_FL() const {
933 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FL", "", NULL));
934 }
935
784 double FL() const { 936 double FL() const {
785 double ret; 937 double ret;
786 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FL", "", &ret)) return ret; 938 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FL", "", &ret)) return ret;
787 // TODO(edisonn): warn about missing required field, assert for known good p dfs 939 // TODO(edisonn): warn about missing required field, assert for known good p dfs
788 return 0; 940 return 0;
789 } 941 }
790 942
943 /** (Optional; PDF 1.3) The smoothness tolerance (see Section 6.5.2, "Smooth-
944 * ness Tolerance").
945 **/
946 bool has_SM() const {
947 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SM", "", NULL));
948 }
949
791 double SM() const { 950 double SM() const {
792 double ret; 951 double ret;
793 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SM", "", &ret)) return ret; 952 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SM", "", &ret)) return ret;
794 // TODO(edisonn): warn about missing required field, assert for known good p dfs 953 // TODO(edisonn): warn about missing required field, assert for known good p dfs
795 return 0; 954 return 0;
796 } 955 }
797 956
957 /** (Optional) A flag specifying whether to apply automatic stroke adjustment
958 * (see Section 6.5.4, "Automatic Stroke Adjustment").
959 **/
960 bool has_SA() const {
961 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SA", "", NULL));
962 }
963
798 bool SA() const { 964 bool SA() const {
799 bool ret; 965 bool ret;
800 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SA", "", &r et)) return ret; 966 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SA", "", &r et)) return ret;
801 // TODO(edisonn): warn about missing required field, assert for known good p dfs 967 // TODO(edisonn): warn about missing required field, assert for known good p dfs
802 return false; 968 return false;
803 } 969 }
804 970
971 /** (Optional; PDF 1.4) The current blend mode to be used in the transparent
972 * imaging model (see Sections 7.2.4, "Blend Mode," and 7.5.2, "Specifying
973 * Blending Color Space and Blend Mode").
974 **/
975 bool has_BM() const {
976 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", NULL));
977 }
978
805 bool isBMAName() const { 979 bool isBMAName() const {
806 SkPdfObject* ret = NULL; 980 SkPdfObject* ret = NULL;
807 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", &ret)) return false; 981 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", &ret)) return false;
808 return ret->podofo()->GetDataType() == ePdfDataType_Name; 982 return ret->podofo()->GetDataType() == ePdfDataType_Name;
809 } 983 }
810 984
811 std::string getBMAsName() const { 985 std::string getBMAsName() const {
812 std::string ret = ""; 986 std::string ret = "";
813 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", &r et)) return ret; 987 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", &r et)) return ret;
814 // TODO(edisonn): warn about missing required field, assert for known good p dfs 988 // TODO(edisonn): warn about missing required field, assert for known good p dfs
815 return ""; 989 return "";
816 } 990 }
817 991
818 bool isBMAArray() const { 992 bool isBMAArray() const {
819 SkPdfObject* ret = NULL; 993 SkPdfObject* ret = NULL;
820 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", &ret)) return false; 994 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", &ret)) return false;
821 return ret->podofo()->GetDataType() == ePdfDataType_Array; 995 return ret->podofo()->GetDataType() == ePdfDataType_Array;
822 } 996 }
823 997
824 SkPdfArray getBMAsArray() const { 998 SkPdfArray getBMAsArray() const {
825 SkPdfArray ret = SkPdfArray(); 999 SkPdfArray ret = SkPdfArray();
826 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", & ret)) return ret; 1000 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", & ret)) return ret;
827 // TODO(edisonn): warn about missing required field, assert for known good p dfs 1001 // TODO(edisonn): warn about missing required field, assert for known good p dfs
828 return SkPdfArray(); 1002 return SkPdfArray();
829 } 1003 }
830 1004
1005 /** (Optional; PDF 1.4) The current soft mask, specifying the mask shape or
1006 * mask opacity values to be used in the transparent imaging model (see
1007 * "Source Shape and Opacity" on page 421 and "Mask Shape and Opacity" on
1008 * page 443).
1009 * Note: Although the current soft mask is sometimes referred to as a "soft cli p,"
1010 * altering it with the gs operator completely replaces the old value with the new
1011 * one, rather than intersecting the two as is done with the current clipping p ath
1012 * parameter (see Section 4.4.3, "Clipping Path Operators").
1013 **/
1014 bool has_SMask() const {
1015 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask ", "", NULL));
1016 }
1017
831 bool isSMaskADictionary() const { 1018 bool isSMaskADictionary() const {
832 SkPdfObject* ret = NULL; 1019 SkPdfObject* ret = NULL;
833 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", "", &ret)) return false; 1020 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", "", &ret)) return false;
834 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; 1021 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary;
835 } 1022 }
836 1023
837 SkPdfDictionary* getSMaskAsDictionary() const { 1024 SkPdfDictionary* getSMaskAsDictionary() const {
838 SkPdfDictionary* ret = NULL; 1025 SkPdfDictionary* ret = NULL;
839 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask ", "", &ret)) return ret; 1026 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask ", "", &ret)) return ret;
840 // TODO(edisonn): warn about missing required field, assert for known good p dfs 1027 // TODO(edisonn): warn about missing required field, assert for known good p dfs
841 return NULL; 1028 return NULL;
842 } 1029 }
843 1030
844 bool isSMaskAName() const { 1031 bool isSMaskAName() const {
845 SkPdfObject* ret = NULL; 1032 SkPdfObject* ret = NULL;
846 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", "", &ret)) return false; 1033 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", "", &ret)) return false;
847 return ret->podofo()->GetDataType() == ePdfDataType_Name; 1034 return ret->podofo()->GetDataType() == ePdfDataType_Name;
848 } 1035 }
849 1036
850 std::string getSMaskAsName() const { 1037 std::string getSMaskAsName() const {
851 std::string ret = ""; 1038 std::string ret = "";
852 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", "", &ret)) return ret; 1039 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", "", &ret)) return ret;
853 // TODO(edisonn): warn about missing required field, assert for known good p dfs 1040 // TODO(edisonn): warn about missing required field, assert for known good p dfs
854 return ""; 1041 return "";
855 } 1042 }
856 1043
1044 /** (Optional; PDF 1.4) The current stroking alpha constant, specifying the con-
1045 * stant shape or constant opacity value to be used for stroking operations in the
1046 * transparent imaging model (see "Source Shape and Opacity" on page 421
1047 * and "Constant Shape and Opacity" on page 444).
1048 **/
1049 bool has_CA() const {
1050 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CA", "", NULL));
1051 }
1052
857 double CA() const { 1053 double CA() const {
858 double ret; 1054 double ret;
859 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CA", "", &ret)) return ret; 1055 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CA", "", &ret)) return ret;
860 // TODO(edisonn): warn about missing required field, assert for known good p dfs 1056 // TODO(edisonn): warn about missing required field, assert for known good p dfs
861 return 0; 1057 return 0;
862 } 1058 }
863 1059
1060 /** (Optional; PDF 1.4) Same as CA, but for nonstroking operations.
1061 **/
1062 bool has_ca() const {
1063 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ca", "", NULL));
1064 }
1065
864 double ca() const { 1066 double ca() const {
865 double ret; 1067 double ret;
866 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ca", "", &ret)) return ret; 1068 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ca", "", &ret)) return ret;
867 // TODO(edisonn): warn about missing required field, assert for known good p dfs 1069 // TODO(edisonn): warn about missing required field, assert for known good p dfs
868 return 0; 1070 return 0;
869 } 1071 }
870 1072
1073 /** (Optional; PDF 1.4) The alpha source flag ("alpha is shape"), specifying
1074 * whether the current soft mask and alpha constant are to be interpreted as
1075 * shape values (true) or opacity values (false).
1076 **/
1077 bool has_AIS() const {
1078 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AIS", "", NULL));
1079 }
1080
871 bool AIS() const { 1081 bool AIS() const {
872 bool ret; 1082 bool ret;
873 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AIS", "", & ret)) return ret; 1083 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AIS", "", & ret)) return ret;
874 // TODO(edisonn): warn about missing required field, assert for known good p dfs 1084 // TODO(edisonn): warn about missing required field, assert for known good p dfs
875 return false; 1085 return false;
876 } 1086 }
877 1087
1088 /** (Optional; PDF 1.4) The text knockout flag, which determines the behavior
1089 * of overlapping glyphs within a text object in the transparent imaging model
1090 * (see Section 5.2.7, "Text Knockout").
1091 **/
1092 bool has_TK() const {
1093 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TK", "", NULL));
1094 }
1095
878 bool TK() const { 1096 bool TK() const {
879 bool ret; 1097 bool ret;
880 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TK", "", &r et)) return ret; 1098 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TK", "", &r et)) return ret;
881 // TODO(edisonn): warn about missing required field, assert for known good p dfs 1099 // TODO(edisonn): warn about missing required field, assert for known good p dfs
882 return false; 1100 return false;
883 } 1101 }
884 1102
885 }; 1103 };
886 1104
887 #endif // __DEFINED__SkPdfGraphicsStateDictionary 1105 #endif // __DEFINED__SkPdfGraphicsStateDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698