OLD | NEW |
1 #ifndef __DEFINED__SkPdfImageDictionary | 1 #ifndef __DEFINED__SkPdfImageDictionary |
2 #define __DEFINED__SkPdfImageDictionary | 2 #define __DEFINED__SkPdfImageDictionary |
3 | 3 |
4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
6 #include "SkPdfXObjectDictionary_autogen.h" | 6 #include "SkPdfXObjectDictionary_autogen.h" |
7 | 7 |
8 // Additional entries specific to an image dictionary | 8 // Additional entries specific to an image dictionary |
9 class SkPdfImageDictionary : public SkPdfXObjectDictionary { | 9 class SkPdfImageDictionary : public SkPdfXObjectDictionary { |
10 public: | 10 public: |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 bool has_Mask() const { | 180 bool has_Mask() const { |
181 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask"
, "", NULL)); | 181 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask"
, "", NULL)); |
182 } | 182 } |
183 | 183 |
184 bool isMaskAStream() const { | 184 bool isMaskAStream() const { |
185 SkPdfObject* ret = NULL; | 185 SkPdfObject* ret = NULL; |
186 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", "
", &ret)) return false; | 186 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", "
", &ret)) return false; |
187 return ret->podofo()->HasStream(); | 187 return ret->podofo()->HasStream(); |
188 } | 188 } |
189 | 189 |
190 SkPdfStream getMaskAsStream() const { | 190 SkPdfStream* getMaskAsStream() const { |
191 SkPdfStream ret = SkPdfStream(); | 191 SkPdfStream* ret = NULL; |
192 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", ""
, &ret)) return ret; | 192 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", ""
, &ret)) return ret; |
193 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 193 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
194 return SkPdfStream(); | 194 return NULL; |
195 } | 195 } |
196 | 196 |
197 bool isMaskAArray() const { | 197 bool isMaskAArray() const { |
198 SkPdfObject* ret = NULL; | 198 SkPdfObject* ret = NULL; |
199 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", "
", &ret)) return false; | 199 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", "
", &ret)) return false; |
200 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 200 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
201 } | 201 } |
202 | 202 |
203 SkPdfArray getMaskAsArray() const { | 203 SkPdfArray getMaskAsArray() const { |
204 SkPdfArray ret = SkPdfArray(); | 204 SkPdfArray ret = SkPdfArray(); |
(...skipping 10 matching lines...) Expand all Loading... |
215 * If present, this entry overrides the current soft mask in the graphics state
, | 215 * If present, this entry overrides the current soft mask in the graphics state
, |
216 * as well as the image's Mask entry, if any. (However, the other transparency- | 216 * as well as the image's Mask entry, if any. (However, the other transparency- |
217 * related graphics state parameters-blend mode and alpha constant- | 217 * related graphics state parameters-blend mode and alpha constant- |
218 * remain in effect.) If SMask is absent, the image has no associated soft mask | 218 * remain in effect.) If SMask is absent, the image has no associated soft mask |
219 * (although the current soft mask in the graphics state may still apply). | 219 * (although the current soft mask in the graphics state may still apply). |
220 **/ | 220 **/ |
221 bool has_SMask() const { | 221 bool has_SMask() const { |
222 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask
", "", NULL)); | 222 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask
", "", NULL)); |
223 } | 223 } |
224 | 224 |
225 SkPdfStream SMask() const { | 225 SkPdfStream* SMask() const { |
226 SkPdfStream ret; | 226 SkPdfStream* ret; |
227 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", "
", &ret)) return ret; | 227 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SMask", "
", &ret)) return ret; |
228 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 228 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
229 return SkPdfStream(); | 229 return NULL; |
230 } | 230 } |
231 | 231 |
232 /** (Optional) An array of numbers describing how to map image samples | 232 /** (Optional) An array of numbers describing how to map image samples |
233 * into the range of values appropriate for the image's color space (see | 233 * into the range of values appropriate for the image's color space (see |
234 * "Decode Arrays" on page 271). If ImageMask is true, the array must be | 234 * "Decode Arrays" on page 271). If ImageMask is true, the array must be |
235 * either [0 1] or [1 0]; otherwise, its length must be twice the number of | 235 * either [0 1] or [1 0]; otherwise, its length must be twice the number of |
236 * color components required by ColorSpace. Default value: see "Decode | 236 * color components required by ColorSpace. Default value: see "Decode |
237 * Arrays" on page 271. | 237 * Arrays" on page 271. |
238 **/ | 238 **/ |
239 bool has_Decode() const { | 239 bool has_Decode() const { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 return NULL; | 339 return NULL; |
340 } | 340 } |
341 | 341 |
342 /** (Optional; PDF 1.4) A metadata stream containing metadata for the image | 342 /** (Optional; PDF 1.4) A metadata stream containing metadata for the image |
343 * (see Section 9.2.2, "Metadata Streams"). | 343 * (see Section 9.2.2, "Metadata Streams"). |
344 **/ | 344 **/ |
345 bool has_Metadata() const { | 345 bool has_Metadata() const { |
346 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); | 346 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); |
347 } | 347 } |
348 | 348 |
349 SkPdfStream Metadata() const { | 349 SkPdfStream* Metadata() const { |
350 SkPdfStream ret; | 350 SkPdfStream* ret; |
351 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata"
, "", &ret)) return ret; | 351 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata"
, "", &ret)) return ret; |
352 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 352 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
353 return SkPdfStream(); | 353 return NULL; |
354 } | 354 } |
355 | 355 |
356 }; | 356 }; |
357 | 357 |
358 #endif // __DEFINED__SkPdfImageDictionary | 358 #endif // __DEFINED__SkPdfImageDictionary |
OLD | NEW |