module ChunkyPNG::Canvas::Adam7Interlacing

def adam7_multiplier_offset(pass)

Parameters:
  • pass (Integer) -- The pass number, should be in 0..6.
def adam7_multiplier_offset(pass)
  [
    3 - (pass >> 1),
    pass & 1 == 0 ? 0 : 8 >> ((pass + 1) >> 1),
    pass == 0 ? 3 : 3 - ((pass - 1) >> 1),
    pass == 0 || pass & 1 == 1 ? 0 : 8 >> (pass >> 1),
  ]
end