Question
1 swap_alpha_red(int p) 2 // TO FILL 3 return 0; 4 } 5 6 7 int main() { 8 int p = OxB3735AF9; 9 int
1 swap_alpha_red(int p)
2 // TO FILL
3 return 0;
4 }
5
6
7 int main() {
8 int p = OxB3735AF9;
9 int q = 0xABCDEF01;
10
11 printf("p = %s ", int2hex(p));
12 printf(-q = %s -, int2hex(q));
13
15 printf("clear_red(p) %s -, int2hex(clear_red(p)));
16 printf(-opacify(p) = %s -, int2hex(opacify(p)));
17 printf("franken_pixel(p,q) %s -, int2hex(franken_pixel(p,q)));
18 //printf(-invert(p) = %s -, int2hex(invert(p)));
19 //printf(-red_everywhere(p) %s ", int2hex(red_everywhere(p)));
20.1111r//printf(-BAD_swap_alpha_red(p) %s -, int2hex(BAD_swap_alpha_red(p)));
21 //printf(-swap_alpha_red(p) %s ", int2hex(swap_alpha_red(p)));
Complete the lab
From the file ints.cO in lab explain what is wrong in the function BAD_swap_alpha_red(int p)
that should swap the components of the red and alpha channel.
Fill the swap_alpha_red(int p) function that performs the correct operation, and test it on docker with ccO.
Provide the output of execution printing the correct colors.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started