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

Side by Side Diff: src/pdf/SkPDFImageStream.h

Issue 22889020: Refactor SkPDFImage (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some nits Created 7 years, 4 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
« no previous file with comments | « src/pdf/SkPDFImage.cpp ('k') | src/pdf/SkPDFImageStream.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « src/pdf/SkPDFImage.cpp ('k') | src/pdf/SkPDFImageStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698