From: Chang.H.S Date: Tue, 22 Nov 2011 10:04:26 +0000 (+0900) Subject: gpixmap : fix bug for no palette png X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=f311beabeeef73e130f84c982db80ca55d4859dd gpixmap : fix bug for no palette png --- diff --git a/lib/gdi/gpixmap.cpp b/lib/gdi/gpixmap.cpp index bcdd834..ee304cf 100755 --- a/lib/gdi/gpixmap.cpp +++ b/lib/gdi/gpixmap.cpp @@ -396,37 +396,56 @@ void gPixmap::blit(const gPixmap &src, const eRect &_pos, const gRegion &clip, i 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; yclut.colors != 0) { - for(int x=0;xstride)); - 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; + for(int x=0;xstride)); + 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"); } // printf("\n[bilt] ### gray_min : %d, gray_max : %d\n\n",gray_min,gray_max); for (int y=0; yclut.colors != 0) + { + for(int x=0;xclut.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"); + } + else { - pixdata = src.surface->clut.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)); + for(int x=0;x