|
|
|
|
79
|
* `qRgb(int red, int green, int blue)` // returns the `QRgb` pixel composed of the red, green and blue values received.
|
79
|
* `qRgb(int red, int green, int blue)` // returns the `QRgb` pixel composed of the red, green and blue values received.
|
80
|
|
80
|
|
81
|
|
81
|
|
82
|
-####Examples:
|
|
|
|
|
82
|
+#### Examples:
|
83
|
|
83
|
|
84
|
1. `QRgb myRgb = qRgb(0xff, 0x00, 0xff);`: Assigns the value `0xff00ff` to `myRgb` which represents the color ![figure2.png](images/figure2.png)
|
84
|
1. `QRgb myRgb = qRgb(0xff, 0x00, 0xff);`: Assigns the value `0xff00ff` to `myRgb` which represents the color ![figure2.png](images/figure2.png)
|
85
|
|
85
|
|
|
|
|
|
87
|
|
87
|
|
88
|
2. If the following `4 x 4` image of pixels represents the object `originalImage`,
|
88
|
2. If the following `4 x 4` image of pixels represents the object `originalImage`,
|
89
|
|
89
|
|
90
|
- ![ejemplo.png](images/ejemplo.png)
|
|
|
|
|
90
|
+ ![ejemplo.png](images/ejemplo.png)
|
91
|
|
91
|
|
92
|
-then `originalImage.pixel(2,1)` returns the `rgb` value that represents the color blue ( `0x0000ff`).
|
|
|
|
|
92
|
+ then `originalImage.pixel(2,1)` returns the `rgb` value that represents the color blue ( `0x0000ff`).
|
93
|
|
93
|
|
94
|
3. The following instruction assigns the color red to the pixel in position `(2,3)` in the edited image:
|
94
|
3. The following instruction assigns the color red to the pixel in position `(2,3)` in the edited image:
|
95
|
|
95
|
|
96
|
-`editedImage.setPixel(2,3,qRgb(0xff,0x00,0x00));`.
|
|
|
|
|
96
|
+ `editedImage.setPixel(2,3,qRgb(0xff,0x00,0x00));`.
|
97
|
|
97
|
|
98
|
4. The following instruction assigns to `greenContent` the value of the green tone that is contained in the pixel `(1,1)` of `originalImage`:
|
98
|
4. The following instruction assigns to `greenContent` the value of the green tone that is contained in the pixel `(1,1)` of `originalImage`:
|
99
|
|
99
|
|