Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfImageDictionary_autogen.h

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #ifndef __DEFINED__SkPdfImageDictionary 1 #ifndef __DEFINED__SkPdfImageDictionary
2 #define __DEFINED__SkPdfImageDictionary 2 #define __DEFINED__SkPdfImageDictionary
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 "SkPdfXObjectDictionary_autogen.h" 7 #include "SkPdfXObjectDictionary_autogen.h"
8 8
9 // Additional entries specific to an image dictionary 9 // Additional entries specific to an image dictionary
10 class SkPdfImageDictionary : public SkPdfXObjectDictionary { 10 class SkPdfImageDictionary : public SkPdfXObjectDictionary {
(...skipping 19 matching lines...) Expand all
30 30
31 SkPdfImageDictionary& operator=(const SkPdfImageDictionary& from) {this->fPodo foDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} 31 SkPdfImageDictionary& operator=(const SkPdfImageDictionary& from) {this->fPodo foDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
32 32
33 /** (Optional) The type of PDF object that this dictionary describes; if 33 /** (Optional) The type of PDF object that this dictionary describes; if
34 * present, must be XObject for an image XObject. 34 * present, must be XObject for an image XObject.
35 **/ 35 **/
36 bool has_Type() const { 36 bool has_Type() const {
37 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type" , "", NULL)); 37 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type" , "", NULL));
38 } 38 }
39 39
40 std::string Type() const { 40 std::string Type() const;
41 std::string ret;
42 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret;
43 // TODO(edisonn): warn about missing required field, assert for known good p dfs
44 return "";
45 }
46
47 /** (Required) The type of XObject that this dictionary describes; must be 41 /** (Required) The type of XObject that this dictionary describes; must be
48 * Image for an image XObject. 42 * Image for an image XObject.
49 **/ 43 **/
50 bool has_Subtype() const { 44 bool has_Subtype() const {
51 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty pe", "", NULL)); 45 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty pe", "", NULL));
52 } 46 }
53 47
54 std::string Subtype() const { 48 std::string Subtype() const;
55 std::string ret;
56 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", " ", &ret)) return ret;
57 // TODO(edisonn): warn about missing required field, assert for known good p dfs
58 return "";
59 }
60
61 /** (Required) The width of the image, in samples. 49 /** (Required) The width of the image, in samples.
62 **/ 50 **/
63 bool has_Width() const { 51 bool has_Width() const {
64 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width ", "", NULL)); 52 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width ", "", NULL));
65 } 53 }
66 54
67 long Width() const { 55 long Width() const;
68 long ret;
69 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width", "", &ret)) return ret;
70 // TODO(edisonn): warn about missing required field, assert for known good p dfs
71 return 0;
72 }
73
74 /** (Required) The height of the image, in samples. 56 /** (Required) The height of the image, in samples.
75 **/ 57 **/
76 bool has_Height() const { 58 bool has_Height() const {
77 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Heigh t", "", NULL)); 59 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Heigh t", "", NULL));
78 } 60 }
79 61
80 long Height() const { 62 long Height() const;
81 long ret;
82 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Height", "" , &ret)) return ret;
83 // TODO(edisonn): warn about missing required field, assert for known good p dfs
84 return 0;
85 }
86
87 /** (Required except for image masks; not allowed for image masks) The color 63 /** (Required except for image masks; not allowed for image masks) The color
88 * space in which image samples are specified. This may be any type of color 64 * space in which image samples are specified. This may be any type of color
89 * space except Pattern. 65 * space except Pattern.
90 **/ 66 **/
91 bool has_ColorSpace() const { 67 bool has_ColorSpace() const {
92 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Color Space", "", NULL)); 68 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Color Space", "", NULL));
93 } 69 }
94 70
95 bool isColorSpaceAName() const { 71 bool isColorSpaceAName() const {
96 SkPdfObject* ret = NULL; 72 SkPdfObject* ret = NULL;
97 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpa ce", "", &ret)) return false; 73 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpa ce", "", &ret)) return false;
98 return ret->podofo()->GetDataType() == ePdfDataType_Name; 74 return ret->podofo()->GetDataType() == ePdfDataType_Name;
99 } 75 }
100 76
101 std::string getColorSpaceAsName() const { 77 std::string getColorSpaceAsName() const;
102 std::string ret = "";
103 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace" , "", &ret)) return ret;
104 // TODO(edisonn): warn about missing required field, assert for known good p dfs
105 return "";
106 }
107
108 bool isColorSpaceAArray() const { 78 bool isColorSpaceAArray() const {
109 SkPdfObject* ret = NULL; 79 SkPdfObject* ret = NULL;
110 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpa ce", "", &ret)) return false; 80 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpa ce", "", &ret)) return false;
111 return ret->podofo()->GetDataType() == ePdfDataType_Array; 81 return ret->podofo()->GetDataType() == ePdfDataType_Array;
112 } 82 }
113 83
114 SkPdfArray* getColorSpaceAsArray() const { 84 SkPdfArray* getColorSpaceAsArray() const;
115 SkPdfArray* ret = NULL;
116 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace ", "", &ret)) return ret;
117 // TODO(edisonn): warn about missing required field, assert for known good p dfs
118 return NULL;
119 }
120
121 /** (Required except for image masks; optional for image masks) The number of 85 /** (Required except for image masks; optional for image masks) The number of
122 * bits used to represent each color component. Only a single value may be 86 * bits used to represent each color component. Only a single value may be
123 * specified; the number of bits is the same for all color components. Valid 87 * specified; the number of bits is the same for all color components. Valid
124 * values are 1, 2, 4, and 8. If ImageMask is true, this entry is optional, and if 88 * values are 1, 2, 4, and 8. If ImageMask is true, this entry is optional, and if
125 * specified, its value must be 1. 89 * specified, its value must be 1.
126 * If the image stream uses a filter, the value of BitsPerComponent must be 90 * If the image stream uses a filter, the value of BitsPerComponent must be
127 * consistent with the size of the data samples that the filter delivers. In pa r- 91 * consistent with the size of the data samples that the filter delivers. In pa r-
128 * ticular, a CCITTFaxDecode or JBIG2Decode filter always delivers 1-bit sam- 92 * ticular, a CCITTFaxDecode or JBIG2Decode filter always delivers 1-bit sam-
129 * ples, a RunLengthDecode or DCTDecode filter delivers 8-bit samples, and 93 * ples, a RunLengthDecode or DCTDecode filter delivers 8-bit samples, and
130 * an LZWDecode or FlateDecode filter delivers samples of a specified size if 94 * an LZWDecode or FlateDecode filter delivers samples of a specified size if
131 * a predictor function is used. 95 * a predictor function is used.
132 **/ 96 **/
133 bool has_BitsPerComponent() const { 97 bool has_BitsPerComponent() const {
134 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP erComponent", "", NULL)); 98 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP erComponent", "", NULL));
135 } 99 }
136 100
137 long BitsPerComponent() const { 101 long BitsPerComponent() const;
138 long ret;
139 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsPerComp onent", "", &ret)) return ret;
140 // TODO(edisonn): warn about missing required field, assert for known good p dfs
141 return 0;
142 }
143
144 /** (Optional; PDF 1.1) The name of a color rendering intent to be used in 102 /** (Optional; PDF 1.1) The name of a color rendering intent to be used in
145 * rendering the image (see "Rendering Intents" on page 197). Default value: 103 * rendering the image (see "Rendering Intents" on page 197). Default value:
146 * the current rendering intent in the graphics state. 104 * the current rendering intent in the graphics state.
147 **/ 105 **/
148 bool has_Intent() const { 106 bool has_Intent() const {
149 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Inten t", "", NULL)); 107 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Inten t", "", NULL));
150 } 108 }
151 109
152 std::string Intent() const { 110 std::string Intent() const;
153 std::string ret;
154 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Intent", "" , &ret)) return ret;
155 // TODO(edisonn): warn about missing required field, assert for known good p dfs
156 return "";
157 }
158
159 /** (Optional) A flag indicating whether the image is to be treated as an image 111 /** (Optional) A flag indicating whether the image is to be treated as an image
160 * mask (see Section 4.8.5, "Masked Images"). If this flag is true, the value o f 112 * mask (see Section 4.8.5, "Masked Images"). If this flag is true, the value o f
161 * BitsPerComponent must be 1 and Mask and ColorSpace should not be 113 * BitsPerComponent must be 1 and Mask and ColorSpace should not be
162 * specified; unmasked areas will be painted using the current nonstroking 114 * specified; unmasked areas will be painted using the current nonstroking
163 * color. Default value: false. 115 * color. Default value: false.
164 **/ 116 **/
165 bool has_ImageMask() const { 117 bool has_ImageMask() const {
166 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Image Mask", "", NULL)); 118 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Image Mask", "", NULL));
167 } 119 }
168 120
169 bool ImageMask() const { 121 bool ImageMask() const;
170 bool ret;
171 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ImageMask", "", &ret)) return ret;
172 // TODO(edisonn): warn about missing required field, assert for known good p dfs
173 return false;
174 }
175
176 /** (Optional except for image masks; not allowed for image masks; PDF 1.3) An 122 /** (Optional except for image masks; not allowed for image masks; PDF 1.3) An
177 * image XObject defining an image mask to be applied to this image (see 123 * image XObject defining an image mask to be applied to this image (see
178 * "Explicit Masking" on page 277), or an array specifying a range of colors 124 * "Explicit Masking" on page 277), or an array specifying a range of colors
179 * to be applied to it as a color key mask (see "Color Key Masking" on page 125 * to be applied to it as a color key mask (see "Color Key Masking" on page
180 * 277). If ImageMask is true, this entry must not be present. (See 126 * 277). If ImageMask is true, this entry must not be present. (See
181 * implementation note 35 in Appendix H.) 127 * implementation note 35 in Appendix H.)
182 **/ 128 **/
183 bool has_Mask() const { 129 bool has_Mask() const {
184 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask" , "", NULL)); 130 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask" , "", NULL));
185 } 131 }
186 132
187 bool isMaskAStream() const { 133 bool isMaskAStream() const {
188 SkPdfObject* ret = NULL; 134 SkPdfObject* ret = NULL;
189 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", " ", &ret)) return false; 135 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", " ", &ret)) return false;
190 return ret->podofo()->HasStream(); 136 return ret->podofo()->HasStream();
191 } 137 }
192 138
193 SkPdfStream* getMaskAsStream() const { 139 SkPdfStream* getMaskAsStream() const;
194 SkPdfStream* ret = NULL;
195 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", "" , &ret)) return ret;
196 // TODO(edisonn): warn about missing required field, assert for known good p dfs
197 return NULL;
198 }
199
200 bool isMaskAArray() const { 140 bool isMaskAArray() const {
201 SkPdfObject* ret = NULL; 141 SkPdfObject* ret = NULL;
202 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", " ", &ret)) return false; 142 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", " ", &ret)) return false;
203 return ret->podofo()->GetDataType() == ePdfDataType_Array; 143 return ret->podofo()->GetDataType() == ePdfDataType_Array;
204 } 144 }
205 145
206 SkPdfArray* getMaskAsArray() const { 146 SkPdfArray* getMaskAsArray() const;
207 SkPdfArray* ret = NULL;
208 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", "", &ret)) return ret;
209 // TODO(edisonn): warn about missing required field, assert for known good p dfs
210 return NULL;
211 }
212
213 /** (Optional; PDF 1.4) A subsidiary image XObject defining a soft-mask 147 /** (Optional; PDF 1.4) A subsidiary image XObject defining a soft-mask
214 * image (see "Soft-Mask Images" on page 447) to be used as a source of 148 * image (see "Soft-Mask Images" on page 447) to be used as a source of
215 * mask shape or mask opacity values in the transparent imaging model. The 149 * mask shape or mask opacity values in the transparent imaging model. The
216 * alpha source parameter in the graphics state determines whether the mask 150 * alpha source parameter in the graphics state determines whether the mask
217 * values are interpreted as shape or opacity. 151 * values are interpreted as shape or opacity.
218 * If present, this entry overrides the current soft mask in the graphics state , 152 * If present, this entry overrides the current soft mask in the graphics state ,
219 * as well as the image's Mask entry, if any. (However, the other transparency- 153 * as well as the image's Mask entry, if any. (However, the other transparency-
220 * related graphics state parameters-blend mode and alpha constant- 154 * related graphics state parameters-blend mode and alpha constant-
221 * remain in effect.) If SMask is absent, the image has no associated soft mask 155 * remain in effect.) If SMask is absent, the image has no associated soft mask
222 * (although the current soft mask in the graphics state may still apply). 156 * (although the current soft mask in the graphics state may still apply).
223 **/ 157 **/
224 bool has_SMask() const { 158 bool has_SMask() const {
225 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask ", "", NULL)); 159 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask ", "", NULL));
226 } 160 }
227 161
228 SkPdfStream* SMask() const { 162 SkPdfStream* SMask() const;
229 SkPdfStream* ret;
230 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", " ", &ret)) return ret;
231 // TODO(edisonn): warn about missing required field, assert for known good p dfs
232 return NULL;
233 }
234
235 /** (Optional) An array of numbers describing how to map image samples 163 /** (Optional) An array of numbers describing how to map image samples
236 * into the range of values appropriate for the image's color space (see 164 * into the range of values appropriate for the image's color space (see
237 * "Decode Arrays" on page 271). If ImageMask is true, the array must be 165 * "Decode Arrays" on page 271). If ImageMask is true, the array must be
238 * either [0 1] or [1 0]; otherwise, its length must be twice the number of 166 * either [0 1] or [1 0]; otherwise, its length must be twice the number of
239 * color components required by ColorSpace. Default value: see "Decode 167 * color components required by ColorSpace. Default value: see "Decode
240 * Arrays" on page 271. 168 * Arrays" on page 271.
241 **/ 169 **/
242 bool has_Decode() const { 170 bool has_Decode() const {
243 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod e", "", NULL)); 171 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod e", "", NULL));
244 } 172 }
245 173
246 SkPdfArray* Decode() const { 174 SkPdfArray* Decode() const;
247 SkPdfArray* ret;
248 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", " ", &ret)) return ret;
249 // TODO(edisonn): warn about missing required field, assert for known good p dfs
250 return NULL;
251 }
252
253 /** (Optional) A flag indicating whether image interpolation is to be per- 175 /** (Optional) A flag indicating whether image interpolation is to be per-
254 * formed (see "Image Interpolation" on page 273). Default value: false. 176 * formed (see "Image Interpolation" on page 273). Default value: false.
255 **/ 177 **/
256 bool has_Interpolate() const { 178 bool has_Interpolate() const {
257 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Inter polate", "", NULL)); 179 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Inter polate", "", NULL));
258 } 180 }
259 181
260 bool Interpolate() const { 182 bool Interpolate() const;
261 bool ret;
262 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Interpolate ", "", &ret)) return ret;
263 // TODO(edisonn): warn about missing required field, assert for known good p dfs
264 return false;
265 }
266
267 /** (Optional; PDF 1.3) An array of alternate image dictionaries for this image 183 /** (Optional; PDF 1.3) An array of alternate image dictionaries for this image
268 * (see "Alternate Images" on page 273). The order of elements within the 184 * (see "Alternate Images" on page 273). The order of elements within the
269 * array has no significance. This entry may not be present in an image 185 * array has no significance. This entry may not be present in an image
270 * XObject that is itself an alternate image. 186 * XObject that is itself an alternate image.
271 **/ 187 **/
272 bool has_Alternates() const { 188 bool has_Alternates() const {
273 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alter nates", "", NULL)); 189 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alter nates", "", NULL));
274 } 190 }
275 191
276 SkPdfArray* Alternates() const { 192 SkPdfArray* Alternates() const;
277 SkPdfArray* ret;
278 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternates ", "", &ret)) return ret;
279 // TODO(edisonn): warn about missing required field, assert for known good p dfs
280 return NULL;
281 }
282
283 /** (Required in PDF 1.0; optional otherwise) The name by which this image 193 /** (Required in PDF 1.0; optional otherwise) The name by which this image
284 * XObject is referenced in the XObject subdictionary of the current resource 194 * XObject is referenced in the XObject subdictionary of the current resource
285 * dictionary (see Section 3.7.2, "Resource Dictionaries"). 195 * dictionary (see Section 3.7.2, "Resource Dictionaries").
286 * Note: This entry is obsolescent and its use is no longer recommended. (See 196 * Note: This entry is obsolescent and its use is no longer recommended. (See
287 * implementation note 36 in Appendix H.) 197 * implementation note 36 in Appendix H.)
288 **/ 198 **/
289 bool has_Name() const { 199 bool has_Name() const {
290 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name" , "", NULL)); 200 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name" , "", NULL));
291 } 201 }
292 202
293 std::string Name() const { 203 std::string Name() const;
294 std::string ret;
295 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "", &ret)) return ret;
296 // TODO(edisonn): warn about missing required field, assert for known good p dfs
297 return "";
298 }
299
300 /** (Required if the image is a structural content item; PDF 1.3) The integer ke y 204 /** (Required if the image is a structural content item; PDF 1.3) The integer ke y
301 * of the image's entry in the structural parent tree (see "Finding Structure 205 * of the image's entry in the structural parent tree (see "Finding Structure
302 * Elements from Content Items" on page 600). 206 * Elements from Content Items" on page 600).
303 **/ 207 **/
304 bool has_StructParent() const { 208 bool has_StructParent() const {
305 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc tParent", "", NULL)); 209 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc tParent", "", NULL));
306 } 210 }
307 211
308 long StructParent() const { 212 long StructParent() const;
309 long ret;
310 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StructParen t", "", &ret)) return ret;
311 // TODO(edisonn): warn about missing required field, assert for known good p dfs
312 return 0;
313 }
314
315 /** (Optional; PDF 1.3; indirect reference preferred) The digital identifier of the 213 /** (Optional; PDF 1.3; indirect reference preferred) The digital identifier of the
316 * image's parent Web Capture content set (see Section 9.9.5, "Object At- 214 * image's parent Web Capture content set (see Section 9.9.5, "Object At-
317 * tributes Related to Web Capture"). 215 * tributes Related to Web Capture").
318 **/ 216 **/
319 bool has_ID() const { 217 bool has_ID() const {
320 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", NULL)); 218 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", NULL));
321 } 219 }
322 220
323 std::string ID() const { 221 std::string ID() const;
324 std::string ret;
325 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", &ret)) return ret;
326 // TODO(edisonn): warn about missing required field, assert for known good p dfs
327 return "";
328 }
329
330 /** (Optional; PDF 1.2) An OPI version dictionary for the image (see Section 222 /** (Optional; PDF 1.2) An OPI version dictionary for the image (see Section
331 * 9.10.6, "Open Prepress Interface (OPI)"). If ImageMask is true, this entry 223 * 9.10.6, "Open Prepress Interface (OPI)"). If ImageMask is true, this entry
332 * is ignored. 224 * is ignored.
333 **/ 225 **/
334 bool has_OPI() const { 226 bool has_OPI() const {
335 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OPI", "", NULL)); 227 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OPI", "", NULL));
336 } 228 }
337 229
338 SkPdfDictionary* OPI() const { 230 SkPdfDictionary* OPI() const;
339 SkPdfDictionary* ret;
340 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OPI", "", &ret)) return ret;
341 // TODO(edisonn): warn about missing required field, assert for known good p dfs
342 return NULL;
343 }
344
345 /** (Optional; PDF 1.4) A metadata stream containing metadata for the image 231 /** (Optional; PDF 1.4) A metadata stream containing metadata for the image
346 * (see Section 9.2.2, "Metadata Streams"). 232 * (see Section 9.2.2, "Metadata Streams").
347 **/ 233 **/
348 bool has_Metadata() const { 234 bool has_Metadata() const {
349 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad ata", "", NULL)); 235 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad ata", "", NULL));
350 } 236 }
351 237
352 SkPdfStream* Metadata() const { 238 SkPdfStream* Metadata() const;
353 SkPdfStream* ret;
354 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata" , "", &ret)) return ret;
355 // TODO(edisonn): warn about missing required field, assert for known good p dfs
356 return NULL;
357 }
358
359 }; 239 };
360 240
361 #endif // __DEFINED__SkPdfImageDictionary 241 #endif // __DEFINED__SkPdfImageDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698