Understanding this piece of code (extracting color component from integer)
<p>I have a piece of code that I found when trying to get pixel values from an image, and I don't quite understand it,</p>

<pre><code>red = (rgb &amp; 0x00ff0000) &gt;&gt; 16;
</code></pre>

<p>I understand that it's adding 1 to the value if red colour is there, and I think the <code>0x00ff0000</code> bit is a hexidecimal value for red, and the <code>&gt;&gt;</code> shifts 16 bits to the right.</p>

<p>What is the explanation?</p>
