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 "SkTypes.h" |
| 14 |
| 15 class SkStream; |
| 16 |
| 17 /* |
| 18 * |
| 19 * This class implements the decoding for RAW images |
| 20 * |
| 21 */ |
| 22 class SkRawCodec : public SkCodec { |
| 23 public: |
| 24 |
| 25 /* |
| 26 * Creates a RAW decoder |
| 27 * Takes ownership of the stream |
| 28 */ |
| 29 static SkCodec* NewFromStream(SkStream*); |
| 30 |
| 31 ~SkRawCodec() override; |
| 32 |
| 33 protected: |
| 34 |
| 35 /* |
| 36 * Initiates the RAW decode |
| 37 */ |
| 38 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes
, const Options&, |
| 39 SkPMColor*, int*, int*) override; |
| 40 |
| 41 SkEncodedFormat onGetEncodedFormat() const override { |
| 42 return kRAW_SkEncodedFormat; |
| 43 } |
| 44 |
| 45 private: |
| 46 |
| 47 /* |
| 48 * Creates an instance of the decoder |
| 49 * Called only by NewFromStream |
| 50 */ |
| 51 SkRawCodec(const SkImageInfo& srcInfo, size_t length, void* storage); |
| 52 |
| 53 size_t fDngLength; |
| 54 void* fDngStorage; |
| 55 |
| 56 typedef SkCodec INHERITED; |
| 57 }; |
| 58 |
| 59 #endif |
OLD | NEW |