BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
BrawlLib.Imaging.LabPixel Struct Reference

Public Member Functions

 LabPixel (double l, double a, double b)
 

Static Public Member Functions

static operator LabPixel (ARGBPixel p)
 

Public Attributes

double L
 
double A
 
double B
 

Constructor & Destructor Documentation

◆ LabPixel()

BrawlLib.Imaging.LabPixel.LabPixel ( double  l,
double  a,
double  b 
)
inline
14 {
15 L = l;
16 A = a;
17 B = b;
18 }
double B
Definition: CIE.cs:11
double A
Definition: CIE.cs:10
double L
Definition: CIE.cs:9

Member Function Documentation

◆ operator LabPixel()

static BrawlLib.Imaging.LabPixel.operator LabPixel ( ARGBPixel  p)
inlineexplicitstatic
21 {
22 double r = CIE.powtable[p.R];
23 double g = CIE.powtable[p.G];
24 double b = CIE.powtable[p.B];
25
26 double x = CIE.mRGB_XYZ[0, 0] * r + CIE.mRGB_XYZ[0, 1] * g + CIE.mRGB_XYZ[0, 2] * b / CIE.xnn;
27 double y = CIE.mRGB_XYZ[1, 0] * r + CIE.mRGB_XYZ[1, 1] * g + CIE.mRGB_XYZ[1, 2] * b / CIE.ynn;
28 double z = CIE.mRGB_XYZ[2, 0] * r + CIE.mRGB_XYZ[2, 1] * g + CIE.mRGB_XYZ[2, 2] * b / CIE.znn;
29
30 double l;
31 if (y > 0.008856)
32 {
33 y = Math.Pow(y, 1.0 / 3.0);
34 l = 116.0 * y - 16.0;
35 }
36 else
37 {
38 l = y > 0.0 ? y * 903.3 : 0.0;
39 y = 7.787 * y + 16.0 / 116.0;
40 }
41
42 x = x > 0.00856 ? Math.Pow(x, 1.0 / 3.0) : 7.787 * x + 16.0 / 116.0;
43 z = z > 0.00856 ? Math.Pow(z, 1.0 / 3.0) : 7.787 * z + 16.0 / 116.0;
44
45 return new LabPixel(l, 500.0 * (x - y), 200.0 * (y - z));
46 }
LabPixel(double l, double a, double b)
Definition: CIE.cs:13

Member Data Documentation

◆ A

double BrawlLib.Imaging.LabPixel.A

◆ B

double BrawlLib.Imaging.LabPixel.B

◆ L

double BrawlLib.Imaging.LabPixel.L

The documentation for this struct was generated from the following file: