4. C Function

The C function for this is called monolith_gfx_blend. It does the operation described in the overview section mentioned above.

<<funcdefs>>=
void monolith_gfx_blend(monolith_pixel c0,
                        monolith_pixel c1,
                        float a,
                        monolith_pixel *out);
<<funcs>>=
<<gammafuncs>>
void monolith_gfx_blend(monolith_pixel c0,
                        monolith_pixel c1,
                        float a,
                        monolith_pixel *out)
{
    float c0_n[3];
    float c1_n[3];
    float out_n[3];
    const static float oned255 = 1.0 / 255.0;
<<normalize_colors>>
<<ungamma_stuff>>
<<lerpit>>
<<regamma_stuff>>
<<scale_and_store>>
}



prev | home | next