- /* according to endPage()/compositeBackground() in xpdf/SplashOutputDev.cc, we
- have to premultiply alpha (mix background and pixel according to the alpha channel).
- */
- out[x].r = (in[x*3+0]*ain[x])/255;
- out[x].g = (in[x*3+1]*ain[x])/255;
- out[x].b = (in[x*3+2]*ain[x])/255;
- out[x].a = ain[x];
+ // blend against a white background
+ out[x].r = (in[x*3+0]*ain[x])/255 + 255-ain[x];
+ out[x].g = (in[x*3+1]*ain[x])/255 + 255-ain[x];
+ out[x].b = (in[x*3+2]*ain[x])/255 + 255-ain[x];
+ out[x].a = 255;//ain[x];