On Fri, Jan 20, 2012 at 11:25:28AM -0800, Alan Irwin wrote:
> On 2012-01-20 03:32-0800 phil rosenberg wrote:
> 
> > Sorry for the multiple emails today.
> > 
> > I have been looking at removing references to cmap0 and cmap1 in wxwidgets. 
> > I noticed that in plplotP.h the switches for state function
> > calls include PLSTATE_COLOR1 and PLSTATE_COLOR2 and there are apropriate 
> > functions in the wxWidgets drivers to deal with these. I'm not
> > sure what the appropriate driver response should be to these calls. Should 
> > it be to set the driver's internal colour from cmap0/cmap1
> > or set it from curcolor?
> 
> curcolor.
> 
> To explain that further, qt.cpp is one of our most well-maintained
> device drivers.  If you look at the various plD_state_* functions in
> qt.cpp, you will see code like this:
> 
>      case PLSTATE_COLOR0:
>          ( (QtPLDriver *) widget )->QtPLDriver::setColor( pls->curcolor.r, 
> pls->curcolor.g, pls->curcolor.b, pls->curcolor.a );
>          break;
> 
>      case PLSTATE_COLOR1:
>          ( (QtPLDriver *) widget )->QtPLDriver::setColor( pls->curcolor.r, 
> pls->curcolor.g, pls->curcolor.b, pls->curcolor.a );
>          break;
> 
> i.e., curcolor is used for both.  I have also reviewed some of our
> other drivers and the large majority of them use curcolor.  Some use
> the above PLSTATE_COLOR0 and PLSTATE_COLOR1 method while others (e.g.
> svg.c and cairo.c) ignore that and simply use curcol from the PLStream
> state.
> 
> So I suggest you use curcolor with wxwidgets as well.

I agree with Alan's recommendation, but would add the following

If you look at some of our mature and heavilty tested "standard" drivers        
                                                                                
such as ps.c and xwin.c you will see that this is not entirely                  
                                                                                
standardised.  I don't think it practically matters since in plplot             
                                                                                
curcolor is always set appropriately before plP_state is called with            
                                                                                
PLSTATE_COLOR0 or PLSTATE_COLOR1.                                               
                                                                                
                                                                                
                                                                                
The consensus seems to lean towards using curcolor, so I would do that.         
                                                                                
                                                                                
                                                                                
The state code only matters for buffering of plot commands (e.g. as used by     
                                                                                
plreplot).  Current not all features are correctly buffered. For example        
                                                                                
none of the buffering of colour information stores the transparency. We         
                                                                                
are aware this is an area that needs some work, but currently no-one has        
                                                                                
stepped forward to take this on. This would also include looking at the         
                                                                                
plmeta driver.

Andrew

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to