Index: src/codec/SkRawCodec.h |
diff --git a/src/codec/SkRawCodec.h b/src/codec/SkRawCodec.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..648a9997c7e0129d96d52f6936c1becac399b656 |
--- /dev/null |
+++ b/src/codec/SkRawCodec.h |
@@ -0,0 +1,81 @@ |
+/* |
+ * 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" |
+ |
+#include "dng_host.h" |
+ |
+/* |
+ * |
+ * This class implements the decoding for jpeg images |
+ * |
+ */ |
+class SkRawCodec : public SkCodec { |
+public: |
+ |
+ /* |
+ * Checks the start of the stream to see if the image is a RAW |
+ * Does not take ownership of the stream |
+ */ |
+ static bool IsRaw(SkStream*); |
+ |
+ /* |
+ * Assumes IsRaw was called and returned true |
+ * Creates a RAW decoder |
+ * Takes ownership of the stream |
+ */ |
+ static SkCodec* NewFromStream(SkStream*); |
+ |
+protected: |
+ |
+ /* |
+ * Recommend a set of destination dimensions given a requested scale |
+ */ |
+ //SkISize onGetScaledDimensions(float desiredScale) const override; |
scroggo
2015/11/19 22:16:55
This is only necessary if you support scales other
ebrauer
2015/11/20 11:43:44
Done.
|
+ |
+ /* |
+ * 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; |
+ } |
+ |
+ /*bool onRewind() override; |
+ |
+ bool onDimensionsSupported(const SkISize&) override;*/ |
scroggo
2015/11/19 22:16:55
Again, only necessary if you support scales other
ebrauer
2015/11/20 11:43:44
Done.
|
+ |
+private: |
+ |
+ /* |
+ * Creates an instance of the decoder |
+ * Called only by NewFromStream |
+ * |
+ * @param srcInfo contains the source width and height |
+ * @param stream the encoded image data |
+ */ |
+ SkRawCodec(const SkImageInfo& srcInfo, SkStream* stream); |
+ |
+ // scanline decoding |
+ /*void initializeSwizzler(const SkImageInfo& dstInfo, const Options& options); |
+ SkSampler* getSampler(bool createIfNecessary) override; |
+ Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options, |
+ SkPMColor ctable[], int* ctableCount) override; |
+ int onGetScanlines(void* dst, int count, size_t rowBytes) override; |
+ bool onSkipScanlines(int count) override;*/ |
+ |
+ typedef SkCodec INHERITED; |
+}; |
+ |
+#endif |