|
@@ -109,24 +109,24 @@ The following functions are useful to work with data of type `QRgb`:
|
109
|
109
|
|
110
|
110
|
---
|
111
|
111
|
|
112
|
|
- #include <QImage>
|
113
|
|
- #include <iostream>
|
|
112
|
+ #include <QImage>
|
|
113
|
+ #include <iostream>
|
114
|
114
|
|
115
|
|
- using namespace std;
|
116
|
|
- int main() {
|
117
|
|
- QImage myImage(“/Users/rarce/Downloads/chuck.png”);
|
118
|
|
- QRgb centralPixel;
|
|
115
|
+ using namespace std;
|
|
116
|
+ int main() {
|
|
117
|
+ QImage myImage(“/Users/rarce/Downloads/chuck.png”);
|
|
118
|
+ QRgb centralPixel;
|
119
|
119
|
|
120
|
|
- centralPixel = myImage.pixel(myImage.width() / 2, myImage.height() / 2);
|
|
120
|
+ centralPixel = myImage.pixel(myImage.width() / 2, myImage.height() / 2);
|
121
|
121
|
|
122
|
|
- cout << hex;
|
|
122
|
+ cout << hex;
|
123
|
123
|
|
124
|
|
- cout << “The red, green and blue components of the middle pixel are: “
|
125
|
|
- << qRed(centralPixel) << “, “
|
126
|
|
- << qGreen(centralPixel) << “, “
|
127
|
|
- << qBlue(centralPixel) << endl;
|
128
|
|
- return 0;
|
129
|
|
- }
|
|
124
|
+ cout << “The red, green and blue components of the middle pixel are: “
|
|
125
|
+ << qRed(centralPixel) << “, “
|
|
126
|
+ << qGreen(centralPixel) << “, “
|
|
127
|
+ << qBlue(centralPixel) << endl;
|
|
128
|
+ return 0;
|
|
129
|
+ }
|
130
|
130
|
|
131
|
131
|
|
132
|
132
|
---
|