How to reverse bits...

John Lauro jal at acc
Wed Aug 15 09:33:08 AEST 1990


In article <1990Aug14.203212.16248 at motcad.portal.com> jtc at motcad.portal.com (J.T. Conklin) writes:
>Another useful table is one that flips the bits 1-for-0,0-for-1.  This
>is useful for inverting an image.

How about:   (assuming 8 bit char c) 
   c=255-c;  or
   c^=255;

    - John_Lauro at ub.cc.umich.edu



More information about the Comp.lang.c mailing list