OLD | NEW |
1 #ifndef __DEFINED__SkPdfType3ShadingDictionary | 1 #ifndef __DEFINED__SkPdfType3ShadingDictionary |
2 #define __DEFINED__SkPdfType3ShadingDictionary | 2 #define __DEFINED__SkPdfType3ShadingDictionary |
3 | 3 |
4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
6 #include "SkPdfShadingDictionary_autogen.h" | 6 #include "SkPdfShadingDictionary_autogen.h" |
7 | 7 |
| 8 // Additional entries specific to a type 3 shading dictionary |
8 class SkPdfType3ShadingDictionary : public SkPdfShadingDictionary { | 9 class SkPdfType3ShadingDictionary : public SkPdfShadingDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kType3ShadingDictionary_SkPdf
ObjectType;} | 11 virtual SkPdfObjectType getType() const { return kType3ShadingDictionary_SkPdf
ObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType3Sh
adingDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType3Sh
adingDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfType3ShadingDictionary* asType3ShadingDictionary() {return this;} | 14 virtual SkPdfType3ShadingDictionary* asType3ShadingDictionary() {return this;} |
14 virtual const SkPdfType3ShadingDictionary* asType3ShadingDictionary() const {r
eturn this;} | 15 virtual const SkPdfType3ShadingDictionary* asType3ShadingDictionary() const {r
eturn this;} |
15 | 16 |
16 private: | 17 private: |
17 virtual SkPdfType1ShadingDictionary* asType1ShadingDictionary() {return NULL;} | 18 virtual SkPdfType1ShadingDictionary* asType1ShadingDictionary() {return NULL;} |
(...skipping 13 matching lines...) Expand all Loading... |
31 | 32 |
32 public: | 33 public: |
33 private: | 34 private: |
34 public: | 35 public: |
35 SkPdfType3ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {} | 36 SkPdfType3ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {} |
36 | 37 |
37 virtual bool valid() const {return true;} | 38 virtual bool valid() const {return true;} |
38 | 39 |
39 SkPdfType3ShadingDictionary& operator=(const SkPdfType3ShadingDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} | 40 SkPdfType3ShadingDictionary& operator=(const SkPdfType3ShadingDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} |
40 | 41 |
| 42 /** (Required) An array of six numbers [ x0 y0 r0 x1 y1 r1 ] specifying the cent
ers and |
| 43 * radii of the starting and ending circles, expressed in the shading's target
coor- |
| 44 * dinate space. The radii r0 and r1 must both be greater than or equal to 0. I
f one |
| 45 * radius is 0, the corresponding circle is treated as a point; if both are 0,
nothing is |
| 46 * painted. |
| 47 **/ |
| 48 bool has_Coords() const { |
| 49 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coord
s", "", NULL)); |
| 50 } |
| 51 |
41 SkPdfArray Coords() const { | 52 SkPdfArray Coords() const { |
42 SkPdfArray ret; | 53 SkPdfArray ret; |
43 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", "
", &ret)) return ret; | 54 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", "
", &ret)) return ret; |
44 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 55 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
45 return SkPdfArray(); | 56 return SkPdfArray(); |
46 } | 57 } |
47 | 58 |
| 59 /** (Optional) An array of two numbers [ t0 t1 ] specifying the limiting values
of a |
| 60 * parametric variable t. The variable is considered to vary linearly between t
hese |
| 61 * two values as the color gradient varies between the starting and ending circ
les. |
| 62 * The variable t becomes the input argument to the color function(s). Default |
| 63 * value: [0.0 1.0]. |
| 64 **/ |
| 65 bool has_Domain() const { |
| 66 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domai
n", "", NULL)); |
| 67 } |
| 68 |
48 SkPdfArray Domain() const { | 69 SkPdfArray Domain() const { |
49 SkPdfArray ret; | 70 SkPdfArray ret; |
50 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "
", &ret)) return ret; | 71 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "
", &ret)) return ret; |
51 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 72 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
52 return SkPdfArray(); | 73 return SkPdfArray(); |
53 } | 74 } |
54 | 75 |
| 76 /** (Required) A 1-in, n-out function or an array of n 1-in, 1-out functions (wh
ere n |
| 77 * is the number of color components in the shading dictionary's color space).
The |
| 78 * function(s) are called with values of the parametric variable t in the domai
n de- |
| 79 * fined by the shading dictionary's Domain entry. Each function's domain must
be |
| 80 * a superset of that of the shading dictionary. If the value returned by the f
unction |
| 81 * for a given color component is out of range, it will be adjusted to the near
est |
| 82 * valid value. |
| 83 **/ |
| 84 bool has_Function() const { |
| 85 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct
ion", "", NULL)); |
| 86 } |
| 87 |
55 SkPdfFunction Function() const { | 88 SkPdfFunction Function() const { |
56 SkPdfFunction ret; | 89 SkPdfFunction ret; |
57 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio
n", "", &ret)) return ret; | 90 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio
n", "", &ret)) return ret; |
58 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 91 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
59 return SkPdfFunction(); | 92 return SkPdfFunction(); |
60 } | 93 } |
61 | 94 |
| 95 /** (Optional) An array of two boolean values specifying whether to extend the |
| 96 * shading beyond the starting and ending circles, respectively. Default value: |
| 97 * [false false]. |
| 98 **/ |
| 99 bool has_Extend() const { |
| 100 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Exten
d", "", NULL)); |
| 101 } |
| 102 |
62 SkPdfArray Extend() const { | 103 SkPdfArray Extend() const { |
63 SkPdfArray ret; | 104 SkPdfArray ret; |
64 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", "
", &ret)) return ret; | 105 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", "
", &ret)) return ret; |
65 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 106 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
66 return SkPdfArray(); | 107 return SkPdfArray(); |
67 } | 108 } |
68 | 109 |
69 }; | 110 }; |
70 | 111 |
71 #endif // __DEFINED__SkPdfType3ShadingDictionary | 112 #endif // __DEFINED__SkPdfType3ShadingDictionary |
OLD | NEW |