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,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/08/6307a18862ce0_4886307a18849ac7.jpg)
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
To implement the drawrectangle function in t2c you need to manipulate the given array to represent t... View full answer
Get step-by-step solutions from verified subject matter experts
