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 dng_stream; |
| 16 class dng_host; |
| 17 class dng_image; |
| 18 class dng_info; |
| 19 class dng_negative; |
| 20 class SkStream; |
| 21 class SkRawStream; |
| 22 |
| 23 /* |
| 24 * |
| 25 * This class implements the decoding for RAW images |
| 26 * |
| 27 */ |
| 28 class SkRawCodec : public SkCodec { |
| 29 public: |
| 30 |
| 31 /* |
| 32 * Creates a RAW decoder |
| 33 * Takes ownership of the stream |
| 34 */ |
| 35 static SkCodec* NewFromStream(SkStream*); |
| 36 |
| 37 ~SkRawCodec() override; |
| 38 |
| 39 protected: |
| 40 |
| 41 /* |
| 42 * Initiates the RAW decode |
| 43 */ |
| 44 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes
, const Options&, |
| 45 SkPMColor*, int*, int*) override; |
| 46 |
| 47 SkEncodedFormat onGetEncodedFormat() const override { |
| 48 return kRAW_SkEncodedFormat; |
| 49 } |
| 50 |
| 51 SkISize onGetScaledDimensions(float desiredScale) const override; |
| 52 |
| 53 bool onDimensionsSupported(const SkISize&) override; |
| 54 |
| 55 private: |
| 56 |
| 57 /* |
| 58 * Creates an instance of the decoder |
| 59 * Called only by NewFromStream, takes ownership of all of its pointer param
eters. |
| 60 */ |
| 61 SkRawCodec(const SkImageInfo& srcInfo, SkRawStream* stream, dng_host* host,
dng_info* info, |
| 62 dng_negative* negative); |
| 63 |
| 64 SkRawStream* fRawStream; |
| 65 |
| 66 mutable SkAutoTDelete<dng_host> fDngHost; |
| 67 mutable SkAutoTDelete<dng_image> fDngImage; |
| 68 mutable SkAutoTDelete<dng_info> fDngInfo; |
| 69 mutable SkAutoTDelete<dng_negative> fDngNegative; |
| 70 |
| 71 typedef SkCodec INHERITED; |
| 72 }; |
| 73 |
| 74 #endif |
OLD | NEW |