Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkColorSpaceXformSteps.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 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 SkColorSpaceXformSteps_DEFINED
9#define SkColorSpaceXformSteps_DEFINED
10
11#include "modules/skcms/skcms.h"
12
13#include <cstdint>
14
15class SkColorSpace;
17enum SkAlphaType : int;
18
20
21 struct Flags {
22 bool unpremul = false;
23 bool linearize = false;
24 bool gamut_transform = false;
25 bool encode = false;
26 bool premul = false;
27
28 constexpr uint32_t mask() const {
29 return (unpremul ? 1 : 0)
30 | (linearize ? 2 : 0)
31 | (gamut_transform ? 4 : 0)
32 | (encode ? 8 : 0)
33 | (premul ? 16 : 0);
34 }
35 };
36
39 const SkColorSpace* dst, SkAlphaType dstAT);
40
41 template <typename S, typename D>
42 SkColorSpaceXformSteps(const S& src, const D& dst)
43 : SkColorSpaceXformSteps(src.colorSpace(), src.alphaType(),
44 dst.colorSpace(), dst.alphaType()) {}
45
46 void apply(float rgba[4]) const;
47 void apply(SkRasterPipeline*) const;
48
50
51 skcms_TransferFunction srcTF, // Apply for linearize.
52 dstTFInv; // Apply for encode.
53 float src_to_dst_matrix[9]; // Apply this 3x3 column-major matrix for gamut_transform.
54};
55
56#endif//SkColorSpaceXformSteps_DEFINED
static const uint32_t rgba[kNumPixels]
SkAlphaType
Definition SkAlphaType.h:26
Type::kYUV Type::kRGBA() int(0.7 *637)
constexpr uint32_t mask() const
skcms_TransferFunction srcTF
void apply(float rgba[4]) const
skcms_TransferFunction dstTFInv
SkColorSpaceXformSteps(const S &src, const D &dst)