[vtk-developers] vtkColorTransferFunction ambiguities about ranges

Bill Lorensen bill.lorensen at gmail.com
Thu Apr 25 12:00:06 EDT 2013


I believe the range is 0->1. I think it was meant to be .6



On Thu, Apr 25, 2013 at 9:58 AM, Sean McBride <sean at rogue-research.com>wrote:

> On Wed, 24 Apr 2013 15:04:57 -0400, David Doria said:
>
> >>   // Description:
> >>   // Add/Remove a point to/from the function defined in RGB or HSV
> >>   // Return the index of the point (0 based), or -1 on error.
> >>   // See the description of class vtkPiecewiseFunction for an
> explanation of
> >>   // midpoint and sharpness.
> >>   int AddRGBPoint( double x, double r, double g, double b );
> >>   int AddRGBPoint( double x, double r, double g, double b,
> >>                    double midpoint, double sharpness );
> >>   int AddHSVPoint( double x, double h, double s, double v );
> >>   int AddHSVPoint( double x, double h, double s, double v,
> >>                    double midpoint, double sharpness );
> >>
> >> What is the allowable/required/expected range of these things?  Should
> >RGB values always be 0 to 1?  Likewise for HSV?  Is hue 0 to 1?  0 to
> >2π?  0 to 360?  etc.  Am I just missing where this is documented?
> >>
> >> Cheers,
> >
> >I'm not sure if vtkColorTransferFunction is consistent, but I added
> >the ranges for color space conversions to the vtkMath documentation a
> >while back, e.g.
>
> Well, anyone have an opinion on
>
> Common/DataModel/Testing/Cxx/otherColorTransferFunction.cxx:36
>
>   ctf1->AddHSVSegment (11.0, 1, 1, 6, 15.0, .1, .2, .3);
>
> where the API is:
>
>   void AddHSVSegment( double x1, double h1, double s1, double v1,
>                       double x2, double h2, double s2, double v2 );
>
> Is "6" a valid value to pass as 'V' in HSV?
>
> It's the cause of the undefined cast of a large double to a uint8.  If I
> change the test's "6" to "0.6" the test still passes and the undefined
> behaviour is gone.
>
> Cheers,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130425/1d1532ec/attachment.html>


More information about the vtk-developers mailing list