OLD | NEW |
| (Empty) |
1 #ifndef __DEFINED__SkPdfType6ShadingDictionary | |
2 #define __DEFINED__SkPdfType6ShadingDictionary | |
3 | |
4 #include "SkPdfUtils.h" | |
5 #include "SkPdfEnums_autogen.h" | |
6 #include "SkPdfArray_autogen.h" | |
7 #include "SkPdfShadingDictionary_autogen.h" | |
8 | |
9 // Additional entries specific to a type 6 shading dictionary | |
10 class SkPdfType6ShadingDictionary : public SkPdfShadingDictionary { | |
11 public: | |
12 virtual SkPdfObjectType getType() const { return kType6ShadingDictionary_SkPdf
ObjectType;} | |
13 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType6Sh
adingDictionary_SkPdfObjectType + 1);} | |
14 public: | |
15 virtual SkPdfType6ShadingDictionary* asType6ShadingDictionary() {return this;} | |
16 virtual const SkPdfType6ShadingDictionary* asType6ShadingDictionary() const {r
eturn this;} | |
17 | |
18 private: | |
19 virtual SkPdfType1ShadingDictionary* asType1ShadingDictionary() {return NULL;} | |
20 virtual const SkPdfType1ShadingDictionary* asType1ShadingDictionary() const {r
eturn NULL;} | |
21 | |
22 virtual SkPdfType2ShadingDictionary* asType2ShadingDictionary() {return NULL;} | |
23 virtual const SkPdfType2ShadingDictionary* asType2ShadingDictionary() const {r
eturn NULL;} | |
24 | |
25 virtual SkPdfType3ShadingDictionary* asType3ShadingDictionary() {return NULL;} | |
26 virtual const SkPdfType3ShadingDictionary* asType3ShadingDictionary() const {r
eturn NULL;} | |
27 | |
28 virtual SkPdfType4ShadingDictionary* asType4ShadingDictionary() {return NULL;} | |
29 virtual const SkPdfType4ShadingDictionary* asType4ShadingDictionary() const {r
eturn NULL;} | |
30 | |
31 virtual SkPdfType5ShadingDictionary* asType5ShadingDictionary() {return NULL;} | |
32 virtual const SkPdfType5ShadingDictionary* asType5ShadingDictionary() const {r
eturn NULL;} | |
33 | |
34 public: | |
35 private: | |
36 public: | |
37 SkPdfType6ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {} | |
38 | |
39 SkPdfType6ShadingDictionary(const SkPdfType6ShadingDictionary& from) : SkPdfSh
adingDictionary(from.fPodofoDoc, from.fPodofoObj) {} | |
40 | |
41 virtual bool valid() const {return true;} | |
42 | |
43 SkPdfType6ShadingDictionary& operator=(const SkPdfType6ShadingDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} | |
44 | |
45 /** (Required) The number of bits used to represent each geometric coordi- | |
46 * nate. Valid values are 1, 2, 4, 8, 12, 16, 24, and 32. | |
47 **/ | |
48 bool has_BitsPerCoordinate() const { | |
49 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP
erCoordinate", "", NULL)); | |
50 } | |
51 | |
52 long BitsPerCoordinate() const; | |
53 /** (Required) The number of bits used to represent each color component. | |
54 * Valid values are 1, 2, 4, 8, 12, and 16. | |
55 **/ | |
56 bool has_BitsPerComponent() const { | |
57 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP
erComponent", "", NULL)); | |
58 } | |
59 | |
60 long BitsPerComponent() const; | |
61 /** (Required) The number of bits used to represent the edge flag for each | |
62 * patch (see below). Valid values of BitsPerFlag are 2, 4, and 8, but only the | |
63 * least significant 2 bits in each flag value are used. Valid values for the e
dge | |
64 * flag itself are 0, 1, 2, and 3. | |
65 **/ | |
66 bool has_BitsPerFlag() const { | |
67 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP
erFlag", "", NULL)); | |
68 } | |
69 | |
70 long BitsPerFlag() const; | |
71 /** (Required) An array of numbers specifying how to map coordinates and | |
72 * color components into the appropriate ranges of values. The decoding | |
73 * method is similar to that used in image dictionaries (see "Decode Arrays" | |
74 * on page 271). The ranges are specified as follows: | |
75 * [ xmin xmax ymin ymax c1,min c1,max ... cn,min cn,max ] | |
76 * Note that only one pair of c values should be specified if a Function entry | |
77 * is present. | |
78 **/ | |
79 bool has_Decode() const { | |
80 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod
e", "", NULL)); | |
81 } | |
82 | |
83 SkPdfArray* Decode() const; | |
84 /** (Optional) A 1-in, n-out function or an array of n 1-in, 1-out functions | |
85 * (where n is the number of color components in the shading dictionary's | |
86 * color space). If this entry is present, the color data for each vertex must
be | |
87 * specified by a single parametric variable rather than by n separate color | |
88 * components; the designated function(s) will be called with each interpo- | |
89 * lated value of the parametric variable to determine the actual color at each | |
90 * point. Each input value will be forced into the range interval specified for | |
91 * the corresponding color component in the shading dictionary's Decode | |
92 * array. Each function's domain must be a superset of that interval. If the | |
93 * value returned by the function for a given color component is out of | |
94 * range, it will be adjusted to the nearest valid value. | |
95 * This entry may not be used with an Indexed color space. | |
96 **/ | |
97 bool has_Function() const { | |
98 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct
ion", "", NULL)); | |
99 } | |
100 | |
101 SkPdfFunction Function() const; | |
102 }; | |
103 | |
104 #endif // __DEFINED__SkPdfType6ShadingDictionary | |
OLD | NEW |