1mlib_ImageColorHSL2RGB_Fp(3mMeLdIiBa)Lib Library Funcmtliiobn_sImageColorHSL2RGB_Fp(3MLIB)
2
3
4
6 mlib_ImageColorHSL2RGB_Fp - HSL to RGB color conversion
7
9 cc [ flag... ] file... -lmlib [ library... ]
10 #include <mlib.h>
11
12 mlib_status mlib_ImageColorHSL2RGB_Fp(mlib_image *dst,
13 const mlib_image *src);
14
15
17 The mlib_ImageColorHSL2RGB_Fp() function performs a conversion from
18 hue/saturation/lightness to red/green/blue. The source and destination
19 images must be three-channel images.
20
21
22 It uses the following equations:
23
24 L' = L if L ≤ 1/2
25 L' = 1 - L if L > 1/2
26
27 V = L + S*L'
28 P = L - S*L'
29 Q = L + S*L'*(1 - 2*fraction(H*6))
30 T = L - S*L'*(1 - 2*fraction(H*6))
31
32 R, G, B = V, T, P if 0 ≤ H < 1/6
33 R, G, B = Q, V, P if 1/6 ≤ H < 2/6
34 R, G, B = P, V, T if 2/6 ≤ H < 3/6
35 R, G, B = P, Q, V if 3/6 ≤ H < 4/6
36 R, G, B = T, P, V if 4/6 ≤ H < 5/6
37 R, G, B = V, P, Q if 5/6 ≤ H < 1
38
39
40
41 where 0 ≤ H < 1 and 0 ≤ S, L, L', V, P, Q, T, R, G, B ≤ 1.
42
43
44 For MLIB_FLOAT and MLIB_DOUBLE images, the above equations are followed
45 verbatim. Input H component values must be limited to the [0.0, 1.0)
46 range. Input S and L component values must be limited to the [0.0, 1.0]
47 range.
48
50 The function takes the following arguments:
51
52 dst Pointer to destination image.
53
54
55 src Pointer to source image.
56
57
59 The function returns MLIB_SUCCESS if successful. Otherwise it returns
60 MLIB_FAILURE.
61
63 See attributes(5) for descriptions of the following attributes:
64
65
66
67
68 ┌─────────────────────────────┬─────────────────────────────┐
69 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
70 ├─────────────────────────────┼─────────────────────────────┤
71 │Interface Stability │Committed │
72 ├─────────────────────────────┼─────────────────────────────┤
73 │MT-Level │MT-Safe │
74 └─────────────────────────────┴─────────────────────────────┘
75
77 mlib_ImageColorHSL2RGB(3MLIB), mlib_ImageColorRGB2HSL(3MLIB),
78 mlib_ImageColorRGB2HSL_Fp(3MLIB), attributes(5)
79
80
81
82SunOS 5.11 12 Sep 2007 mlib_ImageColorHSL2RGB_Fp(3MLIB)