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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -