It starts with the command line option -b existing or not, setting the opt member binary to true or false. Then the gb struct member depth gets 1 for true, and 2 for false. However, there are other commonly used numbers derived from this, leading myself to confusion.
For the number of colors, depth 1 gets 2, depth 2 gets 4, calculated by 2 ^ depth. Also used is this value minus one (used for indexes). Another common occurrence is depth 1 gets 2, depth 2 gets 1, calculated by 3 - depth.
It starts with the command line option
-b
existing or not, setting the opt member binary to true or false. Then the gb struct member depth gets1
fortrue
, and2
forfalse
. However, there are other commonly used numbers derived from this, leading myself to confusion.For the number of colors, depth
1
gets2
, depth2
gets4
, calculated by2 ^ depth
. Also used is this value minus one (used for indexes). Another common occurrence is depth1
gets2
, depth2
gets1
, calculated by3 - depth
.