logo

For this Application I followed the step-by-step guide that was

   

Added on  2023-03-30

4 Pages343 Words265 Views
For this Application I followed the step-by-step guide that was provided.
Each function is as defined in the pdfs that were provided on LMS
The Imports required were;
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
To start with, I copy pasted the starting section of the program as outlined in the assignment
instructions, as follows;
ALL THIS THIS SECTION I DID NOT CHANGE ANYTHING AS IT WAS GIVEN THE WAY IT IS
#define MAX_FILE_NAME_SIZE 100 // this defines the maxim
struct Pixel
{
unsigned char red;
unsigned char green;
unsigned char blue;
};
struct RGB_Image
{
char file_name[MAX_FILE_NAME_SIZE];
long height;
long width;
long size;
struct Pixel** pixels;
};
//FILE FUNCTIONS AND DYNAMIC MEMORY ALLOCATION
int load_image(struct RGB_Image* image);
int save_image(struct RGB_Image image);
//FREE FUNCTION
void free_RGB_pixels(struct RGB_Image image);
//REALLOC FUNCTION
void re_allocate_pixels(struct RGB_Image image, int new_height, int
new_width);
//IMAGE FUNCTIONS
void save_copy_image();
void remove_channel_image();
void invert_image();
void quantize_image();
void flip_horizontal_image();
For this Application I followed the step-by-step guide that was_1
void flip_horizontal_image();
void change_luminosity_image();
void print_information_image();
void crop_image();
//PIXEL FUNCTIONS
void invert_pixels(struct Pixel** pixels, int height, int width);
void flip_horizontal_pixels(struct Pixel** pixels, int height, int width);
void quantize_pixels(struct Pixel** pixels, int height, int width, int
quantization_level);
void remove_red_pixels(struct Pixel** pixels, int height, int width);
void remove_green_pixels(struct Pixel** pixels, int height, int width);
void remove_blue_pixels(struct Pixel** pixels, int height, int width);
void change_luminosity_pixels(struct Pixel** pixels, int height, int width,
int lum_level);
//END OF COPY PAST SECTION
1.0 Main Function
For the main function, I used an infinite loop to always display the console interface. I used a while
loop : and an IF ELSE Structure to select the options.
while(1 > 0){
printf("\n\n IMAGE MENU \n\n");
printf(" 0. Print Image Information\n");
printf(" 1. Save Copy of Image\n");
printf(" 2. Change Luminosity\n");
printf(" 3. Remove Image Channel\n");
printf(" 4. Invert Image Clours\n");
printf(" 5. Quantize Image\n");
printf(" 6. Flip Image Horizntally\n");
printf(" 7. Crop Image\n");
printf(" -1. Quit\n");
printf("\nChoice>> : ");
For this Application I followed the step-by-step guide that was_2

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Desklib - Online Library for Study Material
|11
|2075
|276

CLDA Loan Management Application: View, Request, Sort and Accept Loans
|14
|3975
|327