| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfIccProfileStreamDictionary | 1 #ifndef __DEFINED__SkPdfIccProfileStreamDictionary |
| 2 #define __DEFINED__SkPdfIccProfileStreamDictionary | 2 #define __DEFINED__SkPdfIccProfileStreamDictionary |
| 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 // Additional entries specific to an ICC profile stream dictionary | 9 // Additional entries specific to an ICC profile stream dictionary |
| 10 class SkPdfIccProfileStreamDictionary : public SkPdfDictionary { | 10 class SkPdfIccProfileStreamDictionary : public SkPdfDictionary { |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 SkPdfIccProfileStreamDictionary& operator=(const SkPdfIccProfileStreamDictiona
ry& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoOb
j; return *this;} | 526 SkPdfIccProfileStreamDictionary& operator=(const SkPdfIccProfileStreamDictiona
ry& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoOb
j; return *this;} |
| 527 | 527 |
| 528 /** (Required) The number of color components in the color space described by th
e ICC | 528 /** (Required) The number of color components in the color space described by th
e ICC |
| 529 * profile data. This number must match the number of components actually in th
e ICC | 529 * profile data. This number must match the number of components actually in th
e ICC |
| 530 * profile. As of PDF 1.4, N must be 1, 3, or 4. | 530 * profile. As of PDF 1.4, N must be 1, 3, or 4. |
| 531 **/ | 531 **/ |
| 532 bool has_N() const { | 532 bool has_N() const { |
| 533 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "N", "
", NULL)); | 533 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "N", "
", NULL)); |
| 534 } | 534 } |
| 535 | 535 |
| 536 long N() const { | 536 long N() const; |
| 537 long ret; | |
| 538 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "N", "", &re
t)) return ret; | |
| 539 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 540 return 0; | |
| 541 } | |
| 542 | |
| 543 /** (Optional) An alternate color space to be used in case the one specified in
the stream | 537 /** (Optional) An alternate color space to be used in case the one specified in
the stream |
| 544 * data is not supported (for example, by viewer applications designed for earl
ier | 538 * data is not supported (for example, by viewer applications designed for earl
ier |
| 545 * versions of PDF). The alternate space may be any valid color space (except a
Pattern | 539 * versions of PDF). The alternate space may be any valid color space (except a
Pattern |
| 546 * color space) that has the number of components specified by N. If this entry
is omit- | 540 * color space) that has the number of components specified by N. If this entry
is omit- |
| 547 * ted and the viewer application does not understand the ICC profile data, the
color | 541 * ted and the viewer application does not understand the ICC profile data, the
color |
| 548 * space used will be DeviceGray, DeviceRGB, or DeviceCMYK, depending on whethe
r | 542 * space used will be DeviceGray, DeviceRGB, or DeviceCMYK, depending on whethe
r |
| 549 * the value of N is 1, 3, or 4, respectively. | 543 * the value of N is 1, 3, or 4, respectively. |
| 550 * Note: Note that there is no conversion of source color values, such as a tin
t transforma- | 544 * Note: Note that there is no conversion of source color values, such as a tin
t transforma- |
| 551 * tion, when using the alternate color space. Color values that are within the
range of the | 545 * tion, when using the alternate color space. Color values that are within the
range of the |
| 552 * ICCBased color space might not be within the range of the alternate color sp
ace. In this | 546 * ICCBased color space might not be within the range of the alternate color sp
ace. In this |
| 553 * case, the nearest values within the range of the alternate space will be sub
stituted. | 547 * case, the nearest values within the range of the alternate space will be sub
stituted. |
| 554 **/ | 548 **/ |
| 555 bool has_Alternate() const { | 549 bool has_Alternate() const { |
| 556 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alter
nate", "", NULL)); | 550 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alter
nate", "", NULL)); |
| 557 } | 551 } |
| 558 | 552 |
| 559 bool isAlternateAArray() const { | 553 bool isAlternateAArray() const { |
| 560 SkPdfObject* ret = NULL; | 554 SkPdfObject* ret = NULL; |
| 561 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternat
e", "", &ret)) return false; | 555 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternat
e", "", &ret)) return false; |
| 562 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 556 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
| 563 } | 557 } |
| 564 | 558 |
| 565 SkPdfArray* getAlternateAsArray() const { | 559 SkPdfArray* getAlternateAsArray() const; |
| 566 SkPdfArray* ret = NULL; | |
| 567 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternate"
, "", &ret)) return ret; | |
| 568 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 569 return NULL; | |
| 570 } | |
| 571 | |
| 572 bool isAlternateAName() const { | 560 bool isAlternateAName() const { |
| 573 SkPdfObject* ret = NULL; | 561 SkPdfObject* ret = NULL; |
| 574 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternat
e", "", &ret)) return false; | 562 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternat
e", "", &ret)) return false; |
| 575 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 563 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 576 } | 564 } |
| 577 | 565 |
| 578 std::string getAlternateAsName() const { | 566 std::string getAlternateAsName() const; |
| 579 std::string ret = ""; | |
| 580 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternate",
"", &ret)) return ret; | |
| 581 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 582 return ""; | |
| 583 } | |
| 584 | |
| 585 /** (Optional) An array of 2 x N numbers [min0 max0 min1 max1 ... ] specifying t
he | 567 /** (Optional) An array of 2 x N numbers [min0 max0 min1 max1 ... ] specifying t
he |
| 586 * minimum and maximum valid values of the corresponding color components. | 568 * minimum and maximum valid values of the corresponding color components. |
| 587 * These values must match the information in the ICC profile. Default value: | 569 * These values must match the information in the ICC profile. Default value: |
| 588 * [0.0 1.0 0.0 1.0 ...]. | 570 * [0.0 1.0 0.0 1.0 ...]. |
| 589 **/ | 571 **/ |
| 590 bool has_Range() const { | 572 bool has_Range() const { |
| 591 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range
", "", NULL)); | 573 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range
", "", NULL)); |
| 592 } | 574 } |
| 593 | 575 |
| 594 SkPdfArray* Range() const { | 576 SkPdfArray* Range() const; |
| 595 SkPdfArray* ret; | |
| 596 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range", ""
, &ret)) return ret; | |
| 597 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 598 return NULL; | |
| 599 } | |
| 600 | |
| 601 /** (Optional; PDF 1.4) A metadata stream containing metadata for the color spac
e (see | 577 /** (Optional; PDF 1.4) A metadata stream containing metadata for the color spac
e (see |
| 602 * Section 9.2.2, "Metadata Streams"). | 578 * Section 9.2.2, "Metadata Streams"). |
| 603 **/ | 579 **/ |
| 604 bool has_Metadata() const { | 580 bool has_Metadata() const { |
| 605 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); | 581 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); |
| 606 } | 582 } |
| 607 | 583 |
| 608 SkPdfStream* Metadata() const { | 584 SkPdfStream* Metadata() const; |
| 609 SkPdfStream* ret; | |
| 610 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata"
, "", &ret)) return ret; | |
| 611 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 612 return NULL; | |
| 613 } | |
| 614 | |
| 615 }; | 585 }; |
| 616 | 586 |
| 617 #endif // __DEFINED__SkPdfIccProfileStreamDictionary | 587 #endif // __DEFINED__SkPdfIccProfileStreamDictionary |
| OLD | NEW |