Content-type: text/html Man page of mlib_ImageBlend_BSRC1_BSRC2

mlib_ImageBlend_BSRC1_BSRC2

Section: mediaLib Library Functions (3MLIB)
Updated: 2 Mar 2007
Index Return to Main Contents
 

NAME

mlib_ImageBlend_BSRC1_BSRC2, mlib_ImageBlend_DA_DA, mlib_ImageBlend_DA_DC, mlib_ImageBlend_DA_OMDA, mlib_ImageBlend_DA_OMDC, mlib_ImageBlend_DA_OMSA, mlib_ImageBlend_DA_ONE, mlib_ImageBlend_DA_SA, mlib_ImageBlend_DA_SAS, mlib_ImageBlend_DA_ZERO, mlib_ImageBlend_OMDA_DA, mlib_ImageBlend_OMDA_DC, mlib_ImageBlend_OMDA_OMDA, mlib_ImageBlend_OMDA_OMDC, mlib_ImageBlend_OMDA_OMSA, mlib_ImageBlend_OMDA_ONE, mlib_ImageBlend_OMDA_SA, mlib_ImageBlend_OMDA_SAS, mlib_ImageBlend_OMDA_ZERO, mlib_ImageBlend_OMSA_DA, mlib_ImageBlend_OMSA_DC, mlib_ImageBlend_OMSA_OMDA, mlib_ImageBlend_OMSA_OMDC, mlib_ImageBlend_OMSA_OMSA, mlib_ImageBlend_OMSA_ONE, mlib_ImageBlend_OMSA_SA, mlib_ImageBlend_OMSA_SAS, mlib_ImageBlend_OMSA_ZERO, mlib_ImageBlend_OMSC_DA, mlib_ImageBlend_OMSC_DC, mlib_ImageBlend_OMSC_OMDA, mlib_ImageBlend_OMSC_OMDC, mlib_ImageBlend_OMSC_OMSA, mlib_ImageBlend_OMSC_ONE, mlib_ImageBlend_OMSC_SA, mlib_ImageBlend_OMSC_SAS, mlib_ImageBlend_OMSC_ZERO, mlib_ImageBlend_ONE_DA, mlib_ImageBlend_ONE_DC, mlib_ImageBlend_ONE_OMDA, mlib_ImageBlend_ONE_OMDC, mlib_ImageBlend_ONE_OMSA, mlib_ImageBlend_ONE_ONE, mlib_ImageBlend_ONE_SA, mlib_ImageBlend_ONE_SAS, mlib_ImageBlend_ONE_ZERO, mlib_ImageBlend_SA_DA, mlib_ImageBlend_SA_DC, mlib_ImageBlend_SA_OMDA, mlib_ImageBlend_SA_OMDC, mlib_ImageBlend_SA_OMSA, mlib_ImageBlend_SA_ONE, mlib_ImageBlend_SA_SA, mlib_ImageBlend_SA_SAS, mlib_ImageBlend_SA_ZERO, mlib_ImageBlend_SC_DA, mlib_ImageBlend_SC_DC, mlib_ImageBlend_SC_OMDA, mlib_ImageBlend_SC_OMDC, mlib_ImageBlend_SC_OMSA, mlib_ImageBlend_SC_ONE, mlib_ImageBlend_SC_SA, mlib_ImageBlend_SC_SAS, mlib_ImageBlend_SC_ZERO, mlib_ImageBlend_ZERO_DA, mlib_ImageBlend_ZERO_DC, mlib_ImageBlend_ZERO_OMDA, mlib_ImageBlend_ZERO_OMDC, mlib_ImageBlend_ZERO_OMSA, mlib_ImageBlend_ZERO_ONE, mlib_ImageBlend_ZERO_SA, mlib_ImageBlend_ZERO_SAS, mlib_ImageBlend_ZERO_ZERO - blending  

SYNOPSIS

cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>

mlib_status mlib_ImageBlend_BSRC1_BSRC2(mlib_image *dst,
    const mlib_image *src1, const mlib_image *src2, mlib_s32 cmask);

 

DESCRIPTION

This group of functions supports digital image composition. They are low-level, non-in-place, blending functions.

The image type must be MLIB_BYTE. 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.

BSRC1 is one of the following: ZERO, ONE, SC, OMSC, DA, SA, OMDA, or OMSA. BSRC2 is one of the following: ZERO, ONE, DC, OMDC, DA, SA, OMDA, OMSA, or SAS.

The following are predefined blend factor types used in mediaLib image composition functions.

/* image blend factors */
typedef enum {
   MLIB_BLEND_ZERO,
   MLIB_BLEND_ONE,
   MLIB_BLEND_DST_COLOR,
   MLIB_BLEND_SRC_COLOR,
   MLIB_BLEND_ONE_MINUS_DST_COLOR,
   MLIB_BLEND_ONE_MINUS_SRC_COLOR,
   MLIB_BLEND_DST_ALPHA,
   MLIB_BLEND_SRC_ALPHA,
   MLIB_BLEND_ONE_MINUS_DST_ALPHA,
   MLIB_BLEND_ONE_MINUS_SRC_ALPHA,
   MLIB_BLEND_SRC_ALPHA_SATURATE
} mlib_blend;

See the following table for the definitions of the blend factors.

TypeBlend Factor [*]Abbr.

MLIB_BLEND_ZERO(0,0,0,0)ZERO
MLIB_BLEND_ONE
MLIB_BLEND_DST_COLOR
MLIB_BLEND_SRC_COLOR
MLIB_BLEND_ONE_MINUS_DST_COLOR
MLIB_BLEND_ONE_MINUS_SRC_COLOR
MLIB_BLEND_DST_ALPHA
MLIB_BLEND_SRC_ALPHA
MLIB_BLEND_ONE_MINUS_DST_ALPHA
MLIB_BLEND_ONE_MINUS_SRC_ALPHA
MLIB_BLEND_SRC_ALPHA_SATURATE

[*]: 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 blending formula for non-in-place processing is:

Cd = Cs1*S1 + Cs2*S2

where Cd is the destination pixel (Rd,Gd,Bd,Ad), Cs1 is the first source pixel (Rs1,Gs1,Bs1,As1), Cs2 is the second source pixel (Rs2,Gs2,Bs2,As2), and S1 and S2 are the blend factors for the first and second sources, respectively.  

PARAMETERS

Each of the functions takes the following arguments:

dst

Pointer to destination image.

src1

Pointer to the first source image.

src2

Pointer to 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 0x08.

 

RETURN VALUES

Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.  

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE

Interface StabilityCommitted

MT-Level

 

SEE ALSO

mlib_ImageBlend_BSRC1_BSRC2_Inp(3MLIB), mlib_ImageComposite(3MLIB), mlib_ImageComposite_Inp(3MLIB), attributes(5)


 

Index

NAME
SYNOPSIS
DESCRIPTION
PARAMETERS
RETURN VALUES
ATTRIBUTES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 02:37:51 GMT, October 02, 2010