| OLD | NEW |
| (Empty) |
| 1 #ifndef __DEFINED__SkPdfType5ShadingDictionary | |
| 2 #define __DEFINED__SkPdfType5ShadingDictionary | |
| 3 | |
| 4 #include "SkPdfEnums_autogen.h" | |
| 5 #include "SkPdfArray_autogen.h" | |
| 6 #include "SkPdfShadingDictionary_autogen.h" | |
| 7 | |
| 8 // Additional entries specific to a type 5 shading dictionary | |
| 9 class SkPdfType5ShadingDictionary : public SkPdfShadingDictionary { | |
| 10 public: | |
| 11 virtual SkPdfObjectType getType() const { return kType5ShadingDictionary_SkPdf
ObjectType;} | |
| 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType5Sh
adingDictionary_SkPdfObjectType + 1);} | |
| 13 public: | |
| 14 virtual SkPdfType5ShadingDictionary* asType5ShadingDictionary() {return this;} | |
| 15 virtual const SkPdfType5ShadingDictionary* asType5ShadingDictionary() const {r
eturn this;} | |
| 16 | |
| 17 private: | |
| 18 virtual SkPdfType1ShadingDictionary* asType1ShadingDictionary() {return NULL;} | |
| 19 virtual const SkPdfType1ShadingDictionary* asType1ShadingDictionary() const {r
eturn NULL;} | |
| 20 | |
| 21 virtual SkPdfType2ShadingDictionary* asType2ShadingDictionary() {return NULL;} | |
| 22 virtual const SkPdfType2ShadingDictionary* asType2ShadingDictionary() const {r
eturn NULL;} | |
| 23 | |
| 24 virtual SkPdfType3ShadingDictionary* asType3ShadingDictionary() {return NULL;} | |
| 25 virtual const SkPdfType3ShadingDictionary* asType3ShadingDictionary() const {r
eturn NULL;} | |
| 26 | |
| 27 virtual SkPdfType4ShadingDictionary* asType4ShadingDictionary() {return NULL;} | |
| 28 virtual const SkPdfType4ShadingDictionary* asType4ShadingDictionary() const {r
eturn NULL;} | |
| 29 | |
| 30 virtual SkPdfType6ShadingDictionary* asType6ShadingDictionary() {return NULL;} | |
| 31 virtual const SkPdfType6ShadingDictionary* asType6ShadingDictionary() const {r
eturn NULL;} | |
| 32 | |
| 33 public: | |
| 34 private: | |
| 35 public: | |
| 36 SkPdfType5ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {} | |
| 37 | |
| 38 virtual bool valid() const {return true;} | |
| 39 | |
| 40 SkPdfType5ShadingDictionary& operator=(const SkPdfType5ShadingDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} | |
| 41 | |
| 42 /** (Required) The number of bits used to represent each vertex coordinate. | |
| 43 * Valid values are 1, 2, 4, 8, 12, 16, 24, and 32. | |
| 44 **/ | |
| 45 bool has_BitsPerCoordinate() const { | |
| 46 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP
erCoordinate", "", NULL)); | |
| 47 } | |
| 48 | |
| 49 long BitsPerCoordinate() const { | |
| 50 long ret; | |
| 51 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsPerCoor
dinate", "", &ret)) return ret; | |
| 52 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 53 return 0; | |
| 54 } | |
| 55 | |
| 56 /** (Required) The number of bits used to represent each color component. | |
| 57 * Valid values are 1, 2, 4, 8, 12, and 16. | |
| 58 **/ | |
| 59 bool has_BitsPerComponent() const { | |
| 60 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP
erComponent", "", NULL)); | |
| 61 } | |
| 62 | |
| 63 long BitsPerComponent() const { | |
| 64 long ret; | |
| 65 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsPerComp
onent", "", &ret)) return ret; | |
| 66 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 67 return 0; | |
| 68 } | |
| 69 | |
| 70 /** (Required) The number of vertices in each row of the lattice; the value | |
| 71 * must be greater than or equal to 2. The number of rows need not be | |
| 72 * specified. | |
| 73 **/ | |
| 74 bool has_VerticesPerRow() const { | |
| 75 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Verti
cesPerRow", "", NULL)); | |
| 76 } | |
| 77 | |
| 78 long VerticesPerRow() const { | |
| 79 long ret; | |
| 80 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "VerticesPer
Row", "", &ret)) return ret; | |
| 81 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 82 return 0; | |
| 83 } | |
| 84 | |
| 85 /** (Required) An array of numbers specifying how to map vertex coordinates | |
| 86 * and color components into the appropriate ranges of values. The de- | |
| 87 * coding method is similar to that used in image dictionaries (see "Decode | |
| 88 * Arrays" on page 271). The ranges are specified as follows: | |
| 89 * [ xmin xmax ymin ymax c1,min c1,max ... cn,min cn,max ] | |
| 90 * Note that only one pair of c values should be specified if a Function entry | |
| 91 * is present. | |
| 92 **/ | |
| 93 bool has_Decode() const { | |
| 94 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod
e", "", NULL)); | |
| 95 } | |
| 96 | |
| 97 SkPdfArray Decode() const { | |
| 98 SkPdfArray ret; | |
| 99 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "
", &ret)) return ret; | |
| 100 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 101 return SkPdfArray(); | |
| 102 } | |
| 103 | |
| 104 /** (Optional) A 1-in, n-out function or an array of n 1-in, 1-out functions | |
| 105 * (where n is the number of color components in the shading dictionary's | |
| 106 * color space). If this entry is present, the color data for each vertex must
be | |
| 107 * specified by a single parametric variable rather than by n separate color | |
| 108 * components; the designated function(s) will be called with each interpo- | |
| 109 * lated value of the parametric variable to determine the actual color at each | |
| 110 * point. Each input value will be forced into the range interval specified for | |
| 111 * the corresponding color component in the shading dictionary's Decode | |
| 112 * array. Each function's domain must be a superset of that interval. If the | |
| 113 * value returned by the function for a given color component is out of | |
| 114 * range, it will be adjusted to the nearest valid value. | |
| 115 * This entry may not be used with an Indexed color space. | |
| 116 **/ | |
| 117 bool has_Function() const { | |
| 118 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct
ion", "", NULL)); | |
| 119 } | |
| 120 | |
| 121 SkPdfFunction Function() const { | |
| 122 SkPdfFunction ret; | |
| 123 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio
n", "", &ret)) return ret; | |
| 124 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 125 return SkPdfFunction(); | |
| 126 } | |
| 127 | |
| 128 }; | |
| 129 | |
| 130 #endif // __DEFINED__SkPdfType5ShadingDictionary | |
| OLD | NEW |