1mlib_ImageMulAlpha(3MLIB) mediaLib Library Functions mlib_ImageMulAlpha(3MLIB)
2
3
4
6 mlib_ImageMulAlpha - alpha channel multiplication
7
9 cc [ flag... ] file... -lmlib [ library... ]
10 #include <mlib.h>
11
12 mlib_status mlib_ImageMulAlpha(mlib_image *dst, const mlib_image *src,
13 mlib_s32 cmask);
14
15
17 The mlib_ImageMulAlpha() function multiplies color channels by the
18 alpha channel on a pixel by pixel basis.
19
20
21 For the MLIB_BYTE image, it uses the following equation:
22
23 dst[x][y][c] = src[x][y][c] * src[x][y][a] * 2**(-8)
24
25
26
27 For the MLIB_SHORT image, it uses the following equation:
28
29 dst[x][y][c] = src[x][y][c] * src[x][y][a] * 2**(-15)
30
31
32
33 For the MLIB_USHORT image, it uses the following equation:
34
35 dst[x][y][c] = src[x][y][c] * src[x][y][a] * 2**(-16)
36
37
38
39 For the MLIB_INT image, it uses the following equation:
40
41 dst[x][y][c] = src[x][y][c] * src[x][y][a] * 2**(-31)
42
43
44
45 where c and a are the indices for the color channels and the alpha
46 channel, respectively, so c != a.
47
49 The function takes the following arguments:
50
51 dst Pointer to destination image.
52
53
54 src Pointer to source image.
55
56
57 cmask Channel mask to indicate the alpha channel. Each bit of the
58 mask represents a channel in the image. The channel corre‐
59 sponding to the 1 bit of cmask is the alpha channel.
60
61
63 The function returns MLIB_SUCCESS if successful. Otherwise it returns
64 MLIB_FAILURE.
65
67 See attributes(5) for descriptions of the following attributes:
68
69
70
71
72 ┌─────────────────────────────┬─────────────────────────────┐
73 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
74 ├─────────────────────────────┼─────────────────────────────┤
75 │Interface Stability │Committed │
76 ├─────────────────────────────┼─────────────────────────────┤
77 │MT-Level │MT-Safe │
78 └─────────────────────────────┴─────────────────────────────┘
79
81 mlib_ImageMulAlpha_Inp(3MLIB), mlib_ImageMulAlpha_Fp(3MLIB),
82 mlib_ImageMulAlpha_Fp_Inp(3MLIB), attributes(5)
83
84
85
86SunOS 5.11 2 Mar 2007 mlib_ImageMulAlpha(3MLIB)