OLD | NEW |
1 #ifndef __DEFINED__SkPdfTransparencyGroupDictionary | 1 #ifndef __DEFINED__SkPdfTransparencyGroupDictionary |
2 #define __DEFINED__SkPdfTransparencyGroupDictionary | 2 #define __DEFINED__SkPdfTransparencyGroupDictionary |
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 // Additional entries specific to a transparency group attributes dictionary |
8 class SkPdfTransparencyGroupDictionary : public SkPdfDictionary { | 9 class SkPdfTransparencyGroupDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kTransparencyGroupDictionary_
SkPdfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kTransparencyGroupDictionary_
SkPdfObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kTranspa
rencyGroupDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kTranspa
rencyGroupDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfTransparencyGroupDictionary* asTransparencyGroupDictionary() {ret
urn this;} | 14 virtual SkPdfTransparencyGroupDictionary* asTransparencyGroupDictionary() {ret
urn this;} |
14 virtual const SkPdfTransparencyGroupDictionary* asTransparencyGroupDictionary(
) const {return this;} | 15 virtual const SkPdfTransparencyGroupDictionary* asTransparencyGroupDictionary(
) 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 Loading... |
514 | 515 |
515 public: | 516 public: |
516 private: | 517 private: |
517 public: | 518 public: |
518 SkPdfTransparencyGroupDictionary(const PdfMemDocument* podofoDoc = NULL, const
PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfTransparencyGroupDictionary(const PdfMemDocument* podofoDoc = NULL, const
PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfTransparencyGroupDictionary& operator=(const SkPdfTransparencyGroupDictio
nary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofo
Obj; return *this;} | 523 SkPdfTransparencyGroupDictionary& operator=(const SkPdfTransparencyGroupDictio
nary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofo
Obj; return *this;} |
523 | 524 |
| 525 /** (Required) The group subtype, which identifies the type of group whose at- |
| 526 * tributes this dictionary describes; must be Transparency for a transparency |
| 527 * group. |
| 528 **/ |
| 529 bool has_S() const { |
| 530 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "
", NULL)); |
| 531 } |
| 532 |
524 std::string S() const { | 533 std::string S() const { |
525 std::string ret; | 534 std::string ret; |
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "", &re
t)) return ret; | 535 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "", &re
t)) return ret; |
527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 536 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
528 return ""; | 537 return ""; |
529 } | 538 } |
530 | 539 |
| 540 /** (Sometimes required, as discussed below) The group color space, which is use
d for |
| 541 * the following purposes: |
| 542 * * As the color space into which colors are converted when painted into the |
| 543 * group |
| 544 * * As the blending color space in which objects are composited within the gr
oup |
| 545 * (see Section 7.2.3, "Blending Color Space") |
| 546 * * As the color space of the group as a whole when it in turn is painted as
an ob- |
| 547 * ject onto its backdrop |
| 548 * The group color space may be any device or CIE-based color space that treats
its |
| 549 * components as independent additive or subtractive values in the range 0.0 to |
| 550 * 1.0, subject to the restrictions described in Section 7.2.3, "Blending Color |
| 551 * Space." These restrictions exclude Lab and lightness-chromaticity ICCBased |
| 552 * color spaces, as well as the special color spaces Pattern, Indexed, Separati
on, and |
| 553 * DeviceN. Device color spaces are subject to remapping according to the Defau
lt- |
| 554 * Gray, DefaultRGB, and DefaultCMYK entries in the ColorSpace subdictionary of |
| 555 * the current resource dictionary (see "Default Color Spaces" on page 194). |
| 556 * Ordinarily, the CS entry is allowed only for isolated transparency groups (t
hose |
| 557 * for which I, below, is true) and even then it is optional. However, this ent
ry is re- |
| 558 * quired in the group attributes dictionary for any transparency group XObject |
| 559 * that has no parent group or page from which to inherit-in particular, one th
at |
| 560 * is the value of the G entry in a soft-mask dictionary of subtype Luminosity
(see |
| 561 * "Soft-Mask Dictionaries" on page 445). |
| 562 * In addition, it is always permissible to specify CS in the group attributes
diction- |
| 563 * ary associated with a page object, even if I is false or absent. In the norm
al case in |
| 564 * which the page is imposed directly on the output medium, the page group is |
| 565 * effectively isolated regardless of the I value, and the specified CS value i
s there- |
| 566 * fore honored. But if the page is in turn used as an element of some other pa
ge |
| 567 * and if the group is non-isolated, CS is ignored and the color space is inher
ited |
| 568 * from the actual backdrop with which the page is composited (see Section 7.3.
6, |
| 569 * "Page Group"). |
| 570 **/ |
| 571 bool has_CS() const { |
| 572 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS",
"", NULL)); |
| 573 } |
| 574 |
531 bool isCSAName() const { | 575 bool isCSAName() const { |
532 SkPdfObject* ret = NULL; | 576 SkPdfObject* ret = NULL; |
533 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "",
&ret)) return false; | 577 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "",
&ret)) return false; |
534 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 578 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
535 } | 579 } |
536 | 580 |
537 std::string getCSAsName() const { | 581 std::string getCSAsName() const { |
538 std::string ret = ""; | 582 std::string ret = ""; |
539 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "", &r
et)) return ret; | 583 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "", &r
et)) return ret; |
540 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 584 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
541 return ""; | 585 return ""; |
542 } | 586 } |
543 | 587 |
544 bool isCSAArray() const { | 588 bool isCSAArray() const { |
545 SkPdfObject* ret = NULL; | 589 SkPdfObject* ret = NULL; |
546 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "",
&ret)) return false; | 590 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "",
&ret)) return false; |
547 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 591 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
548 } | 592 } |
549 | 593 |
550 SkPdfArray getCSAsArray() const { | 594 SkPdfArray getCSAsArray() const { |
551 SkPdfArray ret = SkPdfArray(); | 595 SkPdfArray ret = SkPdfArray(); |
552 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "", &
ret)) return ret; | 596 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "", &
ret)) return ret; |
553 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 597 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
554 return SkPdfArray(); | 598 return SkPdfArray(); |
555 } | 599 } |
556 | 600 |
557 }; | 601 }; |
558 | 602 |
559 #endif // __DEFINED__SkPdfTransparencyGroupDictionary | 603 #endif // __DEFINED__SkPdfTransparencyGroupDictionary |
OLD | NEW |