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

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

Issue 16975013: Deal with ca and CA transparency operators in pdf. add comments to generated classes. (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__SkPdfType1ShadingDictionary 1 #ifndef __DEFINED__SkPdfType1ShadingDictionary
2 #define __DEFINED__SkPdfType1ShadingDictionary 2 #define __DEFINED__SkPdfType1ShadingDictionary
3 3
4 #include "SkPdfEnums_autogen.h" 4 #include "SkPdfEnums_autogen.h"
5 #include "SkPdfArray_autogen.h" 5 #include "SkPdfArray_autogen.h"
6 #include "SkPdfShadingDictionary_autogen.h" 6 #include "SkPdfShadingDictionary_autogen.h"
7 7
8 // Additional entries specific to a type 1 shading dictionary
8 class SkPdfType1ShadingDictionary : public SkPdfShadingDictionary { 9 class SkPdfType1ShadingDictionary : public SkPdfShadingDictionary {
9 public: 10 public:
10 virtual SkPdfObjectType getType() const { return kType1ShadingDictionary_SkPdf ObjectType;} 11 virtual SkPdfObjectType getType() const { return kType1ShadingDictionary_SkPdf ObjectType;}
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType1Sh adingDictionary_SkPdfObjectType + 1);} 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType1Sh adingDictionary_SkPdfObjectType + 1);}
12 public: 13 public:
13 virtual SkPdfType1ShadingDictionary* asType1ShadingDictionary() {return this;} 14 virtual SkPdfType1ShadingDictionary* asType1ShadingDictionary() {return this;}
14 virtual const SkPdfType1ShadingDictionary* asType1ShadingDictionary() const {r eturn this;} 15 virtual const SkPdfType1ShadingDictionary* asType1ShadingDictionary() const {r eturn this;}
15 16
16 private: 17 private:
17 virtual SkPdfType2ShadingDictionary* asType2ShadingDictionary() {return NULL;} 18 virtual SkPdfType2ShadingDictionary* asType2ShadingDictionary() {return NULL;}
(...skipping 13 matching lines...) Expand all
31 32
32 public: 33 public:
33 private: 34 private:
34 public: 35 public:
35 SkPdfType1ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO bject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {} 36 SkPdfType1ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO bject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {}
36 37
37 virtual bool valid() const {return true;} 38 virtual bool valid() const {return true;}
38 39
39 SkPdfType1ShadingDictionary& operator=(const SkPdfType1ShadingDictionary& from ) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur n *this;} 40 SkPdfType1ShadingDictionary& operator=(const SkPdfType1ShadingDictionary& from ) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur n *this;}
40 41
42 /** (Optional) An array of four numbers [ xmin xmax ymin ymax ] specifying the r ec-
43 * tangular domain of coordinates over which the color function(s) are defined.
44 * Default value: [0.0 1.0 0.0 1.0].
45 **/
46 bool has_Domain() const {
47 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domai n", "", NULL));
48 }
49
41 SkPdfArray Domain() const { 50 SkPdfArray Domain() const {
42 SkPdfArray ret; 51 SkPdfArray ret;
43 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", " ", &ret)) return ret; 52 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", " ", &ret)) return ret;
44 // TODO(edisonn): warn about missing required field, assert for known good p dfs 53 // TODO(edisonn): warn about missing required field, assert for known good p dfs
45 return SkPdfArray(); 54 return SkPdfArray();
46 } 55 }
47 56
57 /** (Optional) An array of six numbers specifying a transformation matrix mappin g
58 * the coordinate space specified by the Domain entry into the shading's target co-
59 * ordinate space. For example, to map the domain rectangle [0.0 1.0 0.0 1.0] t o a
60 * 1-inch square with lower-left corner at coordinates (100, 100) in default us er
61 * space, the Matrix value would be [72 0 0 72 100 100]. Default value: the ide n-
62 * tity matrix [1 0 0 1 0 0].
63 **/
64 bool has_Matrix() const {
65 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matri x", "", NULL));
66 }
67
48 SkPdfArray Matrix() const { 68 SkPdfArray Matrix() const {
49 SkPdfArray ret; 69 SkPdfArray ret;
50 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", " ", &ret)) return ret; 70 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", " ", &ret)) return ret;
51 // TODO(edisonn): warn about missing required field, assert for known good p dfs 71 // TODO(edisonn): warn about missing required field, assert for known good p dfs
52 return SkPdfArray(); 72 return SkPdfArray();
53 } 73 }
54 74
75 /** (Required) A 2-in, n-out function or an array of n 2-in, 1-out functions (wh ere n
76 * is the number of color components in the shading dictionary's color space).
77 * Each function's domain must be a superset of that of the shading dictionary. If
78 * the value returned by the function for a given color component is out of ran ge, it
79 * will be adjusted to the nearest valid value.
80 **/
81 bool has_Function() const {
82 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Funct ion", "", NULL));
83 }
84
55 SkPdfFunction Function() const { 85 SkPdfFunction Function() const {
56 SkPdfFunction ret; 86 SkPdfFunction ret;
57 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio n", "", &ret)) return ret; 87 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functio n", "", &ret)) return ret;
58 // TODO(edisonn): warn about missing required field, assert for known good p dfs 88 // TODO(edisonn): warn about missing required field, assert for known good p dfs
59 return SkPdfFunction(); 89 return SkPdfFunction();
60 } 90 }
61 91
62 }; 92 };
63 93
64 #endif // __DEFINED__SkPdfType1ShadingDictionary 94 #endif // __DEFINED__SkPdfType1ShadingDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698