cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> void mlib_VideoColorBlendABGR(mlib_u32 *dst, const mlib_u32 *src1,const mlib_u32 *src2, mlib_s32 src1_w, mlib_s32 src1_h, mlib_s32 src2_w,mlib_s32 src2_h, mlib_s32 src2_x, mlib_s32 src2_y, mlib_s32 dst_lb,mlib_s32 src1_lb, mlib_s32 src2_lb, mlib_blend src1_blend, mlib_blend src2_blend);
void mlib_VideoColorBlendABGR_ResetAlpha(mlib_u32 *dst, const mlib_u32 *src1,const mlib_u32 *src2, mlib_s32 src1_w, mlib_s32 src1_h, mlib_s32 src2_w,mlib_s32 src2_h, mlib_s32 src2_x, mlib_s32 src2_y, mlib_s32 dst_lb, mlib_s32 src1_lb, mlib_s32 src2_lb, mlib_blend src1_blend, mlib_blend src2_blend);
The functions use the following equation for blending images:
dst = (src1 * src1_blend) + (src2 * src2_blend)
The two multi-banded source images (src1 and src2) are blended together and stored in the destination image (dst). The image buffers pointed to by dst, src1, and src2 contain 4-banded ABGR images, 8 bits per component. src1_w and src1_h are the dimensions of the src1 input buffer. src2_w and src2_h are the dimensions of the src2 input buffer. The output buffer must be at least as large as the src1 input buffer. src2_x and src2_y are the offset of the src2 input buffer relative to src1. Where pixels in src2 overlap pixels in src1, the pixels are blended. Pixels in src1 which are outside of src2 are copied into dst. Pixels in the dst image outside of src1 are left unchanged. src1_blend specifies the blend function to be applied to the pixels of src1 image and src2_blend specifies the blend function to be applied to the pixels of src2.
Possible blend functions are:
MLIB_BLEND_ZERO MLIB_BLEND_ONE MLIB_BLEND_SRC_ALPHA MLIB_BLEND_ONE_MINUS_SRC_ALPHA MLIB_BLEND_DST_ALPHA MLIB_BLEND_ONE_MINUS_DST_ALPHA
MLIB_BLEND_SRC_ALPHA is the alpha component of image src2 scaled to the range 0.0 to 1.0. MLIB_BLEND_DST_ALPHA is the alpha component of image src1 scaled to the range 0.0 to 1.0. All pixel components are treated as unsigned 8-bit quantities and the output pixel component values are clamped to the range 0 to 255.
For the mlib_VideoColorBlendABGR_ResetAlpha() function, the alpha value of every pixel in destination image is set to 0 after blending is complete.
Each of the functions takes the following arguments:
See attributes(5) for descriptions of the following attributes: