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..fc93dda86a2f0d81f85039b02d19421238b56891 |
| --- /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 "SkStream.h" |
|
scroggo
2016/01/06 22:30:21
I think you can forward declare this instead.
yujieqin
2016/01/07 09:22:26
Done.
|
| +#include "SkStreamPriv.h" |
|
scroggo
2016/01/06 22:30:20
Nit: I don't think you need to include this here.
yujieqin
2016/01/07 09:22:26
Done.
|
| +#include "SkTypes.h" |
| + |
| +/* |
| + * |
| + * This class implements the decoding for RAW images |
| + * |
| + */ |
| +class SkRawCodec : public SkCodec { |
| +public: |
| + |
| + /* |
| + * Assumes IsRaw was called and returned true |
|
scroggo
2016/01/06 22:30:21
IsRaw no longer exists
yujieqin
2016/01/07 09:22:26
Done.
|
| + * Creates a RAW decoder |
| + * Takes ownership of the stream |
| + */ |
| + static SkCodec* NewFromStream(SkStream*); |
| + |
| + ~SkRawCodec() override; |
| + |
| +protected: |
| + |
| + /* |
| + * Initiates the RAW decode |
| + */ |
| + Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, const Options&, |
| + SkPMColor*, int*, int*) override; |
| + |
| + SkEncodedFormat onGetEncodedFormat() const override { |
| + return kRAW_SkEncodedFormat; |
| + } |
| + |
| +private: |
| + |
| + /* |
| + * Creates an instance of the decoder |
| + * Called only by NewFromStream |
| + */ |
| + SkRawCodec(const SkImageInfo& srcInfo, size_t length, void* storage); |
| + |
| + size_t fDngLength = 0; |
|
scroggo
2016/01/06 22:30:20
We typically do not assign values to member variab
yujieqin
2016/01/07 09:22:26
Done.
|
| + void* fDngStorage = nullptr; |
| + |
| + typedef SkCodec INHERITED; |
| +}; |
| + |
| +#endif |