Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 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 SkRawCodec_DEFINED | |
| 9 #define SkRawCodec_DEFINED | |
| 10 | |
| 11 #include "SkCodec.h" | |
| 12 #include "SkImageInfo.h" | |
| 13 #include "SkStream.h" | |
| 14 | |
| 15 #include "dng_host.h" | |
| 16 | |
| 17 /* | |
| 18 * | |
| 19 * This class implements the decoding for jpeg images | |
| 20 * | |
| 21 */ | |
| 22 class SkRawCodec : public SkCodec { | |
| 23 public: | |
| 24 | |
| 25 /* | |
| 26 * Checks the start of the stream to see if the image is a RAW | |
| 27 * Does not take ownership of the stream | |
| 28 */ | |
| 29 static bool IsRaw(SkStream*); | |
| 30 | |
| 31 /* | |
| 32 * Assumes IsRaw was called and returned true | |
| 33 * Creates a RAW decoder | |
| 34 * Takes ownership of the stream | |
| 35 */ | |
| 36 static SkCodec* NewFromStream(SkStream*); | |
| 37 | |
| 38 protected: | |
| 39 | |
| 40 /* | |
| 41 * Initiates the RAW decode | |
| 42 */ | |
| 43 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes , const Options&, | |
| 44 SkPMColor*, int*, int*) override; | |
| 45 | |
| 46 SkEncodedFormat onGetEncodedFormat() const override { | |
| 47 return kRAW_SkEncodedFormat; | |
| 48 } | |
| 49 | |
| 50 private: | |
| 51 | |
| 52 /* | |
| 53 * Creates an instance of the decoder | |
| 54 * Called only by NewFromStream | |
| 55 * | |
| 56 * @param srcInfo contains the source width and height | |
| 57 * @param stream the encoded image data | |
| 58 */ | |
| 59 SkRawCodec(const SkImageInfo& srcInfo, SkStream* stream); | |
| 60 | |
| 61 // scanline decoding | |
| 62 /*void initializeSwizzler(const SkImageInfo& dstInfo, const Options& options ); | |
|
msarett
2015/12/18 16:26:13
I think these methods are unnecessary given that y
yujieqin
2016/01/06 18:47:19
Removed.
| |
| 63 SkSampler* getSampler(bool createIfNecessary) override; | |
| 64 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti ons, | |
| 65 SkPMColor ctable[], int* ctableCount) override; | |
| 66 int onGetScanlines(void* dst, int count, size_t rowBytes) override; | |
| 67 bool onSkipScanlines(int count) override;*/ | |
| 68 | |
| 69 typedef SkCodec INHERITED; | |
| 70 }; | |
| 71 | |
| 72 #endif | |
| OLD | NEW |