arrays - Inverting image intensities in c -
arrays - Inverting image intensities in c -
void invert( uint8_t array[], unsigned int cols, unsigned int rows ) { int y; uint8_t darkest = 255; uint8_t lightest = 0; uint8_t anygray = y; (int x = 0; x < (cols*rows); x++) { (y = 0; y < (cols*rows); y++) { if (array[x] == darkest && array[x] == anygray && array[x] == lightest) { array[x] = 255-y; } } } }
i have function here inverts image intensities, black becomes white, , vice versa lite grays become dark grays. code here doesn't seem work , don't know went wrong. able help me out?
i haven't prototyped check see @ to the lowest degree 2 things suspicious.
1) expected && in if ||.
2) expected array[x] = 255 - y array[x] = 255 - array[x].
c arrays colors invert
Comments
Post a Comment