OLD | NEW |
(Empty) | |
| 1 #include "SkPdfIccProfileStreamDictionary_autogen.h" |
| 2 |
| 3 |
| 4 #include "SkPdfNativeDoc.h" |
| 5 int64_t SkPdfIccProfileStreamDictionary::N(SkPdfNativeDoc* doc) { |
| 6 SkPdfNativeObject* ret = get("N", ""); |
| 7 if (doc) {ret = doc->resolveReference(ret);} |
| 8 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 9 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 10 return 0; |
| 11 } |
| 12 |
| 13 bool SkPdfIccProfileStreamDictionary::has_N() const { |
| 14 return get("N", "") != NULL; |
| 15 } |
| 16 |
| 17 bool SkPdfIccProfileStreamDictionary::isAlternateAArray(SkPdfNativeDoc* doc) { |
| 18 SkPdfNativeObject* ret = get("Alternate", ""); |
| 19 if (doc) {ret = doc->resolveReference(ret);} |
| 20 return ret != NULL && ret->isArray(); |
| 21 } |
| 22 |
| 23 SkPdfArray* SkPdfIccProfileStreamDictionary::getAlternateAsArray(SkPdfNativeDoc*
doc) { |
| 24 SkPdfNativeObject* ret = get("Alternate", ""); |
| 25 if (doc) {ret = doc->resolveReference(ret);} |
| 26 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 27 // TODO(edisonn): warn about missing default value for optional fields |
| 28 return NULL; |
| 29 } |
| 30 |
| 31 bool SkPdfIccProfileStreamDictionary::isAlternateAName(SkPdfNativeDoc* doc) { |
| 32 SkPdfNativeObject* ret = get("Alternate", ""); |
| 33 if (doc) {ret = doc->resolveReference(ret);} |
| 34 return ret != NULL && ret->isName(); |
| 35 } |
| 36 |
| 37 SkString SkPdfIccProfileStreamDictionary::getAlternateAsName(SkPdfNativeDoc* doc
) { |
| 38 SkPdfNativeObject* ret = get("Alternate", ""); |
| 39 if (doc) {ret = doc->resolveReference(ret);} |
| 40 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 41 // TODO(edisonn): warn about missing default value for optional fields |
| 42 return SkString(); |
| 43 } |
| 44 |
| 45 bool SkPdfIccProfileStreamDictionary::has_Alternate() const { |
| 46 return get("Alternate", "") != NULL; |
| 47 } |
| 48 |
| 49 SkPdfArray* SkPdfIccProfileStreamDictionary::Range(SkPdfNativeDoc* doc) { |
| 50 SkPdfNativeObject* ret = get("Range", ""); |
| 51 if (doc) {ret = doc->resolveReference(ret);} |
| 52 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 53 // TODO(edisonn): warn about missing default value for optional fields |
| 54 return NULL; |
| 55 } |
| 56 |
| 57 bool SkPdfIccProfileStreamDictionary::has_Range() const { |
| 58 return get("Range", "") != NULL; |
| 59 } |
| 60 |
| 61 SkPdfStream* SkPdfIccProfileStreamDictionary::Metadata(SkPdfNativeDoc* doc) { |
| 62 SkPdfNativeObject* ret = get("Metadata", ""); |
| 63 if (doc) {ret = doc->resolveReference(ret);} |
| 64 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); |
| 65 // TODO(edisonn): warn about missing default value for optional fields |
| 66 return NULL; |
| 67 } |
| 68 |
| 69 bool SkPdfIccProfileStreamDictionary::has_Metadata() const { |
| 70 return get("Metadata", "") != NULL; |
| 71 } |
| 72 |
OLD | NEW |