Is there a simple way to access pixels of an image informations and manipulate them in Qt?
-
Hi dears
I want to know in an image I have loaded in my program , what are the values of RGB of every pixels?
Is there a simple way for it in Qt or I must use some libraries like OpenCV?Thanks a lot
-
Yes, you need the QImage class. It allows pixel level access.
-
[quote author="utcenter" date="1367673243"]Yes, you need the QImage class. It allows pixel level access.[/quote]
Can you take an example? :D
-
You can get the pixel information:
@
uint color = image.pixel(10, 10);@color will be a 4x8 bit components of the color of the pixel at x 10 and y 10
@image.setPixel(20, 20, color);@
the pixel at x 20 and y 20 will become the same color as the pixel at 10 10
-
Thanks a lot dear friend
I want to read the all RGB values of all pixels of an image and show them in a textplain box
can you take an example about this :D
-
It is not that hard to do that yourself, plus I don't think I'd be making you a favor if I do what begin to suspect is your homework for you.
-
[quote author="utcenter" date="1367679753"]It is not that hard to do that yourself, plus I don't think I'd be making you a favor if I do what begin to suspect is your homework for you.[/quote]
ok , thank you
but what is the unit in your example?
is it a type or a structure? -
uint is an unsigned int. Sounds like you need a little more C++ before you rush into Qt, you really need the basics. Otherwise you wouldn't need help with such a simple assignment.
-
Oh I got it :))
-
I read it unit !! :D