Question: Create and add a single C source file called t2.c. t2.c should contain the function draw_rectangle( ) and agree exactly with this function declaration: The

Create and add a single C source file called "t2.c". "t2.c" should contain the function draw_rectangle( ) and agree exactly with this function declaration:

void draw_rectangle( uint8_t array[], unsigned int cols, unsigned int rows, int x,

The rectangle edges are aligned with the x,y axes.

A corner of the rectangle is at the pixel at coordinate {x,y}, and the rectangle is rect_width pixels wide by rect_height pixels tall.

Each rectangle size may be negative, extending the rectangle to the left and/or up, or positive, extending right and/or down.

A rectangle wih zero in either dimension should not be drawn.

The rectangle outline is one pixel thick.

void draw_rectangle( uint8_t array[], unsigned int cols, unsigned int rows, int x, int y. int rect_width, int rect_height, uint8_t color );

Step by Step Solution

3.32 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement the drawrectangle function in t2c you need to manipulate the given array to represent t... View full answer

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 Programming Questions!