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

Side by Side Diff: src/core/SkColorSpaceXform.h

Issue 1952063002: Create SkColorSpaceXform to handle color conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | src/core/SkColorSpaceXform.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_DEFINED
9 #define SkColorSpaceXform_DEFINED
10
11 #include "SkColorSpace.h"
12
13 class SkColorSpaceXform {
14 public:
15
16 /**
17 * Create an object to handle color space conversions.
18 *
19 * @param srcSpace The encoded color space.
20 * @param dstSpace The destination color space.
21 *
22 */
23 static std::unique_ptr<SkColorSpaceXform> New(const sk_sp<SkColorSpace>& src Space,
24 const sk_sp<SkColorSpace>& dst Space);
25
26 /**
27 * Apply the color conversion to a src buffer, storing the output in the ds t buffer.
28 * The src is stored in RGBA_8888 and the dst is stored in 8888 platform fo rmat.
29 * The output is not premultiplied.
30 */
31 virtual void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t le n) const = 0;
32
33 virtual ~SkColorSpaceXform() {}
34 };
35
36 class SkGammaByValueXform : public SkColorSpaceXform {
37 public:
38
39 void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
40
41 private:
42 SkGammaByValueXform(float srcGammas[3], const SkMatrix44& srcToDst, float ds tGammas[3]);
43
44 float fSrcGammas[3];
45 const SkMatrix44 fSrcToDst;
46 float fDstGammas[3];
47
48 friend class SkColorSpaceXform;
49 };
50
51 #endif
OLDNEW
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698