1mlib_ImageBlend(3MLIB) mediaLib Library Functions mlib_ImageBlend(3MLIB)
2
3
4
6 mlib_ImageBlend - blend with an alpha image
7
9 cc [ flag... ] file... -lmlib [ library... ]
10 #include <mlib.h>
11
12 mlib_status mlib_ImageBlend(mlib_image *dst, const mlib_image *src1,
13 const mlib_image *src2, const mlib_image *alpha);
14
15
17 The mlib_ImageBlend() function blends two images together on a pixel-
18 by-pixel basis using an alpha image, when alpha is also on a pixel
19 basis. The alpha image can be a single-channel image or have the same
20 number of channels as the source and destination images.
21
22
23 It uses the following equation when the alpha image is a single-channel
24 image:
25
26 dst[x][y][i] = a[x][y][0]*src1[x][y][i] +
27 (1 - a[x][y][0])*src2[x][y][i]
28
29
30
31 It uses the following equation when the alpha image has the same number
32 of channels as the source and destination images:
33
34 dst[x][y][i] = a[x][y][i]*src1[x][y][i] +
35 (1 - a[x][y][i])*src2[x][y][i]
36
37
39 The function takes the following arguments:
40
41 dst Pointer to destination image.
42
43
44 src1 Pointer to first source image.
45
46
47 src2 Pointer to second source image.
48
49
50 alpha Alpha image used to control blending. The a value equals
51 (alpha * 2**(-8)) for MLIB_BYTE image, (alpha * 2**(-15)) for
52 MLIB_SHORT image, (alpha * 2**(-16)) for MLIB_USHORT image,
53 and (alpha * 2**(-31)) for MLIB_INT image.
54
55
57 The function returns MLIB_SUCCESS if successful. Otherwise it returns
58 MLIB_FAILURE.
59
61 See attributes(5) for descriptions of the following attributes:
62
63
64
65
66 ┌─────────────────────────────┬─────────────────────────────┐
67 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
68 ├─────────────────────────────┼─────────────────────────────┤
69 │Interface Stability │Committed │
70 ├─────────────────────────────┼─────────────────────────────┤
71 │MT-Level │MT-Safe │
72 └─────────────────────────────┴─────────────────────────────┘
73
75 mlib_ImageBlend_Fp(3MLIB), mlib_ImageBlend1_Fp_Inp(3MLIB), mlib_Image‐
76 Blend1_Inp(3MLIB), mlib_ImageBlend2_Fp_Inp(3MLIB), mlib_Image‐
77 Blend2_Inp(3MLIB), attributes(5)
78
79
80
81SunOS 5.11 2 Mar 2007 mlib_ImageBlend(3MLIB)