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