[libpc] The specialness of X, Y, Z dimensions

Michael P. Gerlek mpg at flaxen.com
Wed Apr 13 12:25:27 EDT 2011


> Can't we determine the output type from the return type of the function?
> I'm not so template aware though ...
> 
> Tdst getField<Tsrc>(index, fieldIndex);

I know you're not allowed to do overloading just based on the return type,
but I'm not sure how this plays into the templatedness of things here.  

> > Closely related, I wonder if the enum Int is the wrong type for X --
> > maybe it should be a special enum ScaledInt?
> 
> Isn't that implicit by the existence of a scale/offset value for the
dimension?

The idea would be to have a specialization of the template which "knows" how
to do the Special int->double conversion, as opposed to the regular
int->double conversion.  My idea was that rather than add a runtime check to
the specialized function ("is this int scaled?"), the specialized function
would be for the scaledint->double case so there would be no runtime cost
for the non-special case.

This might be in the realm of premature optimization.  I think we need to
ask, what is the set of conversion operations which need to be specially
handled?  Is it just for the case of Int32 data that is scaled, going to a
Float or a Double?

-mpg





More information about the pdal mailing list