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

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

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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__SkPdfType1ShadingDictionary 1 #ifndef __DEFINED__SkPdfType1ShadingDictionary
2 #define __DEFINED__SkPdfType1ShadingDictionary 2 #define __DEFINED__SkPdfType1ShadingDictionary
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 1 shading dictionary 9 // Additional entries specific to a type 1 shading dictionary
10 class SkPdfType1ShadingDictionary : public SkPdfShadingDictionary { 10 class SkPdfType1ShadingDictionary : public SkPdfShadingDictionary {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 SkPdfType1ShadingDictionary& operator=(const SkPdfType1ShadingDictionary& from ) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur n *this;} 43 SkPdfType1ShadingDictionary& operator=(const SkPdfType1ShadingDictionary& from ) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur n *this;}
44 44
45 /** (Optional) An array of four numbers [ xmin xmax ymin ymax ] specifying the r ec- 45 /** (Optional) An array of four numbers [ xmin xmax ymin ymax ] specifying the r ec-
46 * tangular domain of coordinates over which the color function(s) are defined. 46 * tangular domain of coordinates over which the color function(s) are defined.
47 * Default value: [0.0 1.0 0.0 1.0]. 47 * Default value: [0.0 1.0 0.0 1.0].
48 **/ 48 **/
49 bool has_Domain() const { 49 bool has_Domain() const {
50 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domai n", "", NULL)); 50 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domai n", "", NULL));
51 } 51 }
52 52
53 SkPdfArray* Domain() const { 53 SkPdfArray* Domain() const;
54 SkPdfArray* ret;
55 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", " ", &ret)) return ret;
56 // TODO(edisonn): warn about missing required field, assert for known good p dfs
57 return NULL;
58 }
59
60 /** (Optional) An array of six numbers specifying a transformation matrix mappin g 54 /** (Optional) An array of six numbers specifying a transformation matrix mappin g
61 * the coordinate space specified by the Domain entry into the shading's target co- 55 * the coordinate space specified by the Domain entry into the shading's target co-
62 * ordinate space. For example, to map the domain rectangle [0.0 1.0 0.0 1.0] t o a 56 * ordinate space. For example, to map the domain rectangle [0.0 1.0 0.0 1.0] t o a
63 * 1-inch square with lower-left corner at coordinates (100, 100) in default us er 57 * 1-inch square with lower-left corner at coordinates (100, 100) in default us er
64 * space, the Matrix value would be [72 0 0 72 100 100]. Default value: the ide n- 58 * space, the Matrix value would be [72 0 0 72 100 100]. Default value: the ide n-
65 * tity matrix [1 0 0 1 0 0]. 59 * tity matrix [1 0 0 1 0 0].
66 **/ 60 **/
67 bool has_Matrix() const { 61 bool has_Matrix() const {
68 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matri x", "", NULL)); 62 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matri x", "", NULL));
69 } 63 }
70 64
71 SkPdfArray* Matrix() const { 65 SkPdfArray* Matrix() const;
72 SkPdfArray* ret;
73 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", " ", &ret)) return ret;
74 // TODO(edisonn): warn about missing required field, assert for known good p dfs
75 return NULL;
76 }
77
78 /** (Required) A 2-in, n-out function or an array of n 2-in, 1-out functions (wh ere n 66 /** (Required) A 2-in, n-out function or an array of n 2-in, 1-out functions (wh ere n
79 * is the number of color components in the shading dictionary's color space). 67 * is the number of color components in the shading dictionary's color space).
80 * Each function's domain must be a superset of that of the shading dictionary. If 68 * Each function's domain must be a superset of that of the shading dictionary. If
81 * the value returned by the function for a given color component is out of ran ge, it 69 * the value returned by the function for a given color component is out of ran ge, it
82 * will be adjusted to the nearest valid value. 70 * will be adjusted to the nearest valid value.
83 **/ 71 **/
84 bool has_Function() const { 72 bool has_Function() const {
85 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct ion", "", NULL)); 73 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct ion", "", NULL));
86 } 74 }
87 75
88 SkPdfFunction Function() const { 76 SkPdfFunction Function() const;
89 SkPdfFunction ret;
90 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio n", "", &ret)) return ret;
91 // TODO(edisonn): warn about missing required field, assert for known good p dfs
92 return SkPdfFunction();
93 }
94
95 }; 77 };
96 78
97 #endif // __DEFINED__SkPdfType1ShadingDictionary 79 #endif // __DEFINED__SkPdfType1ShadingDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698