blob: 4f903f65d38cf12d4ca462de1cbbb6d15223fecf [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2010 The Android Open Source Project
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000010#ifndef SkPDFFormXObject_DEFINED
11#define SkPDFFormXObject_DEFINED
12
13#include "SkPDFStream.h"
14#include "SkPDFTypes.h"
commit-bot@chromium.org93a2e212013-07-23 23:16:03 +000015#include "SkRect.h"
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000016#include "SkRefCnt.h"
17#include "SkString.h"
18
19class SkMatrix;
20class SkPDFDevice;
halcanary37c46ca2015-03-31 12:30:20 -070021class SkPDFObjNumMap;
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000022
23/** \class SkPDFFormXObject
24
vandebo@chromium.orgf60a0012011-02-24 23:14:04 +000025 A form XObject; a self contained description of graphics objects. A form
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000026 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.org421d6442011-07-20 17:39:01 +000033class SkPDFFormXObject : public SkPDFStream {
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000034public:
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.orgeb6c7592010-10-26 19:54:45 +000038 */
vandebo@chromium.org1aef2ed2011-02-03 21:46:10 +000039 explicit SkPDFFormXObject(SkPDFDevice* device);
commit-bot@chromium.org93a2e212013-07-23 23:16:03 +000040 /**
41 * Create a PDF form XObject from a raw content stream and associated
42 * resources.
43 */
44 explicit SkPDFFormXObject(SkStream* content,
45 SkRect bbox,
halcanary2b861552015-04-09 13:27:40 -070046 SkPDFDict* resourceDict);
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000047 virtual ~SkPDFFormXObject();
48
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000049private:
commit-bot@chromium.org93a2e212013-07-23 23:16:03 +000050 void init(const char* colorSpace,
51 SkPDFDict* resourceDict, SkPDFArray* bbox);
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000052};
53
54#endif