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

Side by Side Diff: src/codec/SkJpegCodec.h

Issue 1260673002: SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add get_row_bytes function to SkJpegCodec Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkJpegCodec_DEFINED 8 #ifndef SkJpegCodec_DEFINED
9 #define SkJpegCodec_DEFINED 9 #define SkJpegCodec_DEFINED
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 SkPMColor*, int*) override; 53 SkPMColor*, int*) override;
54 54
55 SkEncodedFormat onGetEncodedFormat() const override { 55 SkEncodedFormat onGetEncodedFormat() const override {
56 return kJPEG_SkEncodedFormat; 56 return kJPEG_SkEncodedFormat;
57 } 57 }
58 58
59 SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Op tions& options, 59 SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Op tions& options,
60 SkPMColor ctable[], int* ctableCount) override; 60 SkPMColor ctable[], int* ctableCount) override;
61 61
62 private: 62 private:
63 SkAutoTDelete<SkSwizzler> fSwizzler;
63 64
64 /* 65 /*
65 * Read enough of the stream to initialize the SkJpegCodec. 66 * Read enough of the stream to initialize the SkJpegCodec.
66 * Returns a bool representing success or failure. 67 * Returns a bool representing success or failure.
67 * 68 *
68 * @param codecOut 69 * @param codecOut
69 * If this returns true, and codecOut was not NULL, 70 * If this returns true, and codecOut was not NULL,
70 * codecOut will be set to a new SkJpegCodec. 71 * codecOut will be set to a new SkJpegCodec.
71 * 72 *
72 * @param decoderMgrOut 73 * @param decoderMgrOut
(...skipping 15 matching lines...) Expand all
88 * Called only by NewFromStream 89 * Called only by NewFromStream
89 * 90 *
90 * @param srcInfo contains the source width and height 91 * @param srcInfo contains the source width and height
91 * @param stream the encoded image data 92 * @param stream the encoded image data
92 * @param decoderMgr holds decompress struct, src manager, and error manager 93 * @param decoderMgr holds decompress struct, src manager, and error manager
93 * takes ownership 94 * takes ownership
94 */ 95 */
95 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de coderMgr); 96 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de coderMgr);
96 97
97 /* 98 /*
99 * Create the swizzler based on the encoded format
100 */
101 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&);
102
103 /*
98 * Handles rewinding the input stream if it is necessary 104 * Handles rewinding the input stream if it is necessary
99 */ 105 */
100 bool handleRewind(); 106 bool handleRewind();
101 107
102 /* 108 /*
103 * Checks if the conversion between the input image and the requested output 109 * Checks if the conversion between the input image and the requested output
104 * image has been implemented 110 * image has been implemented
105 * Sets the output color space 111 * Sets the output color space
106 */ 112 */
107 bool setOutputColorSpace(const SkImageInfo& dst); 113 bool setOutputColorSpace(const SkImageInfo& dst);
108 114
109 /* 115 /*
110 * Checks if we can scale to the requested dimensions and scales the dimensi ons 116 * Checks if we can natively scale to the requested dimensions and natively scales the
111 * if possible 117 * dimensions if possible
112 */ 118 */
113 bool scaleToDimensions(uint32_t width, uint32_t height); 119 bool nativelyScaleToDimensions(uint32_t width, uint32_t height);
114
115 /*
116 * Create the swizzler based on the encoded format
117 */
118 void initializeSwizzler(const SkImageInfo& dstInfo, void* dst, size_t dstRow Bytes,
119 const Options& options);
120 120
121 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; 121 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr;
122 122 int fPartialDenom;
scroggo 2015/08/05 19:10:04 These are no longer needed, right?
emmaleer 2015/08/06 13:45:46 Acknowledged.
123 int fPartialNum;
123 friend class SkJpegScanlineDecoder; 124 friend class SkJpegScanlineDecoder;
124 125
125 typedef SkCodec INHERITED; 126 typedef SkCodec INHERITED;
126 }; 127 };
127 128
128 #endif 129 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698