Flutter Engine
The Flutter Engine
third_party
skia
src
core
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
15
class
SkColorSpace
;
16
class
SkRasterPipeline
;
17
enum
SkAlphaType
:
int
;
18
19
struct
SkColorSpaceXformSteps
{
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
37
SkColorSpaceXformSteps
() {}
38
SkColorSpaceXformSteps
(
const
SkColorSpace
*
src
,
SkAlphaType
srcAT,
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
49
Flags
flags
;
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
rgba
static const uint32_t rgba[kNumPixels]
Definition:
ReadPixelsTest.cpp:408
SkAlphaType
SkAlphaType
Definition:
SkAlphaType.h:26
D
Definition:
GrMemoryPoolTest.cpp:109
SkColorSpace
Definition:
SkColorSpace.h:107
SkRasterPipeline
Definition:
SkRasterPipeline.h:68
dart::compiler::S
@ S
Definition:
assembler_arm.h:65
gn.cp.dst
dst
Definition:
cp.py:12
mskp_parser.src
src
Definition:
mskp_parser.py:22
tools.skpbench.skpbench.int
int
Definition:
skpbench.py:49
skcms.h
SkColorSpaceXformSteps::Flags
Definition:
SkColorSpaceXformSteps.h:21
SkColorSpaceXformSteps::Flags::gamut_transform
bool gamut_transform
Definition:
SkColorSpaceXformSteps.h:24
SkColorSpaceXformSteps::Flags::encode
bool encode
Definition:
SkColorSpaceXformSteps.h:25
SkColorSpaceXformSteps::Flags::premul
bool premul
Definition:
SkColorSpaceXformSteps.h:26
SkColorSpaceXformSteps::Flags::unpremul
bool unpremul
Definition:
SkColorSpaceXformSteps.h:22
SkColorSpaceXformSteps::Flags::linearize
bool linearize
Definition:
SkColorSpaceXformSteps.h:23
SkColorSpaceXformSteps::Flags::mask
constexpr uint32_t mask() const
Definition:
SkColorSpaceXformSteps.h:28
SkColorSpaceXformSteps
Definition:
SkColorSpaceXformSteps.h:19
SkColorSpaceXformSteps::srcTF
skcms_TransferFunction srcTF
Definition:
SkColorSpaceXformSteps.h:51
SkColorSpaceXformSteps::apply
void apply(float rgba[4]) const
SkColorSpaceXformSteps::SkColorSpaceXformSteps
SkColorSpaceXformSteps()
Definition:
SkColorSpaceXformSteps.h:37
SkColorSpaceXformSteps::dstTFInv
skcms_TransferFunction dstTFInv
Definition:
SkColorSpaceXformSteps.h:52
SkColorSpaceXformSteps::src_to_dst_matrix
float src_to_dst_matrix[9]
Definition:
SkColorSpaceXformSteps.h:53
SkColorSpaceXformSteps::SkColorSpaceXformSteps
SkColorSpaceXformSteps(const S &src, const D &dst)
Definition:
SkColorSpaceXformSteps.h:42
SkColorSpaceXformSteps::flags
Flags flags
Definition:
SkColorSpaceXformSteps.h:49
skcms_TransferFunction
Definition:
skcms_public.h:46
Generated on Sun Jun 23 2024 21:56:11 for Flutter Engine by
1.9.4