0

Pixel sorting in C

How can I sort pixels of a BMP image based on average value of R+G+B (or any other sorting criteria) by rows? Examples would be helpful

19th Apr 2022, 1:19 PM
Heyy
3 Answers
0
But I am not allowed to use library functions, I need to write an algorithm and then optimise it
19th Apr 2022, 4:01 PM
Heyy
+ 2
https://stackoverflow.com/questions/1787996/c-library-function-to-perform-sort With a barebones sorting function and your custom predicate fn that gives the avg.
19th Apr 2022, 2:34 PM
Valen.H. ~
Valen.H. ~ - avatar
0
If you're not allowed to use premade functions I assume you first have to manually build a BMP file parser and then place all pixels in a buffer and manually iterate, qsort is obsolete.
19th Apr 2022, 5:14 PM
Valen.H. ~
Valen.H. ~ - avatar