Chromium Code Reviews| Index: src/codec/SkRawCodec.h |
| diff --git a/src/codec/SkRawCodec.h b/src/codec/SkRawCodec.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8b0d6fa74b5f8034e711485e1629534e6b84a52f |
| --- /dev/null |
| +++ b/src/codec/SkRawCodec.h |
| @@ -0,0 +1,60 @@ |
| +/* |
| + * Copyright 2015 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef SkRawCodec_DEFINED |
| +#define SkRawCodec_DEFINED |
| + |
| +#include "SkCodec.h" |
| +#include "SkImageInfo.h" |
| +#include "SkTypes.h" |
| + |
| +class SkDngImage; |
| +class SkStream; |
| + |
| +/* |
| + * |
| + * This class implements the decoding for RAW images |
| + * |
| + */ |
| +class SkRawCodec : public SkCodec { |
| +public: |
| + |
| + /* |
| + * Creates a RAW decoder |
| + * Takes ownership of the stream |
| + */ |
| + static SkCodec* NewFromStream(SkStream*); |
| + |
| + ~SkRawCodec() override; |
| + |
| +protected: |
| + |
| + Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, const Options&, |
| + SkPMColor*, int*, int*) override; |
| + |
| + SkEncodedFormat onGetEncodedFormat() const override { |
| + return kRAW_SkEncodedFormat; |
| + } |
| + |
| + SkISize onGetScaledDimensions(float desiredScale) const override; |
| + |
| + bool onDimensionsSupported(const SkISize&) override; |
| + |
| +private: |
| + |
| + /* |
| + * Creates an instance of the decoder |
| + * Called only by NewFromStream, takes ownership of dngImage. |
| + */ |
| + SkRawCodec(SkDngImage* dngImage); |
| + |
| + mutable SkAutoTDelete<SkDngImage> fDngImage; |
|
scroggo
2016/01/13 18:24:45
Does fDngImage need to be mutable, now that you do
yujieqin
2016/01/14 09:33:11
Done.
|
| + |
| + typedef SkCodec INHERITED; |
| +}; |
| + |
| +#endif |