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

Side by Side Diff: experimental/PdfViewer/SkPdfType3ShadingDictionary_autogen.h

Issue 17748002: Basic support for Type3 Fonts in Pdf + various refactorings (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
(Empty)
1 #ifndef __DEFINED__SkPdfType3ShadingDictionary
2 #define __DEFINED__SkPdfType3ShadingDictionary
3
4 #include "SkPdfEnums_autogen.h"
5 #include "SkPdfArray_autogen.h"
6 #include "SkPdfShadingDictionary_autogen.h"
7
8 // Additional entries specific to a type 3 shading dictionary
9 class SkPdfType3ShadingDictionary : public SkPdfShadingDictionary {
10 public:
11 virtual SkPdfObjectType getType() const { return kType3ShadingDictionary_SkPdf ObjectType;}
12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType3Sh adingDictionary_SkPdfObjectType + 1);}
13 public:
14 virtual SkPdfType3ShadingDictionary* asType3ShadingDictionary() {return this;}
15 virtual const SkPdfType3ShadingDictionary* asType3ShadingDictionary() 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 SkPdfType4ShadingDictionary* asType4ShadingDictionary() {return NULL;}
25 virtual const SkPdfType4ShadingDictionary* asType4ShadingDictionary() const {r eturn NULL;}
26
27 virtual SkPdfType5ShadingDictionary* asType5ShadingDictionary() {return NULL;}
28 virtual const SkPdfType5ShadingDictionary* asType5ShadingDictionary() 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 SkPdfType3ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO bject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {}
37
38 virtual bool valid() const {return true;}
39
40 SkPdfType3ShadingDictionary& operator=(const SkPdfType3ShadingDictionary& from ) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur n *this;}
41
42 /** (Required) An array of six numbers [ x0 y0 r0 x1 y1 r1 ] specifying the cent ers and
43 * radii of the starting and ending circles, expressed in the shading's target coor-
44 * dinate space. The radii r0 and r1 must both be greater than or equal to 0. I f one
45 * radius is 0, the corresponding circle is treated as a point; if both are 0, nothing is
46 * painted.
47 **/
48 bool has_Coords() const {
49 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coord s", "", NULL));
50 }
51
52 SkPdfArray Coords() const {
53 SkPdfArray ret;
54 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", " ", &ret)) return ret;
55 // TODO(edisonn): warn about missing required field, assert for known good p dfs
56 return SkPdfArray();
57 }
58
59 /** (Optional) An array of two numbers [ t0 t1 ] specifying the limiting values of a
60 * parametric variable t. The variable is considered to vary linearly between t hese
61 * two values as the color gradient varies between the starting and ending circ les.
62 * The variable t becomes the input argument to the color function(s). Default
63 * value: [0.0 1.0].
64 **/
65 bool has_Domain() const {
66 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domai n", "", NULL));
67 }
68
69 SkPdfArray Domain() const {
70 SkPdfArray ret;
71 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", " ", &ret)) return ret;
72 // TODO(edisonn): warn about missing required field, assert for known good p dfs
73 return SkPdfArray();
74 }
75
76 /** (Required) A 1-in, n-out function or an array of n 1-in, 1-out functions (wh ere n
77 * is the number of color components in the shading dictionary's color space). The
78 * function(s) are called with values of the parametric variable t in the domai n de-
79 * fined by the shading dictionary's Domain entry. Each function's domain must be
80 * a superset of that of the shading dictionary. If the value returned by the f unction
81 * for a given color component is out of range, it will be adjusted to the near est
82 * valid value.
83 **/
84 bool has_Function() const {
85 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct ion", "", NULL));
86 }
87
88 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 /** (Optional) An array of two boolean values specifying whether to extend the
96 * shading beyond the starting and ending circles, respectively. Default value:
97 * [false false].
98 **/
99 bool has_Extend() const {
100 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Exten d", "", NULL));
101 }
102
103 SkPdfArray Extend() const {
104 SkPdfArray ret;
105 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", " ", &ret)) return ret;
106 // TODO(edisonn): warn about missing required field, assert for known good p dfs
107 return SkPdfArray();
108 }
109
110 };
111
112 #endif // __DEFINED__SkPdfType3ShadingDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698