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

Unified Diff: src/codec/SkRawCodec.h

Issue 1520403003: Prototype of RAW decoding in Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: * Add DNG scaling. * Adress all comments. 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
Index: src/codec/SkRawCodec.h
diff --git a/src/codec/SkRawCodec.h b/src/codec/SkRawCodec.h
new file mode 100644
index 0000000000000000000000000000000000000000..4dae3ada3f03a6626099a1b308d8d98175ad1392
--- /dev/null
+++ b/src/codec/SkRawCodec.h
@@ -0,0 +1,74 @@
+/*
+ * 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 dng_stream;
+class dng_host;
+class dng_image;
+class dng_info;
+class dng_negative;
+class SkStream;
+class SkRawStream;
+
+/*
+ *
+ * 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:
+
+ /*
+ * 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;
+ }
+
+ SkISize onGetScaledDimensions(float desiredScale) const override;
+
+ bool onDimensionsSupported(const SkISize&) override;
+
+private:
+
+ /*
+ * Creates an instance of the decoder
+ * Called only by NewFromStream
scroggo 2016/01/08 17:12:26 nit: Takes ownership of all of its pointer paramet
yujieqin 2016/01/11 14:03:08 Done.
+ */
+ SkRawCodec(const SkImageInfo& srcInfo, SkRawStream* stream, dng_host* host, dng_info* info,
+ dng_negative* negative);
+
+ SkRawStream* fRawStream;
+
+ mutable SkAutoTDelete<dng_host> fDngHost;
+ mutable SkAutoTDelete<dng_image> fDngImage;
+ mutable SkAutoTDelete<dng_info> fDngInfo;
+ mutable SkAutoTDelete<dng_negative> fDngNegative;
+
+ typedef SkCodec INHERITED;
+};
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698