OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2013 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef SkPDFImageStream_DEFINED | |
9 #define SkPDFImageStream_DEFINED | |
10 | |
11 #include "SkBitmap.h" | |
12 #include "SkPDFDevice.h" | |
13 #include "SkPDFStream.h" | |
14 #include "SkPDFTypes.h" | |
15 #include "SkRect.h" | |
16 #include "SkRefCnt.h" | |
17 #include "SkStream.h" | |
18 #include "SkTemplates.h" | |
19 | |
20 class SkPDFCatalog; | |
21 | |
22 /** \class SkPDFImageStream | |
23 | |
24 An image stream object in a PDF. Note, all streams must be indirect objects | |
25 (via SkObjRef). | |
26 This class is similar to SkPDFStream, but it is also able to use image | |
27 specific compression. Currently we support DCT(jpeg) and flate(zip). | |
28 */ | |
29 class SkPDFImageStream : public SkPDFStream { | |
30 public: | |
31 /** Create a PDF stream with the same content and dictionary entries | |
32 * as the passed one. | |
33 */ | |
34 explicit SkPDFImageStream(const SkPDFImageStream& pdfStream); | |
35 virtual ~SkPDFImageStream(); | |
36 | |
37 protected: | |
38 SkPDFImageStream(SkStream* stream, const SkBitmap& bitmap, | |
39 const SkIRect& srcRect, EncodeToDCTStream encoder); | |
40 | |
41 // Populate the stream dictionary. This method returns false if | |
42 // fSubstitute should be used. | |
43 virtual bool populate(SkPDFCatalog* catalog); | |
44 | |
45 private: | |
46 const SkBitmap fBitmap; | |
47 const SkIRect fSrcRect; | |
48 EncodeToDCTStream fEncoder; | |
49 | |
50 typedef SkPDFStream INHERITED; | |
51 }; | |
52 | |
53 #endif | |
OLD | NEW |