From: <ai...@us...> - 2009-07-10 00:20:47
|
Revision: 10133 http://plplot.svn.sourceforge.net/plplot/?rev=10133&view=rev Author: airwin Date: 2009-07-10 00:20:46 +0000 (Fri, 10 Jul 2009) Log Message: ----------- Fix bug for old format where rgb colours were not properly normalized. Modified Paths: -------------- trunk/src/plctrl.c Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2009-07-10 00:17:31 UTC (rev 10132) +++ trunk/src/plctrl.c 2009-07-10 00:20:46 UTC (rev 10133) @@ -1344,9 +1344,11 @@ break; } return_sscanf_old = return_sscanf; - r[i] = (PLFLT)r_i; - g[i] = (PLFLT)g_i; - b[i] = (PLFLT)b_i; + /* For old format, input colours range from 0 to 255 and + need to be renormalized to the range from 0. to 1.. */ + r[i] = (PLFLT)r_i/255.; + g[i] = (PLFLT)g_i/255.; + b[i] = (PLFLT)b_i/255.; a[i] = 1.0; pos[i] = 0.01*(PLFLT)pos_i; if(return_sscanf == 5) { @@ -1369,7 +1371,9 @@ plwarn(msgbuf); err = 1; break; - } + } + /* For rgb case of new format colours are already normalized from + 0., to 1. */ r[i] = (PLFLT)r_d; g[i] = (PLFLT)g_d; b[i] = (PLFLT)b_d; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |