Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

blit_macros.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct  SDL_PixelFormat

Defines

#define FORMAT_EQUAL(A, B)
#define RGB_FROM_PIXEL(pixel, fmt, r, g, b)
#define DISEMBLE_RGB(buf, bpp, fmt, pixel, r, g, b)
#define PIXEL_FROM_RGB(pixel, fmt, r, g, b)
#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b)
#define RGBA_FROM_PIXEL(pixel, fmt, r, g, b, a)
#define DISEMBLE_RGBA(buf, bpp, fmt, pixel, r, g, b, a)
#define PIXEL_FROM_RGBA(pixel, fmt, r, g, b, a)
#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)
#define ALPHA_BLEND(sR, sG, sB, A, Adiv, dR, dG, dB)


Define Documentation

#define ALPHA_BLEND( sR, sG, sB, A, Adiv, dR, dG, dB )
 

Value:

{                                                                       \
        dR = ((unsigned short)sR*(Adiv-A) + (unsigned short)dR*A) / Adiv;               \
        dG = ((unsigned short)sG*(Adiv-A) + (unsigned short)dG*A) / Adiv;               \
        dB = ((unsigned short)sB*(Adiv-A) + (unsigned short)dB*A) / Adiv;               \
}

Definition at line 198 of file blit_macros.h.

#define ASSEMBLE_RGB( buf, bpp, fmt, r, g, b )
 

Value:

{                                                                       \
        switch (bpp) {                                                  \
                case 2: {                                               \
                        unsigned short pixel;                                   \
                                                                        \
                        PIXEL_FROM_RGB(pixel, fmt, r, g, b);            \
                        *((unsigned short *)(buf)) = pixel;                     \
                }                                                       \
                break;                                                  \
                                                                        \
                case 3: {                                               \
                        *((buf)+fmt->Rshift/8) = r;                     \
                        *((buf)+fmt->Gshift/8) = g;                     \
                        *((buf)+fmt->Bshift/8) = b;                     \
                }                                                       \
                break;                                                  \
                                                                        \
                case 4: {                                               \
                        unsigned int pixel;                                     \
                                                                        \
                        PIXEL_FROM_RGB(pixel, fmt, r, g, b);            \
                        *((unsigned int *)(buf)) = pixel;                       \
                }                                                       \
                break;                                                  \
        }                                                               \
}

Definition at line 100 of file blit_macros.h.

#define ASSEMBLE_RGBA( buf, bpp, fmt, r, g, b, a )
 

Value:

{                                                                       \
        switch (bpp) {                                                  \
                case 2: {                                               \
                        unsigned short pixel;                                   \
                                                                        \
                        PIXEL_FROM_RGBA(pixel, fmt, r, g, b, a);        \
                        *((unsigned short *)(buf)) = pixel;                     \
                }                                                       \
                break;                                                  \
                                                                        \
                case 3: {               \
                        *((buf)+fmt->Rshift/8) = r;                     \
                        *((buf)+fmt->Gshift/8) = g;                     \
                        *((buf)+fmt->Bshift/8) = b;                     \
                }                                                       \
                break;                                                  \
                                                                        \
                case 4: {                                               \
                        unsigned int pixel;                                     \
                                                                        \
                        PIXEL_FROM_RGBA(pixel, fmt, r, g, b, a);        \
                        *((unsigned int *)(buf)) = pixel;                       \
                }                                                       \
                break;                                                  \
        }                                                               \
}

Definition at line 169 of file blit_macros.h.

#define DISEMBLE_RGB( buf, bpp, fmt, pixel, r, g, b )
 

Value:

{                                                                       \
        switch (bpp) {                                                  \
                case 2:                                                 \
                        pixel = *((unsigned short *)(buf));                     \
                        RGB_FROM_PIXEL(pixel, fmt, r, g, b);            \
                break;                                                  \
                                                                        \
                case 3:                                                 \
                        r = *(((unsigned char *)buf)+fmt->Rshift/8);            \
                        g = *(((unsigned char *)buf)+fmt->Gshift/8);            \
                        b = *(((unsigned char *)buf)+fmt->Bshift/8);            \
                        pixel = (r<<fmt->Rshift)|                       \
                                (g<<fmt->Gshift)|                       \
                                (b<<fmt->Bshift);                       \
                break;                                                  \
                                                                        \
                case 4:                                                 \
                        pixel = *((unsigned int *)(buf));                       \
                        RGB_FROM_PIXEL(pixel, fmt, r, g, b);            \
                break;                                                  \
        }                                                               \
}

Definition at line 70 of file blit_macros.h.

#define DISEMBLE_RGBA( buf, bpp, fmt, pixel, r, g, b, a )
 

Value:

{                                                                       \
        switch (bpp) {                                                  \
                case 2:                                                 \
                        pixel = *((unsigned short *)(buf));                     \
                        RGBA_FROM_PIXEL(pixel, fmt, r, g, b, a);        \
                        pixel &= ~fmt->Amask;                           \
                break;                                                  \
                                                                        \
                case 3:                 \
                        r = *(((unsigned char *)buf)+fmt->Rshift/8);            \
                        g = *(((unsigned char *)buf)+fmt->Gshift/8);            \
                        b = *(((unsigned char *)buf)+fmt->Bshift/8);            \
                        a = 0;                                          \
                        pixel = (r<<fmt->Rshift)|                       \
                                (g<<fmt->Gshift)|                       \
                                (b<<fmt->Bshift);                       \
                break;                                                  \
                                                                        \
                case 4:                                                 \
                        pixel = *((unsigned int *)(buf));                       \
                        RGBA_FROM_PIXEL(pixel, fmt, r, g, b, a);        \
                        pixel &= ~fmt->Amask;                           \
                break;                                                  \
        }                                                               \
}

Definition at line 135 of file blit_macros.h.

#define FORMAT_EQUAL( A, B )
 

Value:

        (((A)->BitsPerPixel == (B)->BitsPerPixel) && ((A)->Rmask == (B)->Rmask))

Definition at line 60 of file blit_macros.h.

#define PIXEL_FROM_RGB( pixel, fmt, r, g, b )
 

Value:

{                                                                       \
        pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|                         \
                ((g>>fmt->Gloss)<<fmt->Gshift)|                         \
                ((b>>fmt->Bloss)<<fmt->Bshift);                         \
}

Definition at line 94 of file blit_macros.h.

#define PIXEL_FROM_RGBA( pixel, fmt, r, g, b, a )
 

Value:

{                                                                       \
        pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|                         \
                ((g>>fmt->Gloss)<<fmt->Gshift)|                         \
                ((b>>fmt->Bloss)<<fmt->Bshift)|                         \
                (a<<fmt->Ashift);                                       \
}

Definition at line 162 of file blit_macros.h.

#define RGBA_FROM_PIXEL( pixel, fmt, r, g, b, a )
 

Value:

{                                                                       \
        r = (((pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss);            \
        g = (((pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss);            \
        b = (((pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss);            \
        a =  ((pixel&fmt->Amask)>>fmt->Ashift);                         \
}

Definition at line 128 of file blit_macros.h.

#define RGB_FROM_PIXEL( pixel, fmt, r, g, b )
 

Value:

{                                                                       \
        r = (((pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss);            \
        g = (((pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss);            \
        b = (((pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss);            \
}

Definition at line 64 of file blit_macros.h.


Generated at Wed Apr 4 19:54:07 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001