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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/core/SkColorSpaceXformPriv.h ('k') | src/core/SkColorSpaceXform_A2B.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkColorSpaceXform_A2B_DEFINED
9 #define SkColorSpaceXform_A2B_DEFINED
10
11 #include "SkColorSpace_Base.h"
12 #include "SkColorSpaceXform_Base.h"
13 #include "SkRasterPipeline.h"
14
15 #include <forward_list>
16 #include <functional>
17 #include <vector>
18
19 class SkColorSpace_A2B;
20 class SkColorSpace_XYZ;
21
22
23 class SkColorSpaceXform_A2B : public SkColorSpaceXform_Base {
24 public:
25 bool onApply(ColorFormat dstFormat, void* dst, ColorFormat srcFormat, const void* src,
26 int count, SkAlphaType alphaType) const override;
27
28 private:
29 SkColorSpaceXform_A2B(SkColorSpace_A2B* srcSpace, SkColorSpace_XYZ* dstSpace );
30
31 enum Channels {
32 kRGB_Channels = -1,
33 kR_Channels = 0,
34 kG_Channels = 1,
35 kB_Channels = 2
36 };
37 void addGamma(std::function<float(float)> fn, Channels channels);
38
39 void addMatrix(const SkMatrix44& matrix);
40
41 SkRasterPipeline fElementsPipeline;
42 bool fLinearDstGamma;
43 // storage used by the pipeline
44 std::forward_list<std::function<float(float)>> fGammaFunctions;
45 std::forward_list<std::vector<float>> fMatrices;
46 std::forward_list<std::vector<float>> fGammaTables;
47 std::vector<sk_sp<const SkColorLookUpTable>> fCLUTs;
48 // these are here to maintain ownership of tables used in the pipeline
49 std::vector<sk_sp<const SkGammas>> fGammaRefs;
50
51 friend class SkColorSpaceXform;
52 };
53
54 #endif
OLDNEW
« 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