Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
core
SkMasks.h
Go to the documentation of this file.
1
/*
2
* Copyright 2015 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
#ifndef SkMasks_DEFINED
8
#define SkMasks_DEFINED
9
10
#include "
include/core/SkTypes.h
"
11
12
#include <cstdint>
13
14
class
SkMasks
{
15
public
:
16
// Contains all of the information for a single mask
17
struct
MaskInfo
{
18
uint32_t
mask
;
19
uint32_t
shift
;
// To the left
20
uint32_t
size
;
// Of mask width
21
};
22
23
constexpr
SkMasks
(
const
MaskInfo
red,
24
const
MaskInfo
green,
25
const
MaskInfo
blue,
26
const
MaskInfo
alpha)
27
: fRed(red), fGreen(green), fBlue(blue), fAlpha(alpha) {}
28
29
// Input bit masks format
30
struct
InputMasks
{
31
uint32_t
red
;
32
uint32_t
green
;
33
uint32_t
blue
;
34
uint32_t
alpha
;
35
};
36
37
// Create the masks object
38
static
SkMasks
*
CreateMasks
(
InputMasks
masks,
int
bytesPerPixel);
39
40
// Get a color component
41
uint8_t
getRed
(uint32_t pixel)
const
;
42
uint8_t
getGreen
(uint32_t pixel)
const
;
43
uint8_t
getBlue
(uint32_t pixel)
const
;
44
uint8_t
getAlpha
(uint32_t pixel)
const
;
45
46
// Getter for the alpha mask
47
// The alpha mask may be used in other decoding modes
48
uint32_t
getAlphaMask
()
const
{
return
fAlpha.
mask
; }
49
50
private
:
51
const
MaskInfo fRed;
52
const
MaskInfo fGreen;
53
const
MaskInfo fBlue;
54
const
MaskInfo fAlpha;
55
};
56
57
#endif
SkTypes.h
SkMasks
Definition
SkMasks.h:14
SkMasks::SkMasks
constexpr SkMasks(const MaskInfo red, const MaskInfo green, const MaskInfo blue, const MaskInfo alpha)
Definition
SkMasks.h:23
SkMasks::getAlpha
uint8_t getAlpha(uint32_t pixel) const
Definition
SkMasks.cpp:79
SkMasks::getAlphaMask
uint32_t getAlphaMask() const
Definition
SkMasks.h:48
SkMasks::CreateMasks
static SkMasks * CreateMasks(InputMasks masks, int bytesPerPixel)
Definition
SkMasks.cpp:126
SkMasks::getBlue
uint8_t getBlue(uint32_t pixel) const
Definition
SkMasks.cpp:76
SkMasks::getGreen
uint8_t getGreen(uint32_t pixel) const
Definition
SkMasks.cpp:73
SkMasks::getRed
uint8_t getRed(uint32_t pixel) const
Definition
SkMasks.cpp:70
SkMasks::InputMasks
Definition
SkMasks.h:30
SkMasks::InputMasks::alpha
uint32_t alpha
Definition
SkMasks.h:34
SkMasks::InputMasks::blue
uint32_t blue
Definition
SkMasks.h:33
SkMasks::InputMasks::red
uint32_t red
Definition
SkMasks.h:31
SkMasks::InputMasks::green
uint32_t green
Definition
SkMasks.h:32
SkMasks::MaskInfo
Definition
SkMasks.h:17
SkMasks::MaskInfo::mask
uint32_t mask
Definition
SkMasks.h:18
SkMasks::MaskInfo::size
uint32_t size
Definition
SkMasks.h:20
SkMasks::MaskInfo::shift
uint32_t shift
Definition
SkMasks.h:19
Generated on Fri Apr 26 2024 06:16:44 for Flutter Engine by
1.9.8