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