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