epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2010 The Android Open Source Project |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 4 | * |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 9 | |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 10 | #ifndef SkPDFFormXObject_DEFINED |
| 11 | #define SkPDFFormXObject_DEFINED |
| 12 | |
| 13 | #include "SkPDFStream.h" |
| 14 | #include "SkPDFTypes.h" |
commit-bot@chromium.org | 93a2e21 | 2013-07-23 23:16:03 +0000 | [diff] [blame] | 15 | #include "SkRect.h" |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 16 | #include "SkRefCnt.h" |
| 17 | #include "SkString.h" |
| 18 | |
| 19 | class SkMatrix; |
| 20 | class SkPDFDevice; |
halcanary | 37c46ca | 2015-03-31 12:30:20 -0700 | [diff] [blame] | 21 | class SkPDFObjNumMap; |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 22 | |
| 23 | /** \class SkPDFFormXObject |
| 24 | |
vandebo@chromium.org | f60a001 | 2011-02-24 23:14:04 +0000 | [diff] [blame] | 25 | A form XObject; a self contained description of graphics objects. A form |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 26 | XObject is basically a page object with slightly different syntax, that |
| 27 | can be drawn onto a page. |
| 28 | */ |
| 29 | |
| 30 | // The caller could keep track of the form XObjects it creates and |
| 31 | // canonicalize them, but the Skia API doesn't provide enough context to |
| 32 | // automatically do it (trivially). |
vandebo@chromium.org | 421d644 | 2011-07-20 17:39:01 +0000 | [diff] [blame] | 33 | class SkPDFFormXObject : public SkPDFStream { |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 34 | public: |
| 35 | /** Create a PDF form XObject. Entries for the dictionary entries are |
| 36 | * automatically added. |
| 37 | * @param device The set of graphical elements on this form. |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 38 | */ |
vandebo@chromium.org | 1aef2ed | 2011-02-03 21:46:10 +0000 | [diff] [blame] | 39 | explicit SkPDFFormXObject(SkPDFDevice* device); |
commit-bot@chromium.org | 93a2e21 | 2013-07-23 23:16:03 +0000 | [diff] [blame] | 40 | /** |
| 41 | * Create a PDF form XObject from a raw content stream and associated |
| 42 | * resources. |
| 43 | */ |
| 44 | explicit SkPDFFormXObject(SkStream* content, |
| 45 | SkRect bbox, |
halcanary | 2b86155 | 2015-04-09 13:27:40 -0700 | [diff] [blame] | 46 | SkPDFDict* resourceDict); |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 47 | virtual ~SkPDFFormXObject(); |
| 48 | |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 49 | private: |
commit-bot@chromium.org | 93a2e21 | 2013-07-23 23:16:03 +0000 | [diff] [blame] | 50 | void init(const char* colorSpace, |
| 51 | SkPDFDict* resourceDict, SkPDFArray* bbox); |
vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | #endif |