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

Unified Diff: src/codec/SkRawCodec.h

Issue 1624513003: Add RAW decoding support to Skia (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix sample_dng in resources, Treat less warnings as errors Created 4 years, 11 months 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
« no previous file with comments | « src/codec/SkRawAdapterCodec.cpp ('k') | src/codec/SkRawCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkRawCodec.h
diff --git a/src/codec/SkRawCodec.h b/src/codec/SkRawCodec.h
new file mode 100644
index 0000000000000000000000000000000000000000..42755c3ef1e59802853d2ab61bf0aa8b80e12667
--- /dev/null
+++ b/src/codec/SkRawCodec.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016 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);
+
+ SkAutoTDelete<SkDngImage> fDngImage;
+
+ typedef SkCodec INHERITED;
+};
+
+#endif
« no previous file with comments | « src/codec/SkRawAdapterCodec.cpp ('k') | src/codec/SkRawCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698