So I need to write a program that will iterate over the image and record the pixel positions corresponding to each color pixel that appears in it. For example, given
http://www.socuteurl.com/fishywishykissy
I need to find the coordinates of all yellow, purple, dark pink, etc. pixels.
In C ++, I would use a hash table for this. I would iterate over the image, check each pixel value, look for this value and add the coordinates of the pixel to the vector if it was found, or add a new record to the table if there was no value.
The problem is that I may need to write this program in pure C instead of C ++. How will I do this in C? I feel that the implementation of the hash table will be rather unpleasant and error prone: should I not do this?
I'm pretty inexperienced with C and have a lot of C ++ experience if that matters.
Thank.
source
share