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

Unified Diff: src/core/SkColorSpaceXform_A2B.h

Issue 2449243003: Initial implementation of a SkColorSpace_A2B xform (Closed)
Patch Set: fixed compile error on certain trybots related to RVO move-elision Created 4 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
« no previous file with comments | « src/core/SkColorSpaceXformPriv.h ('k') | src/core/SkColorSpaceXform_A2B.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpaceXform_A2B.h
diff --git a/src/core/SkColorSpaceXform_A2B.h b/src/core/SkColorSpaceXform_A2B.h
new file mode 100644
index 0000000000000000000000000000000000000000..681261ad20e325836e261ffc714ac72b0f18fcdd
--- /dev/null
+++ b/src/core/SkColorSpaceXform_A2B.h
@@ -0,0 +1,54 @@
+/*
+ * 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 SkColorSpaceXform_A2B_DEFINED
+#define SkColorSpaceXform_A2B_DEFINED
+
+#include "SkColorSpace_Base.h"
+#include "SkColorSpaceXform_Base.h"
+#include "SkRasterPipeline.h"
+
+#include <forward_list>
+#include <functional>
+#include <vector>
+
+class SkColorSpace_A2B;
+class SkColorSpace_XYZ;
+
+
+class SkColorSpaceXform_A2B : public SkColorSpaceXform_Base {
+public:
+ bool onApply(ColorFormat dstFormat, void* dst, ColorFormat srcFormat, const void* src,
+ int count, SkAlphaType alphaType) const override;
+
+private:
+ SkColorSpaceXform_A2B(SkColorSpace_A2B* srcSpace, SkColorSpace_XYZ* dstSpace);
+
+ enum Channels {
+ kRGB_Channels = -1,
+ kR_Channels = 0,
+ kG_Channels = 1,
+ kB_Channels = 2
+ };
+ void addGamma(std::function<float(float)> fn, Channels channels);
+
+ void addMatrix(const SkMatrix44& matrix);
+
+ SkRasterPipeline fElementsPipeline;
+ bool fLinearDstGamma;
+ // storage used by the pipeline
+ std::forward_list<std::function<float(float)>> fGammaFunctions;
+ std::forward_list<std::vector<float>> fMatrices;
+ std::forward_list<std::vector<float>> fGammaTables;
+ std::vector<sk_sp<const SkColorLookUpTable>> fCLUTs;
+ // these are here to maintain ownership of tables used in the pipeline
+ std::vector<sk_sp<const SkGammas>> fGammaRefs;
+
+ friend class SkColorSpaceXform;
+};
+
+#endif
« no previous file with comments | « src/core/SkColorSpaceXformPriv.h ('k') | src/core/SkColorSpaceXform_A2B.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698