understand the ternary operator in c

Ternary is an adjective meaning "composed of three items".

So In computer science, a ternary operator is an operator that takes three arguments. The arguments and result can be of different types. Many programming languages that use C-like syntax feature a ternary operator, ?:, which defines a conditional expression. It is commonly referred to as the conditional operator, inline if (iif), or ternary if. Since this operator is often the only existing ternary operator in the language, it is sometimes simply referred to as "the ternary operator".

~ is not a ternary operator because it takes only 1 argument. It's the Bitwise NOT

Bitwise NOT changes each bit to its opposite: 0 becomes 1, and 1 becomes 0.

So in your code because picture is an unsigned int on 32 bits initialized with 0, if you don't touch it anywhere else, then you will alternate between 0x00000000 (all 32 bits at 0) and 0xFFFFFFFF (all 32 bits at 1)