1mlib_ImageBlend_BSRC1_BSRC2m(e3dMiLaILBi)b Library Fumnlcitbi_oInmsageBlend_BSRC1_BSRC2(3MLIB)
2
3
4
6 mlib_ImageBlend_BSRC1_BSRC2, mlib_ImageBlend_DA_DA, mlib_Image‐
7 Blend_DA_DC, mlib_ImageBlend_DA_OMDA, mlib_ImageBlend_DA_OMDC,
8 mlib_ImageBlend_DA_OMSA, mlib_ImageBlend_DA_ONE, mlib_ImageBlend_DA_SA,
9 mlib_ImageBlend_DA_SAS, mlib_ImageBlend_DA_ZERO, mlib_Image‐
10 Blend_OMDA_DA, mlib_ImageBlend_OMDA_DC, mlib_ImageBlend_OMDA_OMDA,
11 mlib_ImageBlend_OMDA_OMDC, mlib_ImageBlend_OMDA_OMSA, mlib_Image‐
12 Blend_OMDA_ONE, mlib_ImageBlend_OMDA_SA, mlib_ImageBlend_OMDA_SAS,
13 mlib_ImageBlend_OMDA_ZERO, mlib_ImageBlend_OMSA_DA, mlib_Image‐
14 Blend_OMSA_DC, mlib_ImageBlend_OMSA_OMDA, mlib_ImageBlend_OMSA_OMDC,
15 mlib_ImageBlend_OMSA_OMSA, mlib_ImageBlend_OMSA_ONE, mlib_Image‐
16 Blend_OMSA_SA, mlib_ImageBlend_OMSA_SAS, mlib_ImageBlend_OMSA_ZERO,
17 mlib_ImageBlend_OMSC_DA, mlib_ImageBlend_OMSC_DC, mlib_Image‐
18 Blend_OMSC_OMDA, mlib_ImageBlend_OMSC_OMDC, mlib_ImageBlend_OMSC_OMSA,
19 mlib_ImageBlend_OMSC_ONE, mlib_ImageBlend_OMSC_SA, mlib_Image‐
20 Blend_OMSC_SAS, mlib_ImageBlend_OMSC_ZERO, mlib_ImageBlend_ONE_DA,
21 mlib_ImageBlend_ONE_DC, mlib_ImageBlend_ONE_OMDA, mlib_Image‐
22 Blend_ONE_OMDC, mlib_ImageBlend_ONE_OMSA, mlib_ImageBlend_ONE_ONE,
23 mlib_ImageBlend_ONE_SA, mlib_ImageBlend_ONE_SAS, mlib_Image‐
24 Blend_ONE_ZERO, mlib_ImageBlend_SA_DA, mlib_ImageBlend_SA_DC,
25 mlib_ImageBlend_SA_OMDA, mlib_ImageBlend_SA_OMDC, mlib_Image‐
26 Blend_SA_OMSA, mlib_ImageBlend_SA_ONE, mlib_ImageBlend_SA_SA,
27 mlib_ImageBlend_SA_SAS, mlib_ImageBlend_SA_ZERO, mlib_ImageBlend_SC_DA,
28 mlib_ImageBlend_SC_DC, mlib_ImageBlend_SC_OMDA, mlib_Image‐
29 Blend_SC_OMDC, mlib_ImageBlend_SC_OMSA, mlib_ImageBlend_SC_ONE,
30 mlib_ImageBlend_SC_SA, mlib_ImageBlend_SC_SAS, mlib_ImageBlend_SC_ZERO,
31 mlib_ImageBlend_ZERO_DA, mlib_ImageBlend_ZERO_DC, mlib_Image‐
32 Blend_ZERO_OMDA, mlib_ImageBlend_ZERO_OMDC, mlib_ImageBlend_ZERO_OMSA,
33 mlib_ImageBlend_ZERO_ONE, mlib_ImageBlend_ZERO_SA, mlib_Image‐
34 Blend_ZERO_SAS, mlib_ImageBlend_ZERO_ZERO - blending
35
37 cc [ flag... ] file... -lmlib [ library... ]
38 #include <mlib.h>
39
40 mlib_status mlib_ImageBlend_BSRC1_BSRC2(mlib_image *dst,
41 const mlib_image *src1, const mlib_image *src2, mlib_s32 cmask);
42
43
45 This group of functions supports digital image composition. They are
46 low-level, non-in-place, blending functions.
47
48
49 The image type must be MLIB_BYTE. The input and output images must con‐
50 tain three or four channels. For three-channel images, the alpha value
51 is as if the alpha value is 1.
52
53
54 BSRC1 is one of the following: ZERO, ONE, SC, OMSC, DA, SA, OMDA, or
55 OMSA. BSRC2 is one of the following: ZERO, ONE, DC, OMDC, DA, SA, OMDA,
56 OMSA, or SAS.
57
58
59 The following are predefined blend factor types used in mediaLib image
60 composition functions.
61
62 /* image blend factors */
63 typedef enum {
64 MLIB_BLEND_ZERO,
65 MLIB_BLEND_ONE,
66 MLIB_BLEND_DST_COLOR,
67 MLIB_BLEND_SRC_COLOR,
68 MLIB_BLEND_ONE_MINUS_DST_COLOR,
69 MLIB_BLEND_ONE_MINUS_SRC_COLOR,
70 MLIB_BLEND_DST_ALPHA,
71 MLIB_BLEND_SRC_ALPHA,
72 MLIB_BLEND_ONE_MINUS_DST_ALPHA,
73 MLIB_BLEND_ONE_MINUS_SRC_ALPHA,
74 MLIB_BLEND_SRC_ALPHA_SATURATE
75 } mlib_blend;
76
77
78
79 See the following table for the definitions of the blend factors.
80
81
82
83
84 Type Blend Factor [*] Abbr.
85 ───────────────────────────────────────────────────────────────────
86 MLIB_BLEND_ZERO (0,0,0,0) ZERO
87 MLIB_BLEND_ONE (1,1,1,1) ONE
88 MLIB_BLEND_DST_COLOR (Rd,Gd,Bd,Ad) DC
89 MLIB_BLEND_SRC_COLOR (Rs,Gs,Bs,As) SC
90 MLIB_BLEND_ONE_MINUS_DST_COLOR (1,1,1,1)-(Rd,Gd,Bd,Ad) OMDC
91 MLIB_BLEND_ONE_MINUS_SRC_COLOR (1,1,1,1)-(Rs,Gs,Bs,As) OMSC
92 MLIB_BLEND_DST_ALPHA (Ad,Ad,Ad,Ad) DA
93 MLIB_BLEND_SRC_ALPHA (As,As,As,As) SA
94 MLIB_BLEND_ONE_MINUS_DST_ALPHA (1,1,1,1)-(Ad,Ad,Ad,Ad) OMDA
95 MLIB_BLEND_ONE_MINUS_SRC_ALPHA (1,1,1,1)-(As,As,As,As) OMSA
96 MLIB_BLEND_SRC_ALPHA_SATURATE (f,f,f,1) SAS
97
98
99
100 [*]: The components of the first source image pixel are (Rd,Gd,Bd,Ad),
101 and the components of the second source pixel are (Rs,Gs,Bs,As). Func‐
102 tion f = min(As,1-Ad).
103
104
105 The blending formula for non-in-place processing is:
106
107 Cd = Cs1*S1 + Cs2*S2
108
109
110
111 where Cd is the destination pixel (Rd,Gd,Bd,Ad), Cs1 is the first
112 source pixel (Rs1,Gs1,Bs1,As1), Cs2 is the second source pixel
113 (Rs2,Gs2,Bs2,As2), and S1 and S2 are the blend factors for the first
114 and second sources, respectively.
115
117 Each of the functions takes the following arguments:
118
119 dst Pointer to destination image.
120
121
122 src1 Pointer to the first source image.
123
124
125 src2 Pointer to the second source image.
126
127
128 cmask Channel mask to indicate the alpha channel. Each bit of the
129 mask represents a channel in the image. The channel corre‐
130 sponding to the 1 bit is the alpha channel. cmask must be
131 either 0x01 or 0x08.
132
133
135 Each of the functions returns MLIB_SUCCESS if successful. Otherwise it
136 returns MLIB_FAILURE.
137
139 See attributes(5) for descriptions of the following attributes:
140
141
142
143
144 ┌─────────────────────────────┬─────────────────────────────┐
145 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
146 ├─────────────────────────────┼─────────────────────────────┤
147 │Interface Stability │Committed │
148 ├─────────────────────────────┼─────────────────────────────┤
149 │MT-Level │MT-Safe │
150 └─────────────────────────────┴─────────────────────────────┘
151
153 mlib_ImageBlend_BSRC1_BSRC2_Inp(3MLIB), mlib_ImageComposite(3MLIB),
154 mlib_ImageComposite_Inp(3MLIB), attributes(5)
155
156
157
158SunOS 5.11 2 Mar 2007mlib_ImageBlend_BSRC1_BSRC2(3MLIB)