| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfType2ShadingDictionary | 1 #ifndef __DEFINED__SkPdfType2ShadingDictionary |
| 2 #define __DEFINED__SkPdfType2ShadingDictionary | 2 #define __DEFINED__SkPdfType2ShadingDictionary |
| 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 2 shading dictionary |
| 8 class SkPdfType2ShadingDictionary : public SkPdfShadingDictionary { | 9 class SkPdfType2ShadingDictionary : public SkPdfShadingDictionary { |
| 9 public: | 10 public: |
| 10 virtual SkPdfObjectType getType() const { return kType2ShadingDictionary_SkPdf
ObjectType;} | 11 virtual SkPdfObjectType getType() const { return kType2ShadingDictionary_SkPdf
ObjectType;} |
| 11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType2Sh
adingDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType2Sh
adingDictionary_SkPdfObjectType + 1);} |
| 12 public: | 13 public: |
| 13 virtual SkPdfType2ShadingDictionary* asType2ShadingDictionary() {return this;} | 14 virtual SkPdfType2ShadingDictionary* asType2ShadingDictionary() {return this;} |
| 14 virtual const SkPdfType2ShadingDictionary* asType2ShadingDictionary() const {r
eturn this;} | 15 virtual const SkPdfType2ShadingDictionary* asType2ShadingDictionary() 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 SkPdfType2ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {} | 36 SkPdfType2ShadingDictionary(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 SkPdfType2ShadingDictionary& operator=(const SkPdfType2ShadingDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} | 40 SkPdfType2ShadingDictionary& operator=(const SkPdfType2ShadingDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} |
| 40 | 41 |
| 42 /** (Required) An array of four numbers [ x0 y0 x1 y1 ] specifying the starting
and |
| 43 * ending coordinates of the axis, expressed in the shading's target coordinate |
| 44 * space. |
| 45 **/ |
| 46 bool has_Coords() const { |
| 47 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coord
s", "", NULL)); |
| 48 } |
| 49 |
| 41 SkPdfArray Coords() const { | 50 SkPdfArray Coords() const { |
| 42 SkPdfArray ret; | 51 SkPdfArray ret; |
| 43 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", "
", &ret)) return ret; | 52 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", "
", &ret)) return ret; |
| 44 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 53 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 45 return SkPdfArray(); | 54 return SkPdfArray(); |
| 46 } | 55 } |
| 47 | 56 |
| 57 /** (Optional) An array of two numbers [ t0 t1 ] specifying the limiting values
of a |
| 58 * parametric variable t. The variable is considered to vary linearly between t
hese |
| 59 * two values as the color gradient varies between the starting and ending poin
ts of |
| 60 * the axis. The variable t becomes the input argument to the color function(s)
. |
| 61 * Default value: [0.0 1.0]. |
| 62 **/ |
| 63 bool has_Domain() const { |
| 64 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domai
n", "", NULL)); |
| 65 } |
| 66 |
| 48 SkPdfArray Domain() const { | 67 SkPdfArray Domain() const { |
| 49 SkPdfArray ret; | 68 SkPdfArray ret; |
| 50 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "
", &ret)) return ret; | 69 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "
", &ret)) return ret; |
| 51 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 70 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 52 return SkPdfArray(); | 71 return SkPdfArray(); |
| 53 } | 72 } |
| 54 | 73 |
| 74 /** (Required) A 1-in, n-out function or an array of n 1-in, 1-out functions (wh
ere n |
| 75 * is the number of color components in the shading dictionary's color space).
The |
| 76 * function(s) are called with values of the parametric variable t in the domai
n de- |
| 77 * fined by the Domain entry. Each function's domain must be a superset of that
of |
| 78 * the shading dictionary. If the value returned by the function for a given co
lor |
| 79 * component is out of range, it will be adjusted to the nearest valid value. |
| 80 **/ |
| 81 bool has_Function() const { |
| 82 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct
ion", "", NULL)); |
| 83 } |
| 84 |
| 55 SkPdfFunction Function() const { | 85 SkPdfFunction Function() const { |
| 56 SkPdfFunction ret; | 86 SkPdfFunction ret; |
| 57 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio
n", "", &ret)) return ret; | 87 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio
n", "", &ret)) return ret; |
| 58 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 88 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 59 return SkPdfFunction(); | 89 return SkPdfFunction(); |
| 60 } | 90 } |
| 61 | 91 |
| 92 /** (Optional) An array of two boolean values specifying whether to extend the |
| 93 * shading beyond the starting and ending points of the axis, respectively. Def
ault |
| 94 * value: [false false]. |
| 95 **/ |
| 96 bool has_Extend() const { |
| 97 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Exten
d", "", NULL)); |
| 98 } |
| 99 |
| 62 SkPdfArray Extend() const { | 100 SkPdfArray Extend() const { |
| 63 SkPdfArray ret; | 101 SkPdfArray ret; |
| 64 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", "
", &ret)) return ret; | 102 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", "
", &ret)) return ret; |
| 65 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 103 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 66 return SkPdfArray(); | 104 return SkPdfArray(); |
| 67 } | 105 } |
| 68 | 106 |
| 69 }; | 107 }; |
| 70 | 108 |
| 71 #endif // __DEFINED__SkPdfType2ShadingDictionary | 109 #endif // __DEFINED__SkPdfType2ShadingDictionary |
| OLD | NEW |