mmsfb_drawline_blend_argb.cpp File Reference

#include "mmsgui/fb/mmsfbconv.h"
#include "mmstools/mmstools.h"

Include dependency graph for mmsfb_drawline_blend_argb.cpp:

Go to the source code of this file.


Defines

#define MMSFB_DRAWLINE_BLEND_PIXEL

Functions

void mmsfb_drawline_blend_argb (MMSFBSurfacePlanes *dst_planes, int dst_height, MMSFBRegion &clipreg, int x1, int y1, int x2, int y2, MMSFBColor &color)
 Draw line with alpha blending ARGB.

Define Documentation

#define MMSFB_DRAWLINE_BLEND_PIXEL

Value:

if ((x >= clipreg.x1)&&(x <= clipreg.x2)&&(y >= clipreg.y1)&&(y <= clipreg.y2)) { \
        register unsigned int DST = dst[x+y*dst_pitch_pix]; \
        if (DST==OLDDST) dst[x+y*dst_pitch_pix] = d;  else { \
        OLDDST = DST; \
        register int SA= 0x100 - A; \
        unsigned int a = DST >> 24; \
        unsigned int r = (DST << 8) >> 24; \
        unsigned int g = (DST << 16) >> 24; \
        unsigned int b = DST & 0xff; \
        a = (SA * a) >> 8; \
        r = (SA * r) >> 8; \
        g = (SA * g) >> 8; \
        b = (SA * b) >> 8; \
        a += A; \
        r += (SRC << 8) >> 24; \
        g += (SRC << 16) >> 24; \
        b += SRC & 0xff; \
        d =   ((a >> 8) ? 0xff000000 : (a << 24)) \
            | ((r >> 8) ? 0xff0000   : (r << 16)) \
            | ((g >> 8) ? 0xff00     : (g << 8)) \
            | ((b >> 8) ? 0xff       :  b); \
        dst[x+y*dst_pitch_pix] = d; } }

Definition at line 36 of file mmsfb_drawline_blend_argb.cpp.


Function Documentation

void mmsfb_drawline_blend_argb ( MMSFBSurfacePlanes dst_planes,
int  dst_height,
MMSFBRegion clipreg,
int  x1,
int  y1,
int  x2,
int  y2,
MMSFBColor color 
)

Draw line with alpha blending ARGB.

Author:
Jens Schneider

Definition at line 60 of file mmsfb_drawline_blend_argb.cpp.