Results 1 to 7 of 7

Thread: Adjusting contrast and brighness of QGraphicsView

  1. #1
    Join Date
    Feb 2009
    Posts
    79
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Adjusting contrast and brighness of QGraphicsView

    Hi!

    Is this possible somehow?

    In the ideal case using a definable color conversion matrix?

    Or is it possible to configure the QPainter to do what I want?

    Best regards,Olli

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

    Default Re: Adjusting contrast and brighness of QGraphicsView

    QGraphicsView is a QWidget, you can use QWidget::setBackgroundRole

  3. #3
    Join Date
    Feb 2009
    Posts
    79
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adjusting contrast and brighness of QGraphicsView

    This is not what I intend.

    I woul like to be able to adjust the colors of *all* grpahical output of my view.

    As an example, I would like to decrease the brightness by a factor of 0.5, or increase the contrast, gamma, hue, saturation,....

    I think that the QGraphicsView class is the ideal point where to perform such changes.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adjusting contrast and brighness of QGraphicsView

    What does your view contain ? If its a single picture, you can use QImage to perform the operations.
    There was some demo on Qt Labs about how to increase the brightness, etc.

    If your view contains multiple items, it will be tricky and you will have to decide some algo how to adjust those features...

  5. #5
    Join Date
    Feb 2009
    Posts
    79
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adjusting contrast and brighness of QGraphicsView

    I found this article, but what they propose is just a workaround.
    Does QPainter offer a possibility to adjust the contrast etc ?

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adjusting contrast and brighness of QGraphicsView

    No, QPainter is a painter which helps you draw shapes... it doesnt have intelligence to know what is being drawn..

  7. #7
    Join Date
    Feb 2009
    Posts
    79
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adjusting contrast and brighness of QGraphicsView

    But this would really be a nice feature.

    There is also not really intelligence necessary. One would just specify a transformation matrix that is to be multiplied with the color to be used.

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.