controlling the speed/rate with a shift register outs(kinda Larson scanner)

Hello all,

I love the simplicity of this code. However being a noob I have to ask:

 mask = (ctr < 7? mask >> 1: mask << 1);

can some one break this down for me?

Is it a short code for if...then...else?

thank you