X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fgdi%2Fgpixmap.cpp;h=bcdd8346716e29fc2b66fa45734dd56a4ed5d531;hp=0e8d39ecbc8cdb53011cb29ff1022d097eeaeece;hb=7a0ae4549fab001e4902dc8616def3bcbd153a1f;hpb=31ac4a233ddcb341e49f63f964d4d35fd2097a9c diff --git a/lib/gdi/gpixmap.cpp b/lib/gdi/gpixmap.cpp old mode 100644 new mode 100755 index 0e8d39e..bcdd834 --- a/lib/gdi/gpixmap.cpp +++ b/lib/gdi/gpixmap.cpp @@ -321,6 +321,7 @@ static void blit_8i_to_32_ab(__u32 *dst, __u8 *src, __u32 *pal, int width) #define FIX 0x10000 + void gPixmap::blit(const gPixmap &src, const eRect &_pos, const gRegion &clip, int flag) { // eDebug("blit: -> %d.%d %d:%d -> %d.%d %d:%d, flags=%d", @@ -380,6 +381,77 @@ void gPixmap::blit(const gPixmap &src, const eRect &_pos, const gRegion &clip, i continue; } +#ifdef SET_RIGHT_HALF_VFD_SKIN + if ((surface->bpp == 8) && (src.surface->bpp==8)) + { + __u8 *srcptr=(__u8*)src.surface->data; + __u8 *dstptr=(__u8*)surface->data; + __u8 *nomptr = new __u8[area.width()]; + unsigned char gray_max = 0; + unsigned char gray_min = 255; + unsigned char index = 0; + unsigned char gray_value = 0; + gRGB pixdata; +// printf("[bilt]srcarea.left:%d, src.surface->bypp : %d,srcarea.top() :%d,src.surface->stride : %d\n",srcarea.left(),src.surface->bypp,srcarea.top(),src.surface->stride); + srcptr+=srcarea.left()*src.surface->bypp+srcarea.top()*src.surface->stride; +// nomptr+=srcarea.left()*src.surface->bypp+srcarea.top()*src.surface->stride; + dstptr+=area.left()*surface->bypp+area.top()*surface->stride; + for (int y=0; ystride)); + pixdata = src.surface->clut.data[index]; + gray_value = ((pixdata.r+pixdata.g +pixdata.b)/3); +// printf("%3d ",gray_value); + if(gray_value > gray_max) + gray_max = gray_value; + if(gray_value < gray_min) + gray_min = gray_value; + } +// printf("\n"); + } +// printf("\n[bilt] ### gray_min : %d, gray_max : %d\n\n",gray_min,gray_max); + for (int y=0; yclut.data[*(srcptr+x)]; + gray_value = ((pixdata.r+pixdata.g +pixdata.b)/3); + if(gray_max==gray_min) + *(nomptr+x)=gray_value; + else if(y == 0 || y == area.height()-1 || x == 0 || x == area.width()-1) + *(nomptr+x) = 255; + else + *(nomptr+x)=( ((gray_value - gray_min)*255)/(gray_max-gray_min) ); +// printf("%3d ",*(nomptr+x)); + } +// printf("\n"); + if (flag & (blitAlphaTest|blitAlphaBlend)) + { + // no real alphatest yet + int width=area.width(); +// unsigned char *src=(unsigned char*)srcptr; + unsigned char *src=(unsigned char*)nomptr; + unsigned char *dst=(unsigned char*)dstptr; + // use duff's device here! + while (width--) + { + if (!*src) + { + src++; + dst++; + } else + *dst++=*src++; + } + } else +// memcpy(dstptr, srcptr, area.width()*surface->bypp); + memcpy(dstptr, nomptr, area.width()*surface->bypp); + srcptr+=src.surface->stride; + dstptr+=surface->stride; + } + delete [] nomptr; +#else if ((surface->bpp == 8) && (src.surface->bpp==8)) { __u8 *srcptr=(__u8*)src.surface->data; @@ -410,6 +482,7 @@ void gPixmap::blit(const gPixmap &src, const eRect &_pos, const gRegion &clip, i srcptr+=src.surface->stride; dstptr+=surface->stride; } +#endif } else if ((surface->bpp == 32) && (src.surface->bpp==32)) { __u32 *srcptr=(__u32*)src.surface->data;