1mlib_ImageColorRGB2HSV_Fp(3mMeLdIiBa)Lib Library Funcmtliiobn_sImageColorRGB2HSV_Fp(3MLIB)
2
3
4

NAME

6       mlib_ImageColorRGB2HSV_Fp - RGB to HSV color conversion
7

SYNOPSIS

9       cc [ flag... ] file... -lmlib [ library... ]
10       #include <mlib.h>
11
12       mlib_status mlib_ImageColorRGB2HSV_Fp(mlib_image *dst,
13            const mlib_image *src);
14
15

DESCRIPTION

17       The  mlib_ImageColorRGB2HSV_Fp()  function  performs  a conversion from
18       red/green/blue to  hue/saturation/value.  The  source  and  destination
19       images must be three-channel images.
20
21
22       It uses the following equations:
23
24            V = max(R, G, B)
25         Vmin = min(R, G, B)
26
27            S = (V - Vmin)/V
28
29            H = (5.0 + (V - B)/(V - Vmin))/6  if R = V and G = Vmin
30            H = (1.0 - (V - G)/(V - Vmin))/6  if R = V and B = Vmin
31            H = (1.0 + (V - R)/(V - Vmin))/6  if G = V and B = Vmin
32            H = (3.0 - (V - B)/(V - Vmin))/6  if G = V and R = Vmin
33            H = (3.0 + (V - G)/(V - Vmin))/6  if B = V and R = Vmin
34            H = (5.0 - (V - R)/(V - Vmin))/6  if B = V and G = Vmin
35            H = 0.0                           if R = G = B
36
37
38
39       where 0 ≤ R, G, B, V, Vmin, S ≤ 1 and 0 ≤ H < 1.
40
41
42       For MLIB_FLOAT and MLIB_DOUBLE images, the above equations are followed
43       verbatim. Input R, G, and B component values must  be  limited  to  the
44       [0.0, 1.0] range.
45

PARAMETERS

47       The function takes the following arguments:
48
49       dst    Pointer to destination image.
50
51
52       src    Pointer to source image.
53
54

RETURN VALUES

56       The  function  returns MLIB_SUCCESS if successful. Otherwise it returns
57       MLIB_FAILURE.
58

ATTRIBUTES

60       See attributes(5) for descriptions of the following attributes:
61
62
63
64
65       ┌─────────────────────────────┬─────────────────────────────┐
66       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
67       ├─────────────────────────────┼─────────────────────────────┤
68       │Interface Stability          │Committed                    │
69       ├─────────────────────────────┼─────────────────────────────┤
70       │MT-Level                     │MT-Safe                      │
71       └─────────────────────────────┴─────────────────────────────┘
72

SEE ALSO

74       mlib_ImageColorHSV2RGB(3MLIB),        mlib_ImageColorHSV2RGB_Fp(3MLIB),
75       mlib_ImageColorRGB2HSV(3MLIB), attributes(5)
76
77
78
79SunOS 5.11                        2 Mar 2007  mlib_ImageColorRGB2HSV_Fp(3MLIB)
Impressum