| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfSeparationDictionary | 1 #ifndef __DEFINED__SkPdfSeparationDictionary |
| 2 #define __DEFINED__SkPdfSeparationDictionary | 2 #define __DEFINED__SkPdfSeparationDictionary |
| 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 separation dictionary |
| 8 class SkPdfSeparationDictionary : public SkPdfDictionary { | 9 class SkPdfSeparationDictionary : public SkPdfDictionary { |
| 9 public: | 10 public: |
| 10 virtual SkPdfObjectType getType() const { return kSeparationDictionary_SkPdfOb
jectType;} | 11 virtual SkPdfObjectType getType() const { return kSeparationDictionary_SkPdfOb
jectType;} |
| 11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kSeparat
ionDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kSeparat
ionDictionary_SkPdfObjectType + 1);} |
| 12 public: | 13 public: |
| 13 virtual SkPdfSeparationDictionary* asSeparationDictionary() {return this;} | 14 virtual SkPdfSeparationDictionary* asSeparationDictionary() {return this;} |
| 14 virtual const SkPdfSeparationDictionary* asSeparationDictionary() const {retur
n this;} | 15 virtual const SkPdfSeparationDictionary* asSeparationDictionary() const {retur
n 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 Loading... |
| 514 | 515 |
| 515 public: | 516 public: |
| 516 private: | 517 private: |
| 517 public: | 518 public: |
| 518 SkPdfSeparationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObj
ect* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfSeparationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObj
ect* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
| 519 | 520 |
| 520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
| 521 | 522 |
| 522 SkPdfSeparationDictionary& operator=(const SkPdfSeparationDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} | 523 SkPdfSeparationDictionary& operator=(const SkPdfSeparationDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} |
| 523 | 524 |
| 525 /** (Required) An array of indirect references to page objects representing sepa
ra- |
| 526 * tions of the same document page. One of the page objects in the array must b
e |
| 527 * the one with which this separation dictionary is associated, and all of them
must |
| 528 * have separation dictionaries (SeparationInfo entries) containing Pages array
s |
| 529 * identical to this one. |
| 530 **/ |
| 531 bool has_Pages() const { |
| 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages
", "", NULL)); |
| 533 } |
| 534 |
| 524 SkPdfArray Pages() const { | 535 SkPdfArray Pages() const { |
| 525 SkPdfArray ret; | 536 SkPdfArray ret; |
| 526 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", ""
, &ret)) return ret; | 537 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", ""
, &ret)) return ret; |
| 527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 538 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 528 return SkPdfArray(); | 539 return SkPdfArray(); |
| 529 } | 540 } |
| 530 | 541 |
| 542 /** (Required) The name of the device colorant to be used in rendering this |
| 543 * separation, such as Cyan or PANTONE 35 CV. |
| 544 **/ |
| 545 bool has_DeviceColorant() const { |
| 546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Devic
eColorant", "", NULL)); |
| 547 } |
| 548 |
| 531 bool isDeviceColorantAName() const { | 549 bool isDeviceColorantAName() const { |
| 532 SkPdfObject* ret = NULL; | 550 SkPdfObject* ret = NULL; |
| 533 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCo
lorant", "", &ret)) return false; | 551 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCo
lorant", "", &ret)) return false; |
| 534 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 552 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 535 } | 553 } |
| 536 | 554 |
| 537 std::string getDeviceColorantAsName() const { | 555 std::string getDeviceColorantAsName() const { |
| 538 std::string ret = ""; | 556 std::string ret = ""; |
| 539 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceColor
ant", "", &ret)) return ret; | 557 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceColor
ant", "", &ret)) return ret; |
| 540 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 558 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 541 return ""; | 559 return ""; |
| 542 } | 560 } |
| 543 | 561 |
| 544 bool isDeviceColorantAString() const { | 562 bool isDeviceColorantAString() const { |
| 545 SkPdfObject* ret = NULL; | 563 SkPdfObject* ret = NULL; |
| 546 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCo
lorant", "", &ret)) return false; | 564 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCo
lorant", "", &ret)) return false; |
| 547 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; | 565 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; |
| 548 } | 566 } |
| 549 | 567 |
| 550 std::string getDeviceColorantAsString() const { | 568 std::string getDeviceColorantAsString() const { |
| 551 std::string ret = ""; | 569 std::string ret = ""; |
| 552 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCol
orant", "", &ret)) return ret; | 570 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCol
orant", "", &ret)) return ret; |
| 553 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 571 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 554 return ""; | 572 return ""; |
| 555 } | 573 } |
| 556 | 574 |
| 575 /** (Optional) An array defining a Separation or DeviceN color space (see "Separ
a- |
| 576 * tion Color Spaces" on page 201 and "DeviceN Color Spaces" on page 205). This |
| 577 * provides additional information about the color specified by DeviceColorant- |
| 578 * in particular, the alternate color space and tint transformation function th
at |
| 579 * would be used to represent the colorant as a process color. This information |
| 580 * enables a viewer application to preview the separation in a color that appro
xi- |
| 581 * mates the device colorant. |
| 582 * The value of DeviceColorant must match the space's colorant name (if it is a |
| 583 * Separation space) or be one of the space's colorant names (if it is a Device
N |
| 584 * space). |
| 585 **/ |
| 586 bool has_ColorSpace() const { |
| 587 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Color
Space", "", NULL)); |
| 588 } |
| 589 |
| 557 SkPdfArray ColorSpace() const { | 590 SkPdfArray ColorSpace() const { |
| 558 SkPdfArray ret; | 591 SkPdfArray ret; |
| 559 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace
", "", &ret)) return ret; | 592 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace
", "", &ret)) return ret; |
| 560 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 593 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 561 return SkPdfArray(); | 594 return SkPdfArray(); |
| 562 } | 595 } |
| 563 | 596 |
| 564 }; | 597 }; |
| 565 | 598 |
| 566 #endif // __DEFINED__SkPdfSeparationDictionary | 599 #endif // __DEFINED__SkPdfSeparationDictionary |
| OLD | NEW |