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

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfType1HalftoneDictionary_autogen.h

Issue 17856004: refactoring for pdf viewer lib (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__SkPdfType1HalftoneDictionary 1 #ifndef __DEFINED__SkPdfType1HalftoneDictionary
2 #define __DEFINED__SkPdfType1HalftoneDictionary 2 #define __DEFINED__SkPdfType1HalftoneDictionary
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 // Entries in a type 1 halftone dictionary 9 // Entries in a type 1 halftone dictionary
10 class SkPdfType1HalftoneDictionary : public SkPdfDictionary { 10 class SkPdfType1HalftoneDictionary : public SkPdfDictionary {
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 SkPdfType1HalftoneDictionary& operator=(const SkPdfType1HalftoneDictionary& fr om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret urn *this;} 526 SkPdfType1HalftoneDictionary& operator=(const SkPdfType1HalftoneDictionary& 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 1 for this type of halftone. 537 * describes; must be 1 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 screen frequency, measured in halftone cells per inch in 551 /** (Required) The screen frequency, measured in halftone cells per inch in
570 * device space. 552 * device space.
571 **/ 553 **/
572 bool has_Frequency() const { 554 bool has_Frequency() const {
573 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Frequ ency", "", NULL)); 555 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Frequ ency", "", NULL));
574 } 556 }
575 557
576 double Frequency() const { 558 double Frequency() const;
577 double ret;
578 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Frequency ", "", &ret)) return ret;
579 // TODO(edisonn): warn about missing required field, assert for known good p dfs
580 return 0;
581 }
582
583 /** (Required) The screen angle, in degrees of rotation counterclockwise 559 /** (Required) The screen angle, in degrees of rotation counterclockwise
584 * with respect to the device coordinate system. (Note that most output 560 * with respect to the device coordinate system. (Note that most output
585 * devices have left-handed device spaces; on such devices, a counter- 561 * devices have left-handed device spaces; on such devices, a counter-
586 * clockwise angle in device space will correspond to a clockwise angle in 562 * clockwise angle in device space will correspond to a clockwise angle in
587 * default user space and on the physical medium.) 563 * default user space and on the physical medium.)
588 **/ 564 **/
589 bool has_Angle() const { 565 bool has_Angle() const {
590 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Angle ", "", NULL)); 566 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Angle ", "", NULL));
591 } 567 }
592 568
593 double Angle() const { 569 double Angle() const;
594 double ret;
595 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Angle", " ", &ret)) return ret;
596 // TODO(edisonn): warn about missing required field, assert for known good p dfs
597 return 0;
598 }
599
600 /** (Required) A function object defining the order in which device pixels 570 /** (Required) A function object defining the order in which device pixels
601 * within a screen cell are adjusted for different gray levels, or the name of 571 * within a screen cell are adjusted for different gray levels, or the name of
602 * one of the predefined spot functions (see Table 6.1 on page 385). 572 * one of the predefined spot functions (see Table 6.1 on page 385).
603 **/ 573 **/
604 bool has_SpotFunction() const { 574 bool has_SpotFunction() const {
605 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SpotF unction", "", NULL)); 575 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SpotF unction", "", NULL));
606 } 576 }
607 577
608 bool isSpotFunctionAFunction() const { 578 bool isSpotFunctionAFunction() const {
609 SkPdfObject* ret = NULL; 579 SkPdfObject* ret = NULL;
610 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SpotFunc tion", "", &ret)) return false; 580 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SpotFunc tion", "", &ret)) return false;
611 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 581 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
612 } 582 }
613 583
614 SkPdfFunction getSpotFunctionAsFunction() const { 584 SkPdfFunction getSpotFunctionAsFunction() const;
615 SkPdfFunction ret = SkPdfFunction();
616 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SpotFun ction", "", &ret)) return ret;
617 // TODO(edisonn): warn about missing required field, assert for known good p dfs
618 return SkPdfFunction();
619 }
620
621 bool isSpotFunctionAName() const { 585 bool isSpotFunctionAName() const {
622 SkPdfObject* ret = NULL; 586 SkPdfObject* ret = NULL;
623 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SpotFunc tion", "", &ret)) return false; 587 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SpotFunc tion", "", &ret)) return false;
624 return ret->podofo()->GetDataType() == ePdfDataType_Name; 588 return ret->podofo()->GetDataType() == ePdfDataType_Name;
625 } 589 }
626 590
627 std::string getSpotFunctionAsName() const { 591 std::string getSpotFunctionAsName() const;
628 std::string ret = "";
629 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SpotFunctio n", "", &ret)) return ret;
630 // TODO(edisonn): warn about missing required field, assert for known good p dfs
631 return "";
632 }
633
634 /** (Optional) A flag specifying whether to invoke a special halftone al- 592 /** (Optional) A flag specifying whether to invoke a special halftone al-
635 * gorithm that is extremely precise, but computationally expensive; see 593 * gorithm that is extremely precise, but computationally expensive; see
636 * below for further discussion. Default value: false. 594 * below for further discussion. Default value: false.
637 **/ 595 **/
638 bool has_AccurateScreens() const { 596 bool has_AccurateScreens() const {
639 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Accur ateScreens", "", NULL)); 597 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Accur ateScreens", "", NULL));
640 } 598 }
641 599
642 bool AccurateScreens() const { 600 bool AccurateScreens() const;
643 bool ret;
644 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AccurateScr eens", "", &ret)) return ret;
645 // TODO(edisonn): warn about missing required field, assert for known good p dfs
646 return false;
647 }
648
649 /** (Optional) A transfer function, which overrides the current transfer 601 /** (Optional) A transfer function, which overrides the current transfer
650 * function in the graphics state for the same component. This entry is 602 * function in the graphics state for the same component. This entry is
651 * required if the dictionary is a component of a type 5 halftone (see 603 * required if the dictionary is a component of a type 5 halftone (see
652 * "Type 5 Halftones" on page 400) and represents either a nonprimary 604 * "Type 5 Halftones" on page 400) and represents either a nonprimary
653 * or nonstandard primary color component (see Section 6.3, "Transfer 605 * or nonstandard primary color component (see Section 6.3, "Transfer
654 * Functions"). The name Identity may be used to specify the identity 606 * Functions"). The name Identity may be used to specify the identity
655 * function. 607 * function.
656 **/ 608 **/
657 bool has_TransferFunction() const { 609 bool has_TransferFunction() const {
658 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans ferFunction", "", NULL)); 610 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans ferFunction", "", NULL));
659 } 611 }
660 612
661 bool isTransferFunctionAFunction() const { 613 bool isTransferFunctionAFunction() const {
662 SkPdfObject* ret = NULL; 614 SkPdfObject* ret = NULL;
663 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false; 615 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false;
664 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 616 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
665 } 617 }
666 618
667 SkPdfFunction getTransferFunctionAsFunction() const { 619 SkPdfFunction getTransferFunctionAsFunction() const;
668 SkPdfFunction ret = SkPdfFunction();
669 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfe rFunction", "", &ret)) return ret;
670 // TODO(edisonn): warn about missing required field, assert for known good p dfs
671 return SkPdfFunction();
672 }
673
674 bool isTransferFunctionAName() const { 620 bool isTransferFunctionAName() const {
675 SkPdfObject* ret = NULL; 621 SkPdfObject* ret = NULL;
676 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false; 622 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false;
677 return ret->podofo()->GetDataType() == ePdfDataType_Name; 623 return ret->podofo()->GetDataType() == ePdfDataType_Name;
678 } 624 }
679 625
680 std::string getTransferFunctionAsName() const { 626 std::string getTransferFunctionAsName() const;
681 std::string ret = "";
682 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TransferFun ction", "", &ret)) return ret;
683 // TODO(edisonn): warn about missing required field, assert for known good p dfs
684 return "";
685 }
686
687 }; 627 };
688 628
689 #endif // __DEFINED__SkPdfType1HalftoneDictionary 629 #endif // __DEFINED__SkPdfType1HalftoneDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698