cant see why this wont compile
Code:
#include <stdio.h>
#include <ep100lib.h>
int Image_Invert(int image_data[height][width], int height, int width)
{
int row, column, red, green, blue;
for(row=0;row <= height; row++)
{
for(column=0; column<= width; column++);
{
red = 255-((image_data[row][column]>>16)&0xff);
green = 255-((image_data[row][column]>>8)&0xff);
blue = 255-((image_data[row][column])&0xff);
image_data[row][column] = ((red<<16)&(green<<8)&(blue));
}
}
return image_data;
}
int main(int argc, char **argv)
{
char *file = NULL;
int no = 1;
int height;
int width;
int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y];
if (argc < 2) // if there are not enough arguments.
return 1;
// now your code to get and process the CLA.....
file = argv[no];
ep100_lib_init(); // Initialise the ep100 library of routines. return 1;
// now your code to get and process the CLA.....
file = argv[no];
ep100_lib_init(); // Initialise the ep100 library of routines.
ep100_lib_open_image(file);
height=ep100_lib_get_image_height();
width=ep100_lib_get_image_width();
fprintf(stdout,"Image is %dx%d\n",width,height);
ep100_lib_get_data(image_data);
ep100_lib_print_data(image_data);
image_data[height][width] = Image_Invert(image_data[height][width], height, width);
// image_process_invert_data(image_data);
// ep100_lib_set_data(image_process_emboss_data(image_data));
ep100_lib_set_data(image_data);
sleep(5); // This gives us a chance to see the orginal and then the new one appears
ep100_lib_display_image(); // Click in the window to exit the program, button 3 zooms
ep100_lib_close();
return 0;
}
the errors are because of the Image_Invert function
these are the errors
Code:
cc -I. -I/usr/units/ep100/ass2.072/ `imlib2-config --cflags` -g -c -o Image.o Image.c
Image.c:4: error: âheightâ undeclared here (not in a function)
Image.c:4: error: âwidthâ undeclared here (not in a function)
Image.c: In function âmainâ:
Image.c:54: error: type of formal parameter 1 is incomplete
make: *** [Image.o] Error 1
does anyone know how i can fix it??