| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2013 Google Inc. | |
| 3 | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #include "SkPdfType16HalftoneDictionary_autogen.h" | |
| 9 #include "SkPdfNativeDoc.h" | |
| 10 | |
| 11 SkString SkPdfType16HalftoneDictionary::Type(SkPdfNativeDoc* doc) { | |
| 12 SkPdfNativeObject* ret = get("Type", ""); | |
| 13 if (doc) {ret = doc->resolveReference(ret);} | |
| 14 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 15 // TODO(edisonn): warn about missing default value for optional fields | |
| 16 return SkString(); | |
| 17 } | |
| 18 | |
| 19 bool SkPdfType16HalftoneDictionary::has_Type() const { | |
| 20 return get("Type", "") != NULL; | |
| 21 } | |
| 22 | |
| 23 int64_t SkPdfType16HalftoneDictionary::HalftoneType(SkPdfNativeDoc* doc) { | |
| 24 SkPdfNativeObject* ret = get("HalftoneType", ""); | |
| 25 if (doc) {ret = doc->resolveReference(ret);} | |
| 26 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | |
| 27 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 28 return 0; | |
| 29 } | |
| 30 | |
| 31 bool SkPdfType16HalftoneDictionary::has_HalftoneType() const { | |
| 32 return get("HalftoneType", "") != NULL; | |
| 33 } | |
| 34 | |
| 35 SkString SkPdfType16HalftoneDictionary::HalftoneName(SkPdfNativeDoc* doc) { | |
| 36 SkPdfNativeObject* ret = get("HalftoneName", ""); | |
| 37 if (doc) {ret = doc->resolveReference(ret);} | |
| 38 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret-
>isReference())) return ret->stringValue2(); | |
| 39 // TODO(edisonn): warn about missing default value for optional fields | |
| 40 return SkString(); | |
| 41 } | |
| 42 | |
| 43 bool SkPdfType16HalftoneDictionary::has_HalftoneName() const { | |
| 44 return get("HalftoneName", "") != NULL; | |
| 45 } | |
| 46 | |
| 47 int64_t SkPdfType16HalftoneDictionary::Width(SkPdfNativeDoc* doc) { | |
| 48 SkPdfNativeObject* ret = get("Width", ""); | |
| 49 if (doc) {ret = doc->resolveReference(ret);} | |
| 50 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | |
| 51 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 52 return 0; | |
| 53 } | |
| 54 | |
| 55 bool SkPdfType16HalftoneDictionary::has_Width() const { | |
| 56 return get("Width", "") != NULL; | |
| 57 } | |
| 58 | |
| 59 int64_t SkPdfType16HalftoneDictionary::Height(SkPdfNativeDoc* doc) { | |
| 60 SkPdfNativeObject* ret = get("Height", ""); | |
| 61 if (doc) {ret = doc->resolveReference(ret);} | |
| 62 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | |
| 63 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 64 return 0; | |
| 65 } | |
| 66 | |
| 67 bool SkPdfType16HalftoneDictionary::has_Height() const { | |
| 68 return get("Height", "") != NULL; | |
| 69 } | |
| 70 | |
| 71 int64_t SkPdfType16HalftoneDictionary::Width2(SkPdfNativeDoc* doc) { | |
| 72 SkPdfNativeObject* ret = get("Width2", ""); | |
| 73 if (doc) {ret = doc->resolveReference(ret);} | |
| 74 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | |
| 75 // TODO(edisonn): warn about missing default value for optional fields | |
| 76 return 0; | |
| 77 } | |
| 78 | |
| 79 bool SkPdfType16HalftoneDictionary::has_Width2() const { | |
| 80 return get("Width2", "") != NULL; | |
| 81 } | |
| 82 | |
| 83 int64_t SkPdfType16HalftoneDictionary::Height2(SkPdfNativeDoc* doc) { | |
| 84 SkPdfNativeObject* ret = get("Height2", ""); | |
| 85 if (doc) {ret = doc->resolveReference(ret);} | |
| 86 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | |
| 87 // TODO(edisonn): warn about missing default value for optional fields | |
| 88 return 0; | |
| 89 } | |
| 90 | |
| 91 bool SkPdfType16HalftoneDictionary::has_Height2() const { | |
| 92 return get("Height2", "") != NULL; | |
| 93 } | |
| 94 | |
| 95 bool SkPdfType16HalftoneDictionary::isTransferFunctionAFunction(SkPdfNativeDoc*
doc) { | |
| 96 SkPdfNativeObject* ret = get("TransferFunction", ""); | |
| 97 if (doc) {ret = doc->resolveReference(ret);} | |
| 98 return ret != NULL && ret->isFunction(); | |
| 99 } | |
| 100 | |
| 101 SkPdfFunction SkPdfType16HalftoneDictionary::getTransferFunctionAsFunction(SkPdf
NativeDoc* doc) { | |
| 102 SkPdfNativeObject* ret = get("TransferFunction", ""); | |
| 103 if (doc) {ret = doc->resolveReference(ret);} | |
| 104 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); | |
| 105 // TODO(edisonn): warn about missing default value for optional fields | |
| 106 return SkPdfFunction(); | |
| 107 } | |
| 108 | |
| 109 bool SkPdfType16HalftoneDictionary::isTransferFunctionAName(SkPdfNativeDoc* doc)
{ | |
| 110 SkPdfNativeObject* ret = get("TransferFunction", ""); | |
| 111 if (doc) {ret = doc->resolveReference(ret);} | |
| 112 return ret != NULL && ret->isName(); | |
| 113 } | |
| 114 | |
| 115 SkString SkPdfType16HalftoneDictionary::getTransferFunctionAsName(SkPdfNativeDoc
* doc) { | |
| 116 SkPdfNativeObject* ret = get("TransferFunction", ""); | |
| 117 if (doc) {ret = doc->resolveReference(ret);} | |
| 118 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 119 // TODO(edisonn): warn about missing default value for optional fields | |
| 120 return SkString(); | |
| 121 } | |
| 122 | |
| 123 bool SkPdfType16HalftoneDictionary::has_TransferFunction() const { | |
| 124 return get("TransferFunction", "") != NULL; | |
| 125 } | |
| OLD | NEW |