I came across this program under hough transform in java example. But im doing my project in C#, i cannot figure out what is ment by this partial code "0xff000000 ". what this piece of code - 0xff000000 is it a color? if its color how can i convert it C#?
private void drawPolarLine(int value, int r, int theta) {
for(int x=0;x<width;x++) {
for(int y=0;y<height;y++) {
int temp = (int)(x*Math.cos(((theta)*Math.PI)/180) + y*Math.sin(((theta)*Math.PI)/180));
if((temp - r) == 0)
output[y*width+x] = 0xff000000 | (value << 16 | value << 8 | value);
}
}
}
if ((input[y*width+x] & 0xff)== 255) {
//.........
}
The hexadecimal number 0xFF000000 is expressed in dot-decimal notation as 255.0.0.0. The digits 0 and 1 represent?
A hex character does not normally represent a specific decimal character. It represents 4 bits in a Base 2 (Binary) number system. This is why dot-decimal notation is used for IP addresses. It makes it more readable for a user because a Hex FF is ALWAYS used to represent a full octet of binary ones which can always be displayed as 255 in dot-decimal notation.
Lets say you want to represent 1111 1111 0001 1111, you would use 0.0.255.31 in dot-decimal format even though FF1F in Hex is actually 65311 in a Base 10 (Decimal) number system.
Hex ..........Decimal.......bin
0...............0..............0
1...............1..............1
2...............2..............10
3...............3..............11
4...............4..............100
5...............5..............101
6...............6..............110
7...............7..............111
8...............8.............1000
9...............9.............1001
A..............10............1010
B..............11............1011
C..............12............1100
D..............13............1101
E..............14............1110
F..............15............1111
10............16........0001 0000
The programming language Java does not provide you with pointers, so you can't access the memory location of objects/integers and other things. I'm not sure if c# does, but if you truly want to understand how memory locations work, I would learn a language like c++.