1mlib_ImageBlendColor_Inp(3MmLeIdBi)aLib Library Functmiloinbs_ImageBlendColor_Inp(3MLIB)
2
3
4

NAME

6       mlib_ImageBlendColor_Inp - blend an image and a color, in place
7

SYNOPSIS

9       cc [ flag... ] file... -lmlib [ library... ]
10       #include <mlib.h>
11
12       mlib_status mlib_ImageBlendColor_Inp(mlib_image *srcdst,
13            const mlib_s32 *color, mlib_s32 cmask);
14
15

DESCRIPTION

17       The  mlib_ImageBlendColor_Inp()  function  blends  an image and a color
18       with the alpha channel.
19
20
21       It uses the following equation:
22
23         Cd = Cs*As + Cc*(1 - As)
24         Ad = 1.0
25
26
27
28       where, Cs and Cd are the RGB color components of the source and  desti‐
29       nation images, respectively.  As and Ad are the alpha components of the
30       source and destination images, respectively. Cc is the color  component
31       of the constant color.
32
33
34       For  MLIB_BYTE  images,  the  alpha  coefficients are in Q8 format. For
35       MLIB_SHORT images, the alpha coefficients are in Q15 format and must be
36       positive.   For  MLIB_USHORT  images, the alpha coefficients are in Q16
37       format.  For MLIB_INT images, the alpha coefficients are in Q31  format
38       and must be positive.
39
40
41       The  images  can  have  two to four channels. The length of color array
42       must not be less than the number of channels in the images.
43

PARAMETERS

45       The function takes the following arguments:
46
47       srcdst    Pointer to the source and destination image.
48
49
50       color     Array of constant color components.
51
52
53       cmask     Channel mask to indicate the alpha channel. Each bit of cmask
54                 represents  a channel in the image. The channel corresponding
55                 to the highest bit with value 1 is the alpha channel.
56
57

RETURN VALUES

59       The function returns MLIB_SUCCESS if successful. Otherwise  it  returns
60       MLIB_FAILURE.
61

ATTRIBUTES

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

SEE ALSO

77       mlib_ImageBlendColor(3MLIB),            mlib_ImageBlendColor_Fp(3MLIB),
78       mlib_ImageBlendColor_Fp_Inp(3MLIB), attributes(5)
79
80
81
82SunOS 5.11                        2 Mar 2007   mlib_ImageBlendColor_Inp(3MLIB)
Impressum