[vtk-developers] Manual conversion of some Tcl to Python tests.

David Gobbi david.gobbi at gmail.com
Fri Aug 31 12:26:04 EDT 2012


On Fri, Aug 31, 2012 at 10:11 AM, David Thompson
<david.thompson at kitware.com> wrote:
>
> Yes, although it might be easier to have
>
>     void SetColor( std::string, double* rgba, int numRGBATuples = 1 );
>     double* GetColor( std::string, int swatch = 0 );

But then you are making unwrappable methods.  It's possible to
have a wrapper hint that "double *rgba" is a 4-tuple, but it isn't
possible to hint that it is a "4*N-tuple".

If you want to support swatches, you should have a GetColorSwatch()
method, rather than complicate the GetColor() method.

> and just use a std::map<std::string,std::vector<double> > internally.

Yup, the internal storage type doesn't really matter... whatever
is most easily maintained.

> I would like to get rid of vtkBrewerColors (the class, not the palettes) before a VTK release contains it in favor of a more generic way of providing palettes. I prefer doubles and a 4-tuple (RGBA) instead of a 3-tuple (RGB). Doubles have a larger dynamic range which is useful for internal representations even if devices can't really present more than 8 bits/channel (although some are starting to). And it seems silly not to accommodate alpha values.

I agree.

 - David



More information about the vtk-developers mailing list