Top Level Namespace

Defined Under Namespace

Modules: VNCRec

Instance Method Summary collapse

Instance Method Details

#h_bitmask(input, count, offset = 0) ⇒ Object


197
198
199
200
201
202
# File 'lib/vncrec/rfb/enczrle.rb', line 197

def h_bitmask(input,count,offset=0)
  #return first n bits of ushort as integer
  #TODO: make generalization of input type
  input <<= offset
  (input & (0xFFFF - 2**(16-count) + 1)) >> (16 - count)
end