1mlib_ImageBlend_BSRC1_BSRC2m_eIdnipa(L3iMbLILBi)brarmyliFbu_nIcmtaigoenBslend_BSRC1_BSRC2_Inp(3MLIB)
2
3
4
6 mlib_ImageBlend_BSRC1_BSRC2_Inp, mlib_ImageBlend_DA_DA_Inp, mlib_Image‐
7 Blend_DA_DC_Inp, mlib_ImageBlend_DA_OMDA_Inp, mlib_Image‐
8 Blend_DA_OMDC_Inp, mlib_ImageBlend_DA_OMSA_Inp, mlib_Image‐
9 Blend_DA_ONE_Inp, mlib_ImageBlend_DA_SA_Inp, mlib_Image‐
10 Blend_DA_SAS_Inp, mlib_ImageBlend_DA_ZERO_Inp, mlib_Image‐
11 Blend_OMDA_DA_Inp, mlib_ImageBlend_OMDA_DC_Inp, mlib_Image‐
12 Blend_OMDA_OMDA_Inp, mlib_ImageBlend_OMDA_OMDC_Inp, mlib_Image‐
13 Blend_OMDA_OMSA_Inp, mlib_ImageBlend_OMDA_ONE_Inp, mlib_Image‐
14 Blend_OMDA_SA_Inp, mlib_ImageBlend_OMDA_SAS_Inp, mlib_Image‐
15 Blend_OMDA_ZERO_Inp, mlib_ImageBlend_OMSA_DA_Inp, mlib_Image‐
16 Blend_OMSA_DC_Inp, mlib_ImageBlend_OMSA_OMDA_Inp, mlib_Image‐
17 Blend_OMSA_OMDC_Inp, mlib_ImageBlend_OMSA_OMSA_Inp, mlib_Image‐
18 Blend_OMSA_ONE_Inp, mlib_ImageBlend_OMSA_SA_Inp, mlib_Image‐
19 Blend_OMSA_SAS_Inp, mlib_ImageBlend_OMSA_ZERO_Inp, mlib_Image‐
20 Blend_OMSC_DA_Inp, mlib_ImageBlend_OMSC_DC_Inp, mlib_Image‐
21 Blend_OMSC_OMDA_Inp, mlib_ImageBlend_OMSC_OMDC_Inp, mlib_Image‐
22 Blend_OMSC_OMSA_Inp, mlib_ImageBlend_OMSC_ONE_Inp, mlib_Image‐
23 Blend_OMSC_SA_Inp, mlib_ImageBlend_OMSC_SAS_Inp, mlib_Image‐
24 Blend_OMSC_ZERO_Inp, mlib_ImageBlend_ONE_DA_Inp, mlib_Image‐
25 Blend_ONE_DC_Inp, mlib_ImageBlend_ONE_OMDA_Inp, mlib_Image‐
26 Blend_ONE_OMDC_Inp, mlib_ImageBlend_ONE_OMSA_Inp, mlib_Image‐
27 Blend_ONE_ONE_Inp, mlib_ImageBlend_ONE_SA_Inp, mlib_Image‐
28 Blend_ONE_SAS_Inp, mlib_ImageBlend_ONE_ZERO_Inp, mlib_Image‐
29 Blend_SA_DA_Inp, mlib_ImageBlend_SA_DC_Inp, mlib_Image‐
30 Blend_SA_OMDA_Inp, mlib_ImageBlend_SA_OMDC_Inp, mlib_Image‐
31 Blend_SA_OMSA_Inp, mlib_ImageBlend_SA_ONE_Inp, mlib_Image‐
32 Blend_SA_SA_Inp, mlib_ImageBlend_SA_SAS_Inp, mlib_Image‐
33 Blend_SA_ZERO_Inp, mlib_ImageBlend_SC_DA_Inp, mlib_Image‐
34 Blend_SC_DC_Inp, mlib_ImageBlend_SC_OMDA_Inp, mlib_Image‐
35 Blend_SC_OMDC_Inp, mlib_ImageBlend_SC_OMSA_Inp, mlib_Image‐
36 Blend_SC_ONE_Inp, mlib_ImageBlend_SC_SA_Inp, mlib_Image‐
37 Blend_SC_SAS_Inp, mlib_ImageBlend_SC_ZERO_Inp, mlib_Image‐
38 Blend_ZERO_DA_Inp, mlib_ImageBlend_ZERO_DC_Inp, mlib_Image‐
39 Blend_ZERO_OMDA_Inp, mlib_ImageBlend_ZERO_OMDC_Inp, mlib_Image‐
40 Blend_ZERO_OMSA_Inp, mlib_ImageBlend_ZERO_ONE_Inp, mlib_Image‐
41 Blend_ZERO_SA_Inp, mlib_ImageBlend_ZERO_SAS_Inp, mlib_Image‐
42 Blend_ZERO_ZERO_Inp - blending, in place
43
45 cc [ flag... ] file... -lmlib [ library... ]
46 #include <mlib.h>
47
48 mlib_status mlib_ImageBlend_BSRC1_BSRC2_Inp(mlib_image *src1dst,
49 const mlib_image *src2, mlib_s32 cmask);
50
51
53 This group of functions supports digital image composition. They are
54 low-level, in-place, blending functions.
55
56
57 The image type must be MLIB_BYTE. The input and output images must con‐
58 tain three or four channels. For three-channel images, the alpha value
59 is as if the alpha value is 1.
60
61
62 BSRC1 is one of the following: ZERO, ONE, SC, OMSC, DA, SA, OMDA, or
63 OMSA. BSRC2 is one of the following: ZERO, ONE, DC, OMDC, DA, SA, OMDA,
64 OMSA, or SAS.
65
66
67 The following are predefined blend factor types used in mediaLib image
68 composition functions.
69
70 /* image blend factors */
71 typedef enum {
72 MLIB_BLEND_ZERO,
73 MLIB_BLEND_ONE,
74 MLIB_BLEND_DST_COLOR,
75 MLIB_BLEND_SRC_COLOR,
76 MLIB_BLEND_ONE_MINUS_DST_COLOR,
77 MLIB_BLEND_ONE_MINUS_SRC_COLOR,
78 MLIB_BLEND_DST_ALPHA,
79 MLIB_BLEND_SRC_ALPHA,
80 MLIB_BLEND_ONE_MINUS_DST_ALPHA,
81 MLIB_BLEND_ONE_MINUS_SRC_ALPHA,
82 MLIB_BLEND_SRC_ALPHA_SATURATE
83 } mlib_blend;
84
85
86
87 See the following table for the definitions of the blend factors.
88
89
90
91
92 Type Blend Factor [*] Abbr.
93 ───────────────────────────────────────────────────────────────────
94 MLIB_BLEND_ZERO (0,0,0,0) ZERO
95 MLIB_BLEND_ONE (1,1,1,1) ONE
96 MLIB_BLEND_DST_COLOR (Rd,Gd,Bd,Ad) DC
97 MLIB_BLEND_SRC_COLOR (Rs,Gs,Bs,As) SC
98 MLIB_BLEND_ONE_MINUS_DST_COLOR (1,1,1,1)-(Rd,Gd,Bd,Ad) OMDC
99 MLIB_BLEND_ONE_MINUS_SRC_COLOR (1,1,1,1)-(Rs,Gs,Bs,As) OMSC
100 MLIB_BLEND_DST_ALPHA (Ad,Ad,Ad,Ad) DA
101 MLIB_BLEND_SRC_ALPHA (As,As,As,As) SA
102 MLIB_BLEND_ONE_MINUS_DST_ALPHA (1,1,1,1)-(Ad,Ad,Ad,Ad) OMDA
103 MLIB_BLEND_ONE_MINUS_SRC_ALPHA (1,1,1,1)-(As,As,As,As) OMSA
104 MLIB_BLEND_SRC_ALPHA_SATURATE (f,f,f,1) SAS
105
106
107
108 [*]: The components of the first source image pixel are (Rd,Gd,Bd,Ad),
109 and the components of the second source pixel are (Rs,Gs,Bs,As). Func‐
110 tion f = min(As,1-Ad). The first source image is also the destination
111 image.
112
113
114 The blending formula for in-place processing is:
115
116 Cd = Cd*D + Cs*S
117
118
119
120 where Cd is the destination pixel (Rd,Gd,Bd,Ad), Cs is the source pixel
121 (Rs,Gs,Bs,As), and D and S are the blend factors for the destination
122 and source, respectively.
123
125 Each of the functions takes the following arguments:
126
127 src1dst Pointer to the first source and the destination image.
128
129
130 src2 Pointer to the second source image.
131
132
133 cmask Channel mask to indicate the alpha channel. Each bit of the
134 mask represents a channel in the image. The channel corre‐
135 sponding to the 1 bit is the alpha channel. cmask must be
136 either 0x01 or 0x08.
137
138
140 Each of the functions returns MLIB_SUCCESS if successful. Otherwise it
141 returns MLIB_FAILURE.
142
144 See attributes(5) for descriptions of the following attributes:
145
146
147
148
149 ┌─────────────────────────────┬─────────────────────────────┐
150 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
151 ├─────────────────────────────┼─────────────────────────────┤
152 │Interface Stability │Committed │
153 ├─────────────────────────────┼─────────────────────────────┤
154 │MT-Level │MT-Safe │
155 └─────────────────────────────┴─────────────────────────────┘
156
158 mlib_ImageBlend_BSRC1_BSRC2(3MLIB), mlib_ImageComposite(3MLIB),
159 mlib_ImageComposite_Inp(3MLIB), attributes(5)
160
161
162
163SunOS 5.11 2 Mar 2m0l0i7b_ImageBlend_BSRC1_BSRC2_Inp(3MLIB)