Results 1 to 4 of 4

Thread: there is a way for qt to image mosaicking?

  1. #1
    Join Date
    Dec 2015
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Question there is a way for qt to image mosaicking?

    hi , smart qter ! there is two picture a image & b image. and i got the image like c image . is a way for to get it ?
    eg:
    a image
    bty1.png
    b image
    bty2.jpg
    c image
    2012033018123410.jpg

    if there is a way , please tell me !
    thks much for your kinds !

    by
    poor huifeidmeng

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: there is a way for qt to image mosaicking?

    It is not clear at all what you are asking. Do you want to take two separate images and put them side-by-side in a single image? Do you want to take a side-by-side image and break it into two separate images? Look at the documentation for QImage.

  3. #3
    Join Date
    May 2015
    Posts
    66
    Thanks
    10
    Thanked 17 Times in 17 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: there is a way for qt to image mosaicking?

    Qt Code:
    1. QImage aImage("aImg.png"); // say size = 40x40
    2. QImage bImage("bImg.png"); // say size = 70x40
    To copy to clipboard, switch view to plain text mode 

    To mosaick:
    1. Create an image with the appropriate size.
    Qt Code:
    1. QImage cImage(110, 40, QImage::Format_RGB32); // say size = 40x40
    To copy to clipboard, switch view to plain text mode 
    2. Read pixel data from aImage and bImage and store it in appropriate positions in cImage. This can be done by scanning line by line using QImage::scanLine().
    Example, to copy 0th pixel of a specific row from bImage to cImage:
    Qt Code:
    1. QRgb* bImgLine = (QRgb*)bImage.scanLine(row);
    2. QRgb* cImgLine = (QRgb*)cImage.scanLine(row);
    3. *(cImgLine+40) = *(bImgLine+0);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: there is a way for qt to image mosaicking?

    Quote Originally Posted by Vikram.Saralaya View Post
    Example, to copy 0th pixel of a specific row from bImage to cImage:
    Qt Code:
    1. QRgb* bImgLine = (QRgb*)bImage.scanLine(row);
    2. QRgb* cImgLine = (QRgb*)cImage.scanLine(row);
    3. *(cImgLine+40) = *(bImgLine+0);
    To copy to clipboard, switch view to plain text mode 
    Be careful, your code assumes that bImage has the same format as cImage (QImage::Format_RGB32). You should convert bImage to that format first.

  5. The following user says thank you to yeye_olive for this useful post:

    Vikram.Saralaya (13th January 2016)

Similar Threads

  1. Replies: 15
    Last Post: 24th July 2015, 23:33
  2. Replies: 3
    Last Post: 3rd August 2012, 11:35
  3. Replies: 6
    Last Post: 21st September 2009, 11:55
  4. Replies: 3
    Last Post: 14th March 2007, 09:09

Tags for this Thread

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.