Changes

Jump to: navigation, search

TriForce

6 bytes added, 10:10, 8 March 2019
Assignment 1: EasyBMP
Sample code:
/**/ #include "EasyBMP.h" using namespace std; int main(int argc, char* argv[]){ // Create a new Bitmap image with EasyBMP BMP Background; Background.ReadFromFile(argv[1]); BMP Output; int picWidth = Background.TellWidth(); int picHeight = Background.TellHeight(); Output.SetSize(Background.TellWidth(), Background.TellHeight()); Output.SetBitDepth(1); for (int i = 1; i < picWidth - 1; ++i) { for (int j = 1; j < picHeight - 1; ++j) { int col = (Background(i, j)->Blue + Background(i, j)->Green + 10 * Background(i, j)->Red) / 12; if (col > 127) { Output(i, j)->Red = 255; Output(i, j)->Blue = 255; Output(i, j)->Green = 255; } else {
Output(i, j)->Red = 0;
Output(i, j)->Blue = 0;
Output(i, j)->Green = 0;
} } } Output.WriteToFile(argv[2]); return 0; } /**/
The program was compiled using the following commands:
////In progress
 
=== Assignment 1: Julia Set ===

Navigation menu