OLD | NEW |
1 #ifndef __DEFINED__SkPdfSoftMaskDictionary | 1 #ifndef __DEFINED__SkPdfSoftMaskDictionary |
2 #define __DEFINED__SkPdfSoftMaskDictionary | 2 #define __DEFINED__SkPdfSoftMaskDictionary |
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 soft-mask dictionary | 9 // Entries in a soft-mask dictionary |
10 class SkPdfSoftMaskDictionary : public SkPdfDictionary { | 10 class SkPdfSoftMaskDictionary : public SkPdfDictionary { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 SkPdfSoftMaskDictionary& operator=(const SkPdfSoftMaskDictionary& from) {this-
>fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;
} | 526 SkPdfSoftMaskDictionary& operator=(const SkPdfSoftMaskDictionary& from) {this-
>fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;
} |
527 | 527 |
528 /** (Optional) The type of PDF object that this dictionary describes; if present
, | 528 /** (Optional) The type of PDF object that this dictionary describes; if present
, |
529 * must be Mask for a soft-mask dictionary. | 529 * must be Mask for a soft-mask 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 subtype specifying the method to be used in deriving the mask | 536 /** (Required) A subtype specifying the method to be used in deriving the mask |
543 * values from the transparency group specified by the G entry: | 537 * values from the transparency group specified by the G entry: |
544 * Alpha Use the group's computed alpha, disregarding its color (se
e | 538 * Alpha Use the group's computed alpha, disregarding its color (se
e |
545 * Section 7.4.1, "Deriving a Soft Mask from Group Alpha"). | 539 * Section 7.4.1, "Deriving a Soft Mask from Group Alpha"). |
546 * Luminosity Convert the group's computed color to a single-component | 540 * Luminosity Convert the group's computed color to a single-component |
547 * luminosity value (see Section 7.4.2, "Deriving a Soft Mask | 541 * luminosity value (see Section 7.4.2, "Deriving a Soft Mask |
548 * from Group Luminosity"). | 542 * from Group Luminosity"). |
549 **/ | 543 **/ |
550 bool has_S() const { | 544 bool has_S() const { |
551 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "
", NULL)); | 545 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "
", NULL)); |
552 } | 546 } |
553 | 547 |
554 std::string S() const { | 548 std::string S() const; |
555 std::string ret; | |
556 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "", &re
t)) return ret; | |
557 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
558 return ""; | |
559 } | |
560 | |
561 /** (Required) A transparency group XObject (see Section 7.5.5, "Transparency | 549 /** (Required) A transparency group XObject (see Section 7.5.5, "Transparency |
562 * Group XObjects") to be used as the source of alpha or color values for deriv
- | 550 * Group XObjects") to be used as the source of alpha or color values for deriv
- |
563 * ing the mask. If the subtype S is Luminosity, the group attributes dictionar
y | 551 * ing the mask. If the subtype S is Luminosity, the group attributes dictionar
y |
564 * must contain a CS entry defining the color space in which the compositing | 552 * must contain a CS entry defining the color space in which the compositing |
565 * computation is to be performed. | 553 * computation is to be performed. |
566 **/ | 554 **/ |
567 bool has_G() const { | 555 bool has_G() const { |
568 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "G", "
", NULL)); | 556 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "G", "
", NULL)); |
569 } | 557 } |
570 | 558 |
571 SkPdfStream* G() const { | 559 SkPdfStream* G() const; |
572 SkPdfStream* ret; | |
573 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "G", "", &
ret)) return ret; | |
574 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
575 return NULL; | |
576 } | |
577 | |
578 /** (Optional) An array of component values specifying the color to be used as | 560 /** (Optional) An array of component values specifying the color to be used as |
579 * the backdrop against which to composite the transparency group XObject G. | 561 * the backdrop against which to composite the transparency group XObject G. |
580 * This entry is consulted only if the subtype S is Luminosity. The array consi
sts | 562 * This entry is consulted only if the subtype S is Luminosity. The array consi
sts |
581 * of n numbers, where n is the number of components in the color space speci- | 563 * of n numbers, where n is the number of components in the color space speci- |
582 * fied by the CS entry in the group attributes dictionary (see Section 7.5.5, | 564 * fied by the CS entry in the group attributes dictionary (see Section 7.5.5, |
583 * "Transparency Group XObjects"). Default value: the color space's initial | 565 * "Transparency Group XObjects"). Default value: the color space's initial |
584 * value, representing black. | 566 * value, representing black. |
585 **/ | 567 **/ |
586 bool has_BC() const { | 568 bool has_BC() const { |
587 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BC",
"", NULL)); | 569 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BC",
"", NULL)); |
588 } | 570 } |
589 | 571 |
590 SkPdfArray* BC() const { | 572 SkPdfArray* BC() const; |
591 SkPdfArray* ret; | |
592 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BC", "", &
ret)) return ret; | |
593 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
594 return NULL; | |
595 } | |
596 | |
597 /** (Optional) A function object (see Section 3.9, "Functions") specifying the | 573 /** (Optional) A function object (see Section 3.9, "Functions") specifying the |
598 * transfer function to be used in deriving the mask values. The function ac- | 574 * transfer function to be used in deriving the mask values. The function ac- |
599 * cepts one input, the computed group alpha or luminosity (depending on the | 575 * cepts one input, the computed group alpha or luminosity (depending on the |
600 * value of the subtype S), and returns one output, the resulting mask value. | 576 * value of the subtype S), and returns one output, the resulting mask value. |
601 * Both the input and output must be in the range 0.0 to 1.0; if the computed | 577 * Both the input and output must be in the range 0.0 to 1.0; if the computed |
602 * output falls outside this range, it is forced to the nearest valid value. Th
e | 578 * output falls outside this range, it is forced to the nearest valid value. Th
e |
603 * name Identity may be specified in place of a function object to designate th
e | 579 * name Identity may be specified in place of a function object to designate th
e |
604 * identity function. Default value: Identity. | 580 * identity function. Default value: Identity. |
605 **/ | 581 **/ |
606 bool has_TR() const { | 582 bool has_TR() const { |
607 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR",
"", NULL)); | 583 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR",
"", NULL)); |
608 } | 584 } |
609 | 585 |
610 bool isTRAFunction() const { | 586 bool isTRAFunction() const { |
611 SkPdfObject* ret = NULL; | 587 SkPdfObject* ret = NULL; |
612 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "",
&ret)) return false; | 588 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "",
&ret)) return false; |
613 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 589 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
614 } | 590 } |
615 | 591 |
616 SkPdfFunction getTRAsFunction() const { | 592 SkPdfFunction getTRAsFunction() const; |
617 SkPdfFunction ret = SkPdfFunction(); | |
618 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", ""
, &ret)) return ret; | |
619 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
620 return SkPdfFunction(); | |
621 } | |
622 | |
623 bool isTRAName() const { | 593 bool isTRAName() const { |
624 SkPdfObject* ret = NULL; | 594 SkPdfObject* ret = NULL; |
625 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "",
&ret)) return false; | 595 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "",
&ret)) return false; |
626 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 596 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
627 } | 597 } |
628 | 598 |
629 std::string getTRAsName() const { | 599 std::string getTRAsName() const; |
630 std::string ret = ""; | |
631 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "", &r
et)) return ret; | |
632 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
633 return ""; | |
634 } | |
635 | |
636 }; | 600 }; |
637 | 601 |
638 #endif // __DEFINED__SkPdfSoftMaskDictionary | 602 #endif // __DEFINED__SkPdfSoftMaskDictionary |
OLD | NEW |