Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: src/codec/SkRawCodec.h

Issue 1459473007: Updates the gyp file. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Updates the Raw Codec prototype. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/codec/SkRawCodec.h
diff --git a/src/codec/SkRawCodec.h b/src/codec/SkRawCodec.h
new file mode 100644
index 0000000000000000000000000000000000000000..d178eb54c00d7976965ced255ef99372aff88bdf
--- /dev/null
+++ b/src/codec/SkRawCodec.h
@@ -0,0 +1,72 @@
+/*
+ * 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
msarett 2015/11/25 15:15:23 Update this comment to say raw?
ebrauer 2016/01/07 10:07:36 Done in https://codereview.chromium.org/1520403003
+ *
+ */
+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:
+
+ /*
+ * 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
+ *
+ * @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
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkRawCodec.cpp » ('j') | src/codec/SkRawCodec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698