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 "SkPdfType1HalftoneDictionary_autogen.h" | |
9 #include "SkPdfNativeDoc.h" | |
10 | |
11 SkString SkPdfType1HalftoneDictionary::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 SkPdfType1HalftoneDictionary::has_Type() const { | |
20 return get("Type", "") != NULL; | |
21 } | |
22 | |
23 int64_t SkPdfType1HalftoneDictionary::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 SkPdfType1HalftoneDictionary::has_HalftoneType() const { | |
32 return get("HalftoneType", "") != NULL; | |
33 } | |
34 | |
35 SkString SkPdfType1HalftoneDictionary::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 SkPdfType1HalftoneDictionary::has_HalftoneName() const { | |
44 return get("HalftoneName", "") != NULL; | |
45 } | |
46 | |
47 double SkPdfType1HalftoneDictionary::Frequency(SkPdfNativeDoc* doc) { | |
48 SkPdfNativeObject* ret = get("Frequency", ""); | |
49 if (doc) {ret = doc->resolveReference(ret);} | |
50 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
51 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
52 return 0; | |
53 } | |
54 | |
55 bool SkPdfType1HalftoneDictionary::has_Frequency() const { | |
56 return get("Frequency", "") != NULL; | |
57 } | |
58 | |
59 double SkPdfType1HalftoneDictionary::Angle(SkPdfNativeDoc* doc) { | |
60 SkPdfNativeObject* ret = get("Angle", ""); | |
61 if (doc) {ret = doc->resolveReference(ret);} | |
62 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
63 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
64 return 0; | |
65 } | |
66 | |
67 bool SkPdfType1HalftoneDictionary::has_Angle() const { | |
68 return get("Angle", "") != NULL; | |
69 } | |
70 | |
71 bool SkPdfType1HalftoneDictionary::isSpotFunctionAFunction(SkPdfNativeDoc* doc)
{ | |
72 SkPdfNativeObject* ret = get("SpotFunction", ""); | |
73 if (doc) {ret = doc->resolveReference(ret);} | |
74 return ret != NULL && ret->isFunction(); | |
75 } | |
76 | |
77 SkPdfFunction SkPdfType1HalftoneDictionary::getSpotFunctionAsFunction(SkPdfNativ
eDoc* doc) { | |
78 SkPdfNativeObject* ret = get("SpotFunction", ""); | |
79 if (doc) {ret = doc->resolveReference(ret);} | |
80 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); | |
81 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
82 return SkPdfFunction(); | |
83 } | |
84 | |
85 bool SkPdfType1HalftoneDictionary::isSpotFunctionAName(SkPdfNativeDoc* doc) { | |
86 SkPdfNativeObject* ret = get("SpotFunction", ""); | |
87 if (doc) {ret = doc->resolveReference(ret);} | |
88 return ret != NULL && ret->isName(); | |
89 } | |
90 | |
91 SkString SkPdfType1HalftoneDictionary::getSpotFunctionAsName(SkPdfNativeDoc* doc
) { | |
92 SkPdfNativeObject* ret = get("SpotFunction", ""); | |
93 if (doc) {ret = doc->resolveReference(ret);} | |
94 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
95 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
96 return SkString(); | |
97 } | |
98 | |
99 bool SkPdfType1HalftoneDictionary::has_SpotFunction() const { | |
100 return get("SpotFunction", "") != NULL; | |
101 } | |
102 | |
103 bool SkPdfType1HalftoneDictionary::AccurateScreens(SkPdfNativeDoc* doc) { | |
104 SkPdfNativeObject* ret = get("AccurateScreens", ""); | |
105 if (doc) {ret = doc->resolveReference(ret);} | |
106 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); | |
107 // TODO(edisonn): warn about missing default value for optional fields | |
108 return false; | |
109 } | |
110 | |
111 bool SkPdfType1HalftoneDictionary::has_AccurateScreens() const { | |
112 return get("AccurateScreens", "") != NULL; | |
113 } | |
114 | |
115 bool SkPdfType1HalftoneDictionary::isTransferFunctionAFunction(SkPdfNativeDoc* d
oc) { | |
116 SkPdfNativeObject* ret = get("TransferFunction", ""); | |
117 if (doc) {ret = doc->resolveReference(ret);} | |
118 return ret != NULL && ret->isFunction(); | |
119 } | |
120 | |
121 SkPdfFunction SkPdfType1HalftoneDictionary::getTransferFunctionAsFunction(SkPdfN
ativeDoc* doc) { | |
122 SkPdfNativeObject* ret = get("TransferFunction", ""); | |
123 if (doc) {ret = doc->resolveReference(ret);} | |
124 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); | |
125 // TODO(edisonn): warn about missing default value for optional fields | |
126 return SkPdfFunction(); | |
127 } | |
128 | |
129 bool SkPdfType1HalftoneDictionary::isTransferFunctionAName(SkPdfNativeDoc* doc)
{ | |
130 SkPdfNativeObject* ret = get("TransferFunction", ""); | |
131 if (doc) {ret = doc->resolveReference(ret);} | |
132 return ret != NULL && ret->isName(); | |
133 } | |
134 | |
135 SkString SkPdfType1HalftoneDictionary::getTransferFunctionAsName(SkPdfNativeDoc*
doc) { | |
136 SkPdfNativeObject* ret = get("TransferFunction", ""); | |
137 if (doc) {ret = doc->resolveReference(ret);} | |
138 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
139 // TODO(edisonn): warn about missing default value for optional fields | |
140 return SkString(); | |
141 } | |
142 | |
143 bool SkPdfType1HalftoneDictionary::has_TransferFunction() const { | |
144 return get("TransferFunction", "") != NULL; | |
145 } | |
OLD | NEW |