XU XUv0.16.0

#image/color

import: #image/color

counts: 8 functions, 5 methods, 7 types, 0 constants, 0 method sets

Color types and channel conversion.

struct RGBA

XuAPI
pub struct RGBA {
    pub r int
    pub g int
    pub b int
    pub a int
}

Purpose

Structure encapsulating r, g, b, a.

Public fields

r int
rune (Unicode code point)
g int
field (int)
b int
field (int)
a int
field (int)

struct NRGBA

XuAPI
pub struct NRGBA {
    pub r int
    pub g int
    pub b int
    pub a int
}

Purpose

Structure encapsulating r, g, b, a.

Public fields

r int
rune (Unicode code point)
g int
field (int)
b int
field (int)
a int
field (int)

struct Gray

XuAPI
pub struct Gray {
    pub y int
}

Purpose

Structure encapsulating y.

Public fields

y int
value

struct Alpha

XuAPI
pub struct Alpha {
    pub a int
}

Purpose

Structure encapsulating a.

Public fields

a int
field (int)

struct YCbCr

XuAPI
pub struct YCbCr {
    pub y int
    pub cb int
    pub cr int
}

Purpose

Structure encapsulating y, cb, cr.

Public fields

y int
value
cb int
field (int)
cr int
field (int)

struct CMYK

XuAPI
pub struct CMYK {
    pub c int
    pub m int
    pub y int
    pub k int
}

Purpose

Structure encapsulating c, m, y, k.

Public fields

c int
byte or character code
m int
field (int)
y int
value
k int
key or index

struct RGBA16

XuAPI
pub struct RGBA16 {
    pub r int
    pub g int
    pub b int
    pub a int
}

Purpose

Structure encapsulating r, g, b, a.

Public fields

r int
rune (Unicode code point)
g int
field (int)
b int
field (int)
a int
field (int)

rgba8

XuAPI
pub fn rgba8(r int, g int, b int, a int) RGBA

Purpose

Execute rgba8.

Parameters

r int
rune (Unicode code point) (int)
g int
g (int)
b int
b (int)
a int
value (int)

Returns

RGBA — a value of this type

nrgba8

XuAPI
pub fn nrgba8(r int, g int, b int, a int) NRGBA

Purpose

Execute nrgba8.

Parameters

r int
rune (Unicode code point) (int)
g int
g (int)
b int
b (int)
a int
value (int)

Returns

NRGBA — a value of this type

gray8

XuAPI
pub fn gray8(y int) Gray

Purpose

Execute gray8.

Parameters

y int
value (int)

Returns

Gray — a value of this type

alpha8

XuAPI
pub fn alpha8(a int) Alpha

Purpose

Execute alpha8.

Parameters

a int
value (int)

Returns

Alpha — a value of this type

(RGBA) rgba

XuAPI
pub fn (c RGBA) rgba() RGBA16

Purpose

Return the corresponding 32-bit RGBA color channels.

Parameters

c RGBA
The RGBA instance used by this call (value receiver).

Returns

RGBA16 — a value of this type

(NRGBA) rgba

XuAPI
pub fn (c NRGBA) rgba() RGBA16

Purpose

Return the corresponding 32-bit RGBA color channels.

Parameters

c NRGBA
The NRGBA instance used by this call (value receiver).

Returns

RGBA16 — a value of this type

(Gray) rgba

XuAPI
pub fn (c Gray) rgba() RGBA16

Purpose

Return the corresponding 32-bit RGBA color channels.

Parameters

c Gray
The Gray instance used by this call (value receiver).

Returns

RGBA16 — a value of this type

(Alpha) rgba

XuAPI
pub fn (c Alpha) rgba() RGBA16

Purpose

Return the corresponding 32-bit RGBA color channels.

Parameters

c Alpha
The Alpha instance used by this call (value receiver).

Returns

RGBA16 — a value of this type

rgb_to_ycbcr

XuAPI
pub fn rgb_to_ycbcr(r int, g int, b int) YCbCr

Purpose

Rgb to ycbcr.

Parameters

r int
rune (Unicode code point) (int)
g int
g (int)
b int
b (int)

Returns

YCbCr — a value of this type

ycbcr_to_rgb

XuAPI
pub fn ycbcr_to_rgb(y int, cb int, cr int) RGBA

Purpose

Ycbcr to rgb.

Parameters

y int
value (int)
cb int
cb (int)
cr int
cr (int)

Returns

RGBA — a value of this type

rgb_to_cmyk

XuAPI
pub fn rgb_to_cmyk(r int, g int, b int) CMYK

Purpose

Rgb to cmyk.

Parameters

r int
rune (Unicode code point) (int)
g int
g (int)
b int
b (int)

Returns

CMYK — a value of this type

cmyk_to_rgb

XuAPI
pub fn cmyk_to_rgb(c int, m int, y int, k int) RGBA

Purpose

Cmyk to rgb.

Parameters

c int
byte or character code (int)
m int
m (int)
y int
value (int)
k int
key or index (int)

Returns

RGBA — a value of this type

(CMYK) rgba

XuAPI
pub fn (c CMYK) rgba() RGBA16

Purpose

Return the corresponding 32-bit RGBA color channels.

Parameters

c CMYK
The CMYK instance used by this call (value receiver).

Returns

RGBA16 — a value of this type