ok could someone please have a look at this pseudocode i developed and comment on it:
Code:
Algorithm image
ep100lib.h
INTEGER width
INTEGER height
DOUBLE scroll
CHARACTER filename <-- NULL
output 'Welcome to my program'
if argv[1] = -i
output 'You have decided to invert the image'
..CALL FUNCTION..
elseif argv[1] = -h
scroll <-- argv[2]
filename <-- argv[3]
ep100_lib_init()
ep100_lib_open_image(filename)
INTEGER data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y]
ep100_lib_get_data(data)
width <-- ep100_lib_get_image_width()
height <-- ep100_lib_get_image_height()
output 'You have decided to scroll the image'
scroll_image_procedure(data,scroll)
elseif argv[1] = -v
DOUBLE scroll <-- argv[2]
output 'You have decided to scroll the image'
..CALL FUNCTION..
else
output 'ERROR: Incorrect argument'
return 0
endif
end algorithm
and the procedure:
Code:
void scroll_image_procedure(int data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y], double scroll)
INTEGER x
for(x <-- 0 to Ep100_LIB_MAX_X)
data[X+scroll] = data
thanks