C++ image overlay( fstream objects) high school project

Storniert Veröffentlicht vor 7 Jahren Bezahlt bei Lieferung
Storniert Bezahlt bei Lieferung

Take any two (24bit).bmp files as inputs and overlay them by copying half of the pixels from one file into the other.

Clues:

Ask the user to enter the file names, without the .bmp extensions

Open both files using separate fstream objects (don't

forget to set the binary flag)

Read each file into its own Image struct

Determine which file has the smallest width and which has the smallest height, in pixels, and store the smallest width and height as variables.  You don't want your overlay to write out of the boundaries of a smaller image.

Loop through your pixel arrays, stopping at the smallest width and smallest height.

Write every other pixel's "bgr" values from the second image into the first image.  

This will create the effect of one image blurring into the other, since pixels from both images will be present.

You may want to use a bool and toggle its value each time the loop advances, and copy over the bgr values only when it is true.

When the loop is finished, write the modified pixel struct back into the first image file.

Close both files and deallocate each Image struct's pixel arrays.

You don't have to upload the images you used.

Sample code (download ImageEditor):This code will show you how to load one .bmp file into a struct and loop through its pixels.

Need done on May 5th.

C++ Programmierung

Projekt-ID: #13909026

Über das Projekt

1 Vorschlag Remote Projekt Aktiv vor 7 Jahren

1 Freelancer bietet durchschnittlich $25 für diesen Job

josemontenegro13

Computer Engineer. Plenty of experience solving algorithmic problems via code. C++ is one of my main languages

$25 USD in 1 Tag
(50 Bewertungen)
5.0