Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfType4ShadingDictionary_autogen.h

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #ifndef __DEFINED__SkPdfType4ShadingDictionary 1 #ifndef __DEFINED__SkPdfType4ShadingDictionary
2 #define __DEFINED__SkPdfType4ShadingDictionary 2 #define __DEFINED__SkPdfType4ShadingDictionary
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 4 shading dictionary 9 // Additional entries specific to a type 4 shading dictionary
10 class SkPdfType4ShadingDictionary : public SkPdfShadingDictionary { 10 class SkPdfType4ShadingDictionary : public SkPdfShadingDictionary {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 SkPdfType4ShadingDictionary& operator=(const SkPdfType4ShadingDictionary& from ) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur n *this;} 43 SkPdfType4ShadingDictionary& operator=(const SkPdfType4ShadingDictionary& 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 bits used to represent the edge flag for each ver- 61 /** (Required) The number of bits used to represent the edge flag for each ver-
74 * tex (see below). Valid values of BitsPerFlag are 2, 4, and 8, but only the 62 * tex (see below). Valid values of BitsPerFlag are 2, 4, and 8, but only the
75 * least significant 2 bits in each flag value are used. Valid values for the e dge 63 * least significant 2 bits in each flag value are used. Valid values for the e dge
76 * flag itself are 0, 1, and 2. 64 * flag itself are 0, 1, and 2.
77 **/ 65 **/
78 bool has_BitsPerFlag() const { 66 bool has_BitsPerFlag() const {
79 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP erFlag", "", NULL)); 67 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsP erFlag", "", NULL));
80 } 68 }
81 69
82 long BitsPerFlag() const { 70 long BitsPerFlag() const;
83 long ret;
84 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BitsPerFlag ", "", &ret)) return ret;
85 // TODO(edisonn): warn about missing required field, assert for known good p dfs
86 return 0;
87 }
88
89 /** (Required) An array of numbers specifying how to map vertex coordinates 71 /** (Required) An array of numbers specifying how to map vertex coordinates
90 * and color components into the appropriate ranges of values. The de- 72 * and color components into the appropriate ranges of values. The de-
91 * coding method is similar to that used in image dictionaries (see "Decode 73 * coding method is similar to that used in image dictionaries (see "Decode
92 * Arrays" on page 271). The ranges are specified as follows: 74 * Arrays" on page 271). The ranges are specified as follows:
93 * [ xmin xmax ymin ymax c1,min c1,max ... cn,min cn,max ] 75 * [ xmin xmax ymin ymax c1,min c1,max ... cn,min cn,max ]
94 * Note that only one pair of c values should be specified if a Function entry 76 * Note that only one pair of c values should be specified if a Function entry
95 * is present. 77 * is present.
96 **/ 78 **/
97 bool has_Decode() const { 79 bool has_Decode() const {
98 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod e", "", NULL)); 80 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod e", "", NULL));
99 } 81 }
100 82
101 SkRect* Decode() const { 83 SkRect* Decode() const;
102 SkRect* ret;
103 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", &ret)) return ret;
104 // TODO(edisonn): warn about missing required field, assert for known good p dfs
105 return NULL;
106 }
107
108 /** (Optional) A 1-in, n-out function or an array of n 1-in, 1-out functions 84 /** (Optional) A 1-in, n-out function or an array of n 1-in, 1-out functions
109 * (where n is the number of color components in the shading dictionary's 85 * (where n is the number of color components in the shading dictionary's
110 * color space). If this entry is present, the color data for each vertex must be 86 * color space). If this entry is present, the color data for each vertex must be
111 * specified by a single parametric variable rather than by n separate color 87 * specified by a single parametric variable rather than by n separate color
112 * components; the designated function(s) will be called with each interpo- 88 * components; the designated function(s) will be called with each interpo-
113 * lated value of the parametric variable to determine the actual color at each 89 * lated value of the parametric variable to determine the actual color at each
114 * point. Each input value will be forced into the range interval specified for 90 * point. Each input value will be forced into the range interval specified for
115 * the corresponding color component in the shading dictionary's Decode 91 * the corresponding color component in the shading dictionary's Decode
116 * array. Each function's domain must be a superset of that interval. If the 92 * array. Each function's domain must be a superset of that interval. If the
117 * value returned by the function for a given color component is out of 93 * value returned by the function for a given color component is out of
118 * range, it will be adjusted to the nearest valid value. 94 * range, it will be adjusted to the nearest valid value.
119 * This entry may not be used with an Indexed color space. 95 * This entry may not be used with an Indexed color space.
120 **/ 96 **/
121 bool has_Function() const { 97 bool has_Function() const {
122 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct ion", "", NULL)); 98 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct ion", "", NULL));
123 } 99 }
124 100
125 SkPdfFunction Function() const { 101 SkPdfFunction Function() const;
126 SkPdfFunction ret;
127 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio n", "", &ret)) return ret;
128 // TODO(edisonn): warn about missing required field, assert for known good p dfs
129 return SkPdfFunction();
130 }
131
132 }; 102 };
133 103
134 #endif // __DEFINED__SkPdfType4ShadingDictionary 104 #endif // __DEFINED__SkPdfType4ShadingDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698