Question: (C++) For this assignment, make sure that you comment your source code adequately. Your job is to write the fill function for a raster-based graphics

 (C++) For this assignment, make sure that you comment your source

(C++)

For this assignment, make sure that you comment your source code adequately.

Your job is to write the fill function for a raster-based graphics program. The graphic is stored in a 2D array of symbols. The input to the function is the row and column cell of the pixel (symbol) to be changed and what symbol to change it to. The goal is to fill the enclosed shape (of one symbol) with the new symbol. This should be done recursively.

The program should dynamically read in an ascii art file, then prompt the user for the cell to fill and what symbol to fill it with. Then allow the user to save the new art. Example run:

Select from the options: (L)oad art, (F)ill, (S)ave art Choice? L File to read: art.txt 
 .. .. 

 . 
'~'$$$$$$$\ /$$$$$$>@@@@@>. `'$$$$$$$$$$$$ '>@@@@@>. 
. 
 '@@@@>' 

'' '' '' '' '' '' '@@@@>'

 o$$$$$$oo. o$$$$$$$$$$$. 

)$$$$$$$$$$

'>@@@@@>. >@@@@@>' 
o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$oooooo... 

>@@@@>'

' 
 '@@@@>' 
 '' '' ^^ 
 >@@@@>' >@@@@>' 

>@@@@>'

Select from the options: (L)oad art, (F)ill, (S)ave art Choice? F 
Cell to begin Fill: Cell Row: 5 Cell Column: 27 Symbol: + 
 .. .. 

.@@@@@>. .@@@@@>. .@@@@@>. '@@@@@>' '@@@@>' '@@@@@@@@>' '' '' '' '' '' '' '@@@@>'

 ' 
 '@@@@>' 
 '' '' ^^ 
Select from the options: (L)oad art, (F)ill, (S)ave art Choice? S 
File to write: artn.txt 
Select from the options oad art, Fill, ase art syrebek The rgv ? ?? the fsrctwis tir nva and cabs", cell ar tie pise! 'svrioll t he ch.rge

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!