mediaLib Library Functions mlibImageCompositeInp(3MLIB)
NAME
mlibImageCompositeInp - image composition, in place
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include
mlibstatus mlibImageCompositeInp(mlibimage *src1dst,
const mlibimage *src2, mlibblend bsrc1, mlibblend bsrc2,
mlibs32 cmask);
DESCRIPTION
The mlibImageCompositeInp() function supports digital
image composition.
It is a wrapper of the mlibImageBlendBSCR1BSRC2Inp group
of functions and can perform various types of composition
based on the parameters passed in, whereas each function in
the mlibImageBlendBSCR1BSRC2Inp group can perform only
the one kind of composition denoted by its name.
The image type must be MLIBYTE. The input and output
images must contain three or four channels. For three-
channel images, the alpha value is as if the alpha value is
1.
The following are predefined blend factor types used in
mediaLib image composition functions.
/* image blend factors */
typedef enum {
MLIBLENDZERO,
MLIBLENDONE,
MLIBLENDSTCOLOR,
MLIBLENDSRCOLOR,
MLIBLENDONEMINUSDSTCOLOR,
MLIBLENDONEMINUSRCOLOR,
MLIBLENDSTALPHA,
MLIBLENDSRCALPHA,
MLIBLENDONEMINUSDSTALPHA,
MLIBLENDONEMINUSRCALPHA,
MLIBLENDSRCALPHASATURATE
} mlibblend;
See the following table for the definitions of the blend
factors.
SunOS 5.11 Last change: 2 Mar 2007 1
mediaLib Library Functions mlibImageCompositeInp(3MLIB)
Type Blend Factor [*] Abbr.
MLIBLENDZERO (0,0,0,0) ZERO
MLIBLENDONE (1,1,1,1) ONE
MLIBLENDSTCOLOR (Rd,Gd,Bd,Ad) DC
MLIBLENDSRCOLOR (Rs,Gs,Bs,As) SC
MLIBLENDONEMINUSDSTCOLOR (1,1,1,1)-(Rd,Gd,Bd,Ad) OMDC
MLIBLENDONEMINUSRCOLOR (1,1,1,1)-(Rs,Gs,Bs,As) OMSC
MLIBLENDSTALPHA (Ad,Ad,Ad,Ad) DA
MLIBLENDSRCALPHA (As,As,As,As) SA
MLIBLENDONEMINUSDSTALPHA (1,1,1,1)-(Ad,Ad,Ad,Ad) OMDA
MLIBLENDONEMINUSRCALPHA (1,1,1,1)-(As,As,As,As) OMSA
MLIBLENDSRCALPHASATURATE (f,f,f,1) SAS
[*]: The components of the first source image pixel are
(Rd,Gd,Bd,Ad), and the components of the second source pixel
are (Rs,Gs,Bs,As). Function f = min(As, 1-Ad). The first
source image is also the destination image.
The blending formula for in-place processing is:
Cd = Cd*D ] Cs*S
where Cd is the destination pixel (Rd,Gd,Bd,Ad), Cs is the
source pixel (Rs,Gs,Bs,As), and D and S are the blend fac-
tors for the destination and source, respectively.
PARAMETERS
The function takes the following arguments:
src1dst Pointer to the first source and the destination
image.
src2 Pointer to the second source image.
bsrc1 Blend factor type for the first source image.
bsrc2 Blend factor type for the second source image.
cmask Channel mask to indicate the alpha channel. Each
bit of the mask represents a channel in the
image. The channel corresponding to the 1 bit is
the alpha channel. cmask must be either 0x01 or
SunOS 5.11 Last change: 2 Mar 2007 2
mediaLib Library Functions mlibImageCompositeInp(3MLIB)
0x08.
RETURN VALUES
The function returns MLIBSUCES if successful. Otherwise
it returns MLIBFAILURE.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
SEE ALSO
mlibImageBlendBSRC1BSRC2(3MLIB),
mlibImageBlendBSRC1BSRC2Inp(3MLIB),
mlibImageComposite(3MLIB), attributes(5)
SunOS 5.11 Last change: 2 Mar 2007 3
|