Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Converting display to single color output

    General and Desktop
    2
    10
    3522
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      Escher last edited by

      I'm writing an application that needs to output all items using only a single color, green. The display device can only show green and doesn't do the color conversion itself. I'm using full color SVG images as well as custom drawing to accomplish the requirements for the display, but need a way to render the SVG images using only a single color. Being new to Qt, I'm not sure what I need in order to accomplish this goal, but I'm hoping you all can help.

      Thanks.

      1 Reply Last reply Reply Quote 0
      • M
        mlong last edited by

        Is it 2-bit green, or multiple shades of green?

        Software Engineer
        My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

        1 Reply Last reply Reply Quote 0
        • E
          Escher last edited by

          Just a single shade of green. It's a transparent display, so it's either green or nothing (black).

          1 Reply Last reply Reply Quote 0
          • M
            mlong last edited by

            You probably want to look at "QBitmap":http://doc.qt.nokia.com/4.7/qbitmap.html.

            Edit: There's also a nice SVG rendering example "here":http://doc.qt.nokia.com/latest/painting-svgviewer.html. Also, a key phrase from the QBitmap docs is: "If a pixmap with a depth greater than 1 is assigned to a bitmap, the bitmap will be dithered automatically."

            Just a few thoughts...

            Software Engineer
            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

            1 Reply Last reply Reply Quote 0
            • E
              Escher last edited by

              I saw that, but didn't see how I could tell it that the colors I wanted to use was green/black instead of black/white. Also, I have two prototype systems, one using QPixmap to render the images and the other using QGraphicsSvgItem. While QBitmap could be used as a substitute in the first case, I don't know how I could use it for the second. What could I do in that case?

              Is there a way i can adjust some sort of global palette?

              1 Reply Last reply Reply Quote 0
              • M
                mlong last edited by

                Hmm... I'm not sure I fully understand what you're wanting to do then. It's probably because I'm still thinking in terms of my early days when mono displays weren't that uncommon and regardless of whether they were green or white or amber, they were still moreless representing a black & white image (which just happened to be displayed as black and green or black and amber or whatever.)

                Are you trying to pull just the greenish elements from the SVG and display them? Or trying to represent the full color image as dithered shades of green? How do you intend to handle, say, something that's red or blue in your source image?

                Software Engineer
                My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                1 Reply Last reply Reply Quote 0
                • E
                  Escher last edited by

                  What I want to do is take whatever color is there and have it be green. The display device I'm using only displays the green channel of color, so if any other color is used, it's essentially hidden by this device.

                  1 Reply Last reply Reply Quote 0
                  • M
                    mlong last edited by

                    Perhaps you should just map it to a greyscale image which creates the same values in the red, green, and blue channels. If you then toss out the red and blue channels, the green should be sane, I would think.

                    Or, is there any chance of pre-adjusting the SVG files so they're just green?

                    Software Engineer
                    My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                    1 Reply Last reply Reply Quote 0
                    • E
                      Escher last edited by

                      I could adjust the SVG files that come prepackaged (9,000 files), but at some point new images will be issued to the system programatically and the program will need to be able to handle converting them to all green. Better in the long run to just do that conversion now.

                      1 Reply Last reply Reply Quote 0
                      • M
                        mlong last edited by

                        Aside from what I've mentioned, I really don't have a lot of other insight without a better idea of what the source files look like and how they're envisioned of appearing in the final display, etc.

                        I hope you have some better ideas now after this exchange, or that anyone else might have some good insight.

                        Software Engineer
                        My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post