Results 1 to 2 of 2

Thread: spectrogram calls

  1. #1
    Join Date
    Apr 2011
    Posts
    58
    Thanks
    1

    Default spectrogram calls

    Hi.

    I'm referring to the spectrogram calls. The code is as below:

    Qt Code:
    1. class SpectrogramData: public QwtRasterData
    2. {
    3. public:
    4. SpectrogramData()
    5. {
    6. setInterval( Qt::XAxis, QwtInterval( -1.5, 1.5 ) );
    7. setInterval( Qt::YAxis, QwtInterval( -1.5, 1.5 ) );
    8. setInterval( Qt::ZAxis, QwtInterval( 0.0, 10.0 ) );
    9. }
    10.  
    11. virtual double value(double x, double y) const
    12. {
    13. const double c = 0.842;
    14.  
    15. const double v1 = x * x + (y-c) * (y+c);
    16. const double v2 = x * (y+c) + x * (y+c);
    17.  
    18. return 1.0 / (v1 * v1 + v2 * v2);
    19. }
    20. };
    21.  
    22.  
    23. ... somewhere else...
    24. d_spectrogram = new QwtPlotSpectrogram();
    To copy to clipboard, switch view to plain text mode 


    My simple question is, how often is this SpectrogramData function call when drawing out the plot? Is it per pixel?

    Thank you. 'm just trying to learn and get more understanding...

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: spectrogram calls

    It depends on the pixelHint(). If SpectrogramData:ixelHint() returns something invalid it is called for each pixel in terms of the target paint device. Otherwise the number of calls may be less, when one data pixel covers more than one target paint device pixel. F.e. QwtMatrixRasterData returns the pixel hint depending on the resampling mode.

    But in any case you should have in mind, that SpectrogramData::value is called very often and it's good practice to pre-calculate as much as possible in SpectrogramData::initRaster().

    Uwe

Similar Threads

  1. Paint() calls
    By alitoh in forum Newbie
    Replies: 1
    Last Post: 10th May 2011, 02:05
  2. strange calls to windows dll's
    By tomrider in forum Qt Programming
    Replies: 5
    Last Post: 9th May 2011, 07:47
  3. How to use IOCTL calls with QT?
    By augusbas in forum Qt Programming
    Replies: 3
    Last Post: 15th November 2010, 07:55
  4. free/delete calls
    By jcoop in forum Newbie
    Replies: 1
    Last Post: 7th March 2009, 09:04
  5. how to group paint calls together ??
    By tampstaffs in forum Qt Programming
    Replies: 3
    Last Post: 26th February 2009, 16:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.