Bug 9386

Summary: Incorrect gray calculation in SplashOutputDev::setFillColor
Product: poppler Reporter: Scott Turner <scotty1024>
Component: splash backendAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Scott Turner 2006-12-18 14:00:46 UTC
In SplashOutputDev.cc in method void SplashOutputDev::setFillColor(int r, int g, int b) 

  gray = (GfxColorComp)(0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.g + 0.5);

Should be:

  gray = (GfxColorComp)(0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.r + 0.5);

This leads to an incorrectly calculated grey value, which is only really annoying on a grey scale device such 
as an iRex iLiad.
Comment 1 James Cloos 2006-12-19 11:18:03 UTC
:-)

Presumably that should be “0.114 * rgb.b”, eh?
                                       ↑

☺
Comment 2 Scott Turner 2006-12-19 12:09:37 UTC
Huh yeah, that's what I meant! :-)
Comment 3 Albert Astals Cid 2006-12-19 12:28:15 UTC
Fixed, thanks for reporting.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.