Skip to content

Commit c3d9576

Browse files
committed
functie aangepast
1 parent 45798d7 commit c3d9576

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

filter/less/filter.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,19 @@ The function `grayscale` should take an image and turn it into a black-and-white
167167

168168
1. Implement a separate `grayscale_pixel` function, which will take an image and returns a gray-scaled `RGBTRIPLE` value for that pixel:
169169

170-
RGBTRIPLE grayscale_pixel(RGBTRIPLE image[height][width], int x, int y)
171-
{
172-
RGBTRIPLE triple;
173-
174-
// calculate the average pixel value
175-
BYTE average = 0; // <--- TODO
176-
177-
// set each color value to the average value
178-
triple.rgbtBlue = average;
179-
triple.rgbtGreen = average;
180-
triple.rgbtRed = average;
181-
182-
return triple;
183-
}
170+
RGBTRIPLE grayscale_pixel(int height, int width, RGBTRIPLE image[height][width], int x, int y)
171+
{
172+
// calculate the average pixel value
173+
BYTE average = 0; // <--- TODO
174+
175+
// set each color value to the average value
176+
RGBTRIPLE triple;
177+
triple.rgbtBlue = average;
178+
triple.rgbtGreen = average;
179+
triple.rgbtRed = average;
180+
181+
return triple;
182+
}
184183

185184
2. Use this function in your `grayscale` function to make the black-and-white version of the full image.
186185

0 commit comments

Comments
 (0)