Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me !! I hope to find the solution, the size of the picture is [600][800] Implement the function void flipImageVertically(int rows, int columns,

please help me !!
I hope to find the solution, the size of the picture is [600][800] image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Implement the function void flipImageVertically(int rows, int columns, int image[rows][columns]). This function accepts the number of rows and columns of an image, along with the image as a 2D array, and flips the image vertically inside the array and writes it into the same file by calling the storeImageInFile function. Flipping an image vertically means that the top row of pixels becomes the last row, the 2nd row becomes the 2nd to last, and so on. The following figure shows the result of flipping the original image.in file vertically. Figure 6: Original image on the left and vertically flipped image on the right As explained in the table in Task 1, you should read the image dimensions and the actual image from the file before calling this function so you could pass them to it. When this function is done, you should call the appropriate function to draw the image from within mainMenu as well. Before you implement flipImageVertically, it is recommended that you implement the functions extractImageRows, extractImageColumns, readImageFromFile, and drawImageFromFile. extractImageRows: Accepts a file name of an image and reads and returns the number of rows of that image. Read the description of the file image.in to understand the structure of the image. extractImageColumns: Accepts a file name of an image and reads and returns the number of columns of that image. Read the description of the file image.in to understand the structure of the image. readImageFromFile: Accepts a file name of an image, the number of rows and columns of an image, and a 2D array of the passed dimensions. It reads the pixels of the image from the file and stores them inside the passed 2D array. drawImageFromFile: Accepts a file name of an image, and the number of rows and columns of an image. It reads the image from the file and draws it using the showArray function from the foc_fa33.h header. storeImageInFile: Accepts a file name of an image, the number of rows and columns of an image, and a 2D array of the passed dimensions, and a file name. It writes the pixels of the image in the array into a file called by the passed name. Remember to preserve the structure of the image files so that readImageFromFile can read them again. \begin{tabular}{|l|l|l|l|} \hline 4 & void flipImageVertically(int rows, int columns, int image[rows][columns]) & Extract the number of rows and the number of columns of the image using the helper functions extractImageRows and extractImageColumns, then create an array with the extracted dimensions, use readImageFromFile to read the image from the file and fill it in the array then pass the filled array to this function along with the dimensions. & Call the function to draw and display the image after this function flipped it. \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions