|
lab_intro
Ineluctable Introduction
|
A simple C++ program that manipulates an image. More...
Functions | |
| PNG | drawCrosshairs (PNG original, int centerX, int centerY, RGBAPixel color) |
| This function accepts a PNG object, two integer coordinates and a color, and proceeds to draw a horizontal line across the image at the y coordinate and a vertical line down the image at the x coordinage using the given color. More... | |
| PNG | brighten (PNG original, int amount) |
| This function brightens a rectangle of a PNG, increasing the components (red, green, blue) of each pixel by the given amount. More... | |
| PNG | blendImages (PNG firstImage, PNG secondImage) |
| This function blends, or averages, two PNGs together. More... | |
| int | main () |
| The main function in this program (the starting point of the execution of our code). More... | |
A simple C++ program that manipulates an image.
This function accepts a PNG object, two integer coordinates and a color, and proceeds to draw a horizontal line across the image at the y coordinate and a vertical line down the image at the x coordinage using the given color.
The modified PNG is then returned.
| original | A PNG object which holds the image data to be modified. |
| centerX | The center x coordinate of the crosshair which is to be drawn. |
| centerY | The center y coordinate of the crosshair which is to be drawn. |
| color | The color of the lines to be drawn. |
This function is already written for you so you can see how to interact with our PNG class.
This function brightens a rectangle of a PNG, increasing the components (red, green, blue) of each pixel by the given amount.
You must account for potential overflow issues (color components can only store numbers between 0 and 255). If you attempt to store a value greater than 255 into a color component, the result will wrap around (and you won't be able to check if it was greater than 255).
| original | A PNG object which holds the image data to be modified. |
| amount | The integer amount by which to increase each pixel's components. |
You can assume amount is positive.
This function blends, or averages, two PNGs together.
That is, each pixel in the returned image consists of the averaged components (red, green, blue) of the two input images.
| firstImage | The first of the two PNGs to be averaged together. |
| secondImage | The second of the two PNGs to be averaged together. |
| int main | ( | ) |
The main function in this program (the starting point of the execution of our code).
1.8.9.1