pubstruct RGBA {
pub r intpub g intpub b intpub a int
}
Purpose
Color conversions aligned with `image/color` (RGBA/NRGBA/Gray/Alpha + RGB↔YCbCr / RGB↔CMYK). No Color interface: each type has rgba returning 16-bit alpha-premultiplied channels in RGBA16.
Parameters
rint
rune (Unicode code point)
gint
field (int)
bint
field (int)
aint
field (int)
struct NRGBA
XuAPI
pubstruct NRGBA {
pub r intpub g intpub b intpub a int
}
Purpose
Public struct `NRGBA`.
Parameters
rint
rune (Unicode code point)
gint
field (int)
bint
field (int)
aint
field (int)
struct Gray
XuAPI
pubstruct Gray {
pub y int
}
Purpose
Public struct `Gray`.
Parameters
yint
value
struct Alpha
XuAPI
pubstruct Alpha {
pub a int
}
Purpose
Public struct `Alpha`.
Parameters
aint
field (int)
struct YCbCr
XuAPI
pubstruct YCbCr {
pub y intpub cb intpub cr int
}
Purpose
Public struct `YCbCr`.
Parameters
yint
value
cbint
field (int)
crint
field (int)
struct CMYK
XuAPI
pubstruct CMYK {
pub c intpub m intpub y intpub k int
}
Purpose
Public struct `CMYK`.
Parameters
cint
byte or character code
mint
field (int)
yint
value
kint
key or index
struct RGBA16
XuAPI
pubstruct RGBA16 {
pub r intpub g intpub b intpub a int
}
Purpose
Public struct `RGBA16`.
Parameters
rint
rune (Unicode code point)
gint
field (int)
bint
field (int)
aint
field (int)
rgba8
XuAPI
pubfn rgba8(r int, g int, b int, a int) RGBA
Purpose
rgba8; returns RGBA.
Parameters
rint
rune (Unicode code point) (int)
gint
g (int)
bint
b (int)
aint
value (int)
Returns
RGBA — a value of this type
nrgba8
XuAPI
pubfn nrgba8(r int, g int, b int, a int) NRGBA
Purpose
nrgba8; returns NRGBA.
Parameters
rint
rune (Unicode code point) (int)
gint
g (int)
bint
b (int)
aint
value (int)
Returns
NRGBA — a value of this type
gray8
XuAPI
pubfn gray8(y int) Gray
Purpose
gray8; returns Gray.
Parameters
yint
value (int)
Returns
Gray — a value of this type
alpha8
XuAPI
pubfn alpha8(a int) Alpha
Purpose
alpha8; returns Alpha.
Parameters
aint
value (int)
Returns
Alpha — a value of this type
(RGBA) rgba
XuAPI
pubfn (c RGBA) rgba() RGBA16
Purpose
Call `rgba` on `RGBA`.
Parameters
cRGBA
receiver RGBA (value receiver)
Returns
RGBA16 — a value of this type
(NRGBA) rgba
XuAPI
pubfn (c NRGBA) rgba() RGBA16
Purpose
Call `rgba` on `NRGBA`.
Parameters
cNRGBA
receiver NRGBA (value receiver)
Returns
RGBA16 — a value of this type
(Gray) rgba
XuAPI
pubfn (c Gray) rgba() RGBA16
Purpose
Call `rgba` on `Gray`.
Parameters
cGray
receiver Gray (value receiver)
Returns
RGBA16 — a value of this type
(Alpha) rgba
XuAPI
pubfn (c Alpha) rgba() RGBA16
Purpose
Call `rgba` on `Alpha`.
Parameters
cAlpha
receiver Alpha (value receiver)
Returns
RGBA16 — a value of this type
rgb_to_ycbcr
XuAPI
pubfn rgb_to_ycbcr(r int, g int, b int) YCbCr
Purpose
Rgb to ycbcr.
Parameters
rint
rune (Unicode code point) (int)
gint
g (int)
bint
b (int)
Returns
YCbCr — a value of this type
ycbcr_to_rgb
XuAPI
pubfn ycbcr_to_rgb(y int, cb int, cr int) RGBA
Purpose
Ycbcr to rgb.
Parameters
yint
value (int)
cbint
cb (int)
crint
cr (int)
Returns
RGBA — a value of this type
rgb_to_cmyk
XuAPI
pubfn rgb_to_cmyk(r int, g int, b int) CMYK
Purpose
Rgb to cmyk.
Parameters
rint
rune (Unicode code point) (int)
gint
g (int)
bint
b (int)
Returns
CMYK — a value of this type
cmyk_to_rgb
XuAPI
pubfn cmyk_to_rgb(c int, m int, y int, k int) RGBA