Using QwtPlot with int instead of double
Hello!
When drawing a curve (QwtPlotCurve, etc.) in a QwtPlot, one must provide an array of double values since QwtPlot itself uses double for coordinates (right?).
But lets say that one of my graphs will never require such precision; instead, lets, say, I want a QwtPlot with 600 x 400 where each point will correspond exactly as one pixel on the screen and the scales will also consider integer, not float precision (lets say that the minimum values in both scales will be 0-1, never a 0-0.5 or the like). For such a situation, the usage of double seems only unnecessary loose of processing, such not only I'll have to convert my vector of int into a vector of double (in embedded situation that's a nicely avoidable loop!), but also all the calculations "inside" Qwt's system will also be in double when, as sad, I need only integer precision.
If my assumptions are correct, is there a way to change this? Since all Qwt methods related to this consider double, this means I'ld have to edit the library, right? In this case, are there some considerations to pay attention to or it's just I matter of overloading the methods to use integer numbers?
Thanks,
Momergil
Re: Using QwtPlot with int instead of double
Quote:
When drawing a curve (QwtPlotCurve, etc.) in a QwtPlot, one must provide an array of double values since QwtPlot itself uses double for coordinates (right?).
QwtPlotCurve is completely independent of how samples are stored. I explained the concept of QwtSeriesData many times ...
Quote:
Since all Qwt methods related to this consider double, this means I'ld have to edit the library, right?
Better save your time not even trying it - you will never succeed. And as long as you don't have a CPU without a floating point unit I wouldn't see any benefits.
Uwe
Re: Using QwtPlot with int instead of double
Hello Uwe and thanks for the reply.
Quote:
Originally Posted by
Uwe
QwtPlotCurve is completely independent of how samples are stored. I explained the concept of QwtSeriesData many times ...
Uwe
Well, not sure how this answer the point :) The point of my comment wasn't to talk about "how" samples are stored, but if they use only double values or of other kind (such as int).
Quote:
Originally Posted by
Uwe
Better save your time not even trying it - you will never succeed. And as long as you don't have a CPU without a floating point unit I wouldn't see any benefits.
Uwe
that is the point ;) I'm doing the work for a ARM processor (Texas' OMAP) that don't use a floating point unit :T So taking this into consideration plus the fact that floating values will never be shown on the interface plus the problem of limited processing, well then you may see it would have it's benefits if I could avoid double or float values as much as possible :)
Any tip about how to best solve this problem if editing the library is not a viable option? Don't forget I'm using QwtPolarPlot as well ;)
Thanks,
Momergil