On Sun, Aug 23, 2009 at 2:31 PM, Alan W. Irwin<ir...@beluga.phys.uvic.ca> wrote: > On 2009-08-23 18:40+0100 Andrew Ross wrote: ... < Long, detailed discussion cut> ... >> Let's not have a mix of palette files and hard coded otherwise it will >> produce >> very unexpected results where the user has changed the default palette >> from >> that hard coded into plplot. It may need a little more thought but the >> right >> solution is definitely to disentagle and loops from plspal / plscmap0n. >> > > Thanks, Andrew, for your thoughts on this. Motivated by your strong vote for > a pure palette file approach, I believe I have thought of a nice way to > implement that. Implement a static function cmap0_palette_read (consisting > of > most of the code in plspal0 now) that reads/checks the cmap0 palette files > and which returns r,g,b,a data without messing with cmap0. plsscmap0n calls > plcmap0_def which is updated (if imin <= imax) to call cmap0_palette_read to > always fill in the r,g,b,a data from imin to imax with default colours. An > updated version of plspal0 merely calls cmap0_palette_read, optionally calls > plsscmap0n to establish a cmap0 of the right size, and copies the r,g,b,a > data delivered by cmap0_palette_read to cmap0. > > Note with this approach we don't need logic to avoid potential recursion > issues (since plsscmap0n does not call plspal0) and we go back to exactly > the behaviour we had before for plsscmap0n but implemented using a pure > palette file approach. > > I will try my hand at implementing this approach today, and if it works > without problems I will commit it. I will check the list periodically today > if you have some additional advice about this approach (the best way to > handle the r,g,b,a data returned by cmap0_palette_read, for example).
Alan, I like this approach more than the updated patch I posted to the list. Your proposed approach sounds reasonably clean and straightforward. Thank you for working on this! Hez -- Hezekiah M. Carty Graduate Research Assistant University of Maryland Department of Atmospheric and Oceanic Science ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel