aspose file tools
The moose likes Java in General and the fly likes Hexadecimal values and  bitwise operators. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Hexadecimal values and  bitwise operators." Watch "Hexadecimal values and  bitwise operators." New topic
Author

Hexadecimal values and bitwise operators.

Suman Sharma
Ranch Hand

Joined: May 16, 2005
Posts: 72
Can anyone explain me what is happening in each line of these two methods?



Thank you.
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 679

This first method masks off the alpha channel.



If you count the number of f's in the mask, there are 6, each of which is 4 bits wide. This is a 24 bit mask. Each color in RGB is 8 bits times three which is also 24 bits. The 8 bits that is left over is the "alpha channel". The alpha channel contains non-color information such as transparency:

Alpha Channel



The above code converts the RGB color value to a hexadecimal String (base 16).

The following code calculates the complementary color:



In the above code, there is no need to mask out the alpha channel because the RGB codes are fetched individually and the alpha channel is never here.

Kaydell
Suman Sharma
Ranch Hand

Joined: May 16, 2005
Posts: 72
Thank you for your help.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Hexadecimal values and bitwise operators.
 
Similar Threads
Object Comparison
Problem with Linear Transformation method in Cipher program
Colour picker, MouseDown(Event, int x, int y) Depreciation Help!
method in String and Integer
Compiler error in JavaBean