Results 1 to 3 of 3

Thread: Is it possible to use QTransform for TOMS transpose?

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Is it possible to use QTransform for TOMS transpose?

    Hi,

    I have a float array representing an M x N matrix,
    array[0, 1, 2, ..., N x M]

    I need to do an in-place (or in-situ) transpose so the new float (or double) array become an N x M matrix, as described here: http://en.wikipedia.org/wiki/In-plac..._transposition

    I am wondering if QTransform::rotate( 90 ) can be used here, and if so, how fast will it be?

    I am thinking of this:

    float (or double) array[ MxN ]

    QImage image ( (const uchar *)array, N, M, QImage::Format_RGB32 )
    QTransform xf;
    xf.rotate( 90 );
    image = image.transformed( xf );

    After that, the array will be an NxM matrix?

    However, does image.transformed( xf ) perform in-place transpose? My MxN array can be as big as 30 GB in size, if making a new copy of the data, I won't be thinking of QTransform.

    There are some C/Fortran codes available, but I really prefer Qt if it can do it...

    Thanks.

  2. #2
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Is it possible to use QTransform for TOMS transpose?

    Never mind, I will just use the C codes

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is it possible to use QTransform for TOMS transpose?

    Rotation and transposition are not the same. With transposition the top-left cell remains top-left after being transposed, with rotation it becomes the top-right cell.

    But regardless of that the answer would still be "no". rotate() doesn't rotate the matrix, it modifies the matrix so that it can serve as a rotation transformation.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Perspective correction with QTransform
    By dustparticle in forum Qt Programming
    Replies: 1
    Last Post: 3rd June 2008, 23:01

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.