|
|
|
|
|
by jiggy2011
5219 days ago
|
|
Beyond OS kernels , drivers and embedded systems is there any real use for this? I only ask because we were never taught about bit shifting at university and I can't think of a time where it would have ever been useful in my work but despite this it seems to be a very common thing to ask about at interviews so I have sort of educated myself about it for that reason alone. |
|
int pixel = image.get(x, y);
int alphaVal (pixel & 0xFF000000) >> 24;
int redVal = (pixel & 0x00FF0000) >> 16;
int greenVal = (pixel & 0x0000FF00) >> 8;
int blueVal = (pixel & 0x000000FF);
That's just one example w/ one piece of software, but I know similar approaches are often used within the world of imaging / graphics. Maybe networking? Seem like it would correlate well to IP address operations.