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

Side by Side Diff: include/codec/SkCodec.h

Issue 1260673002: SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove setSampleX(), move IsInterlaced() to scanlineDecoder 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 SkCodec_DEFINED 8 #ifndef SkCodec_DEFINED
9 #define SkCodec_DEFINED 9 #define SkCodec_DEFINED
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 kNo_ZeroInitialized, 142 kNo_ZeroInitialized,
143 }; 143 };
144 144
145 /** 145 /**
146 * Additional options to pass to getPixels. 146 * Additional options to pass to getPixels.
147 */ 147 */
148 struct Options { 148 struct Options {
149 Options() 149 Options()
150 : fZeroInitialized(kNo_ZeroInitialized) 150 : fZeroInitialized(kNo_ZeroInitialized)
151 , fSubset(NULL) 151 , fSubset(NULL)
152 , fSampleX(1)
152 {} 153 {}
153 154
154 ZeroInitialized fZeroInitialized; 155 ZeroInitialized fZeroInitialized;
155 /** 156 /**
156 * If not NULL, represents a subset of the original image to decode. 157 * If not NULL, represents a subset of the original image to decode.
157 * 158 *
158 * Must be within the bounds returned by getInfo(). 159 * Must be within the bounds returned by getInfo().
159 * 160 *
160 * If the EncodedFormat is kWEBP_SkEncodedFormat (the only one which 161 * If the EncodedFormat is kWEBP_SkEncodedFormat (the only one which
161 * currently supports subsets), the top and left values must be even. 162 * currently supports subsets), the top and left values must be even.
162 */ 163 */
163 SkIRect* fSubset; 164 SkIRect* fSubset;
165 /**
166 * Sample size in the x direction
167 */
168 int fSampleX;
164 }; 169 };
165 170
166 /** 171 /**
167 * Decode into the given pixels, a block of memory of size at 172 * Decode into the given pixels, a block of memory of size at
168 * least (info.fHeight - 1) * rowBytes + (info.fWidth * 173 * least (info.fHeight - 1) * rowBytes + (info.fWidth *
169 * bytesPerPixel) 174 * bytesPerPixel)
170 * 175 *
171 * Repeated calls to this function should give the same results, 176 * Repeated calls to this function should give the same results,
172 * allowing the PixelRef to be immutable. 177 * allowing the PixelRef to be immutable.
173 * 178 *
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 SkStream* stream() { 321 SkStream* stream() {
317 return fStream.get(); 322 return fStream.get();
318 } 323 }
319 324
320 private: 325 private:
321 const SkImageInfo fInfo; 326 const SkImageInfo fInfo;
322 SkAutoTDelete<SkStream> fStream; 327 SkAutoTDelete<SkStream> fStream;
323 bool fNeedsRewind; 328 bool fNeedsRewind;
324 }; 329 };
325 #endif // SkCodec_DEFINED 330 #endif // SkCodec_DEFINED
OLDNEW
« no previous file with comments | « gyp/codec.gyp ('k') | include/codec/SkScaledCodec.h » ('j') | src/codec/SkCodec_libbmp.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698