[GEM-dev] Re: meanwhile, in gempixutil...

Georg Holzmann grhPD at gmx.at
Tue Feb 22 16:20:11 CET 2005


Hallo!

> the problem is (i believe), that YUV does not use the whole range from 
> 0..255 but something like 16..245 (or whatever: i didn't write it down 
> and now i cannot find it); i didn't add any clipping for this (which was 
> very stupid) because of performance reasons.
It fixed this for me some months ago, but didn't send it to the list 
(because I also changed the colors r and b because they were swapped with my
webcam ...)

e.g.: GemPixUtil.cpp, line 599:

  case GL_RGBA:
  case GL_BGRA_EXT:   //  <- this is the confusing: 
		      //   RGBA and BGRA is the same !!!
    {

	...
	  
	  // 1st row - 1st pixel
	  y=*py1++;
	  yy=y<<8;
	  //*pixels1++ = (yy + ub     ) >> 8; // r
	  *pixels1++ = CLAMP( (yy +      vr) >> 8 ); // r
	  *pixels1++ = CLAMP( (yy - ug - vg) >> 8 ); // g
	  //*pixels1++ = (yy +      vr) >> 8; // b
	  *pixels1++ = CLAMP( (yy + ub     ) >> 8 ); // b
	  *pixels1++ = 255; // a
	
	...

    }

so i think you only have to CLAMP the values (at least for me it worked much
better this way)

LG
Georg

> 
> oh, bless the lazy, but i really have to find the docs somewhere.
> 
> mfg.asd.r
> IOhannes
> 
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/gem-dev
> 
> 

-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail




More information about the GEM-dev mailing list