1mlib_ImageComposite_Inp(3MLmIeBd)iaLib Library Functimolnisb_ImageComposite_Inp(3MLIB)
2
3
4

NAME

6       mlib_ImageComposite_Inp - image composition, in place
7

SYNOPSIS

9       cc [ flag... ] file... -lmlib [ library... ]
10       #include <mlib.h>
11
12       mlib_status mlib_ImageComposite_Inp(mlib_image *src1dst,
13            const mlib_image *src2, mlib_blend bsrc1, mlib_blend bsrc2,
14            mlib_s32 cmask);
15
16

DESCRIPTION

18       The  mlib_ImageComposite_Inp() function supports digital image composi‐
19       tion.
20
21
22       It is a wrapper of the mlib_ImageBlend_BSCR1_BSRC2_Inp group  of  func‐
23       tions and can perform various types of composition based on the parame‐
24       ters  passed   in,   whereas   each   function   in   the   mlib_Image‐
25       Blend_BSCR1_BSRC2_Inp  group  can perform only the one kind of composi‐
26       tion denoted by its name.
27
28
29       The image type must be MLIB_BYTE. The input and output images must con‐
30       tain  three or four channels. For three-channel images, the alpha value
31       is as if the alpha value is 1.
32
33
34       The following are predefined blend factor types used in mediaLib  image
35       composition functions.
36
37         /* image blend factors */
38         typedef enum {
39             MLIB_BLEND_ZERO,
40             MLIB_BLEND_ONE,
41             MLIB_BLEND_DST_COLOR,
42             MLIB_BLEND_SRC_COLOR,
43             MLIB_BLEND_ONE_MINUS_DST_COLOR,
44             MLIB_BLEND_ONE_MINUS_SRC_COLOR,
45             MLIB_BLEND_DST_ALPHA,
46             MLIB_BLEND_SRC_ALPHA,
47             MLIB_BLEND_ONE_MINUS_DST_ALPHA,
48             MLIB_BLEND_ONE_MINUS_SRC_ALPHA,
49             MLIB_BLEND_SRC_ALPHA_SATURATE
50         } mlib_blend;
51
52
53
54       See the following table for the definitions of the blend factors.
55
56
57
58
59                    Type                   Blend Factor [*]        Abbr.
60       ───────────────────────────────────────────────────────────────────
61       MLIB_BLEND_ZERO                  (0,0,0,0)                 ZERO
62       MLIB_BLEND_ONE                   (1,1,1,1)                 ONE
63       MLIB_BLEND_DST_COLOR             (Rd,Gd,Bd,Ad)             DC
64       MLIB_BLEND_SRC_COLOR             (Rs,Gs,Bs,As)             SC
65       MLIB_BLEND_ONE_MINUS_DST_COLOR   (1,1,1,1)-(Rd,Gd,Bd,Ad)   OMDC
66
67       MLIB_BLEND_ONE_MINUS_SRC_COLOR   (1,1,1,1)-(Rs,Gs,Bs,As)   OMSC
68       MLIB_BLEND_DST_ALPHA             (Ad,Ad,Ad,Ad)             DA
69       MLIB_BLEND_SRC_ALPHA             (As,As,As,As)             SA
70       MLIB_BLEND_ONE_MINUS_DST_ALPHA   (1,1,1,1)-(Ad,Ad,Ad,Ad)   OMDA
71       MLIB_BLEND_ONE_MINUS_SRC_ALPHA   (1,1,1,1)-(As,As,As,As)   OMSA
72       MLIB_BLEND_SRC_ALPHA_SATURATE    (f,f,f,1)                 SAS
73
74
75
76       [*]:  The components of the first source image pixel are (Rd,Gd,Bd,Ad),
77       and the components of the second source pixel are (Rs,Gs,Bs,As).  Func‐
78       tion  f = min(As, 1-Ad). The first source image is also the destination
79       image.
80
81
82       The blending formula for in-place processing is:
83
84         Cd = Cd*D + Cs*S
85
86
87
88       where Cd is the destination pixel (Rd,Gd,Bd,Ad), Cs is the source pixel
89       (Rs,Gs,Bs,As),  and  D  and S are the blend factors for the destination
90       and source, respectively.
91

PARAMETERS

93       The function takes the following arguments:
94
95       src1dst    Pointer to the first source and the destination image.
96
97
98       src2       Pointer to the second source image.
99
100
101       bsrc1      Blend factor type for the first source image.
102
103
104       bsrc2      Blend factor type for the second source image.
105
106
107       cmask      Channel mask to indicate the alpha channel. Each bit of  the
108                  mask  represents  a channel in the image. The channel corre‐
109                  sponding to the 1 bit is the alpha channel.  cmask  must  be
110                  either 0x01 or 0x08.
111
112

RETURN VALUES

114       The  function  returns MLIB_SUCCESS if successful. Otherwise it returns
115       MLIB_FAILURE.
116

ATTRIBUTES

118       See attributes(5) for descriptions of the following attributes:
119
120
121
122
123       ┌─────────────────────────────┬─────────────────────────────┐
124       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
125       ├─────────────────────────────┼─────────────────────────────┤
126       │Interface Stability          │Committed                    │
127       ├─────────────────────────────┼─────────────────────────────┤
128       │MT-Level                     │MT-Safe                      │
129       └─────────────────────────────┴─────────────────────────────┘
130

SEE ALSO

132       mlib_ImageBlend_BSRC1_BSRC2(3MLIB),                         mlib_Image‐
133       Blend_BSRC1_BSRC2_Inp(3MLIB), mlib_ImageComposite(3MLIB), attributes(5)
134
135
136
137SunOS 5.11                        2 Mar 2007    mlib_ImageComposite_Inp(3MLIB)
Impressum