Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When working with depth bits, Chapter 3 used the bitwise complement operator to invert the bits. The bitwise complement operator in C# is the ~ (tilde) symbol. Listing 3-7 used the operator to invert the colors of the depth bits. Depth values in the bits of a depth image frame range from 0 to 4095. If these bits are used as is to create images, the shades of gray are much closer to black than white. Simply inverting the bits produces grays that are closer to white than they are to black.
In a depth image, the depth value of each pixel is 16 bits or two bytes. In a 16-bit color palette, black is zero and 65535 is white. The integer value when all 16 bits are turned on is 65535, which makes it the compliment of zero. Figure A-4 shows another example of the bitwise compliment operation.