Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Enumerations | Functions | Variables
SkColorMatrix.cpp File Reference
#include "include/effects/SkColorMatrix.h"
#include "src/core/SkYUVMath.h"

Go to the source code of this file.

Enumerations

enum  {
  kR_Scale = 0 , kG_Scale = 6 , kB_Scale = 12 , kA_Scale = 18 ,
  kR_Trans = 4 , kG_Trans = 9 , kB_Trans = 14 , kA_Trans = 19
}
 

Functions

static void set_concat (float result[20], const float outer[20], const float inner[20])
 
static void setrow (float row[], float r, float g, float b)
 

Variables

static const float kHueR = 0.213f
 
static const float kHueG = 0.715f
 
static const float kHueB = 0.072f
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kR_Scale 
kG_Scale 
kB_Scale 
kA_Scale 
kR_Trans 
kG_Trans 
kB_Trans 
kA_Trans 

Definition at line 25 of file SkColorMatrix.cpp.

25 {
26 kR_Scale = 0,
27 kG_Scale = 6,
28 kB_Scale = 12,
29 kA_Scale = 18,
30
31 kR_Trans = 4,
32 kG_Trans = 9,
33 kB_Trans = 14,
34 kA_Trans = 19,
35};
@ kR_Scale
@ kG_Scale
@ kG_Trans
@ kR_Trans
@ kB_Trans
@ kA_Trans
@ kA_Scale
@ kB_Scale

Function Documentation

◆ set_concat()

static void set_concat ( float  result[20],
const float  outer[20],
const float  inner[20] 
)
static

Definition at line 37 of file SkColorMatrix.cpp.

37 {
38 float tmp[20];
39 float* target;
40
41 if (outer == result || inner == result) {
42 target = tmp; // will memcpy answer when we're done into result
43 } else {
44 target = result;
45 }
46
47 int index = 0;
48 for (int j = 0; j < 20; j += 5) {
49 for (int i = 0; i < 4; i++) {
50 target[index++] = outer[j + 0] * inner[i + 0] +
51 outer[j + 1] * inner[i + 5] +
52 outer[j + 2] * inner[i + 10] +
53 outer[j + 3] * inner[i + 15];
54 }
55 target[index++] = outer[j + 0] * inner[4] +
56 outer[j + 1] * inner[9] +
57 outer[j + 2] * inner[14] +
58 outer[j + 3] * inner[19] +
59 outer[j + 4];
60 }
61
62 if (target != result) {
63 std::copy_n(target, 20, result);
64 }
65}
GAsyncResult * result
uint32_t * target

◆ setrow()

static void setrow ( float  row[],
float  r,
float  g,
float  b 
)
static

Definition at line 95 of file SkColorMatrix.cpp.

95 {
96 row[0] = r;
97 row[1] = g;
98 row[2] = b;
99}
static bool b

Variable Documentation

◆ kHueB

const float kHueB = 0.072f
static

Definition at line 103 of file SkColorMatrix.cpp.

◆ kHueG

const float kHueG = 0.715f
static

Definition at line 102 of file SkColorMatrix.cpp.

◆ kHueR

const float kHueR = 0.213f
static

Definition at line 101 of file SkColorMatrix.cpp.