Results 1 to 4 of 4

Thread: QImage Non-Standard Format Probem

  1. #1
    Join Date
    Feb 2010
    Posts
    20
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question QImage Non-Standard Format Probem

    I'm working on a project that needs a rasterized image in a very odd format.

    Project Required Format - RRGGBB00
    QImage::Format_RGB888 - 00RRGGBB

    So the RGB888 format is "almost" what I need. Does anyone know if QT has a way to convert to the format this project is looking for from a standard fromat?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QImage Non-Standard Format Probem

    Did you try using QImage::InvertRgba?
    http://doc.trolltech.com/4.6/qimage....nvertMode-enum
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2010
    Posts
    20
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QImage Non-Standard Format Probem

    Quote Originally Posted by high_flyer View Post
    Did you try using QImage::InvertRgba?
    http://doc.trolltech.com/4.6/qimage....nvertMode-enum
    It just inverts in image color. It does not do any byte swaping. Also looked at swap and that only swaps the red and blue channels.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QImage Non-Standard Format Probem

    EDIT:
    It does change each channel, but inverts it, not swaps it, so this indeed wont help you...
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Using the standard library with qt creator
    By DragonLance156156 in forum Qt Tools
    Replies: 12
    Last Post: 3rd February 2016, 08:59
  2. QImage, get file format
    By greenvirag in forum Qt Programming
    Replies: 6
    Last Post: 29th December 2008, 13:13
  3. Replies: 2
    Last Post: 2nd June 2008, 08:45
  4. QImage Format Issue
    By vishal.chauhan in forum Qt Programming
    Replies: 7
    Last Post: 9th March 2007, 10:14
  5. Replies: 3
    Last Post: 15th March 2006, 11:44

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.